MCPcopy Create free account
hub / github.com/dailydotdev/apps / PaddleSubProvider

Function PaddleSubProvider

packages/shared/src/contexts/payment/Paddle.tsx:14–47  ·  view source on GitHub ↗
({
  children,
  successCallback,
  disabledEvents,
  initialPriceType = PurchaseType.Plus,
  discountId,
}: PaddleSubProviderProps)

Source from the content-addressed store, hash-verified

12>;
13
14export const PaddleSubProvider = ({
15 children,
16 successCallback,
17 disabledEvents,
18 initialPriceType = PurchaseType.Plus,
19 discountId,
20}: PaddleSubProviderProps): ReactElement => {
21 const [priceType, setPriceType] = useState(initialPriceType);
22
23 const {
24 openCheckout,
25 isPaddleReady,
26 checkoutItemsLoading,
27 appliedDiscountId,
28 } = usePaddlePayment({
29 successCallback,
30 disabledEvents,
31 priceType,
32 });
33
34 return (
35 <BasePaymentProvider
36 openCheckout={openCheckout}
37 isPaddleReady={isPaddleReady}
38 checkoutItemsLoading={checkoutItemsLoading}
39 priceType={priceType}
40 setPriceType={setPriceType}
41 discountId={discountId}
42 appliedDiscountId={appliedDiscountId}
43 >
44 {children}
45 </BasePaymentProvider>
46 );
47};

Callers

nothing calls this directly

Calls 1

usePaddlePaymentFunction · 0.90

Tested by

no test coverage detected