({
children,
successCallback,
disabledEvents,
initialPriceType = PurchaseType.Plus,
discountId,
}: PaddleSubProviderProps)
| 12 | >; |
| 13 | |
| 14 | export 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 | }; |
nothing calls this directly
no test coverage detected