({
priceId,
giftToUserId,
discountId,
}: OpenCheckoutProps)
| 11 | }: PropsWithChildren): ReactElement => { |
| 12 | const router = useRouter(); |
| 13 | const openCheckout = ({ |
| 14 | priceId, |
| 15 | giftToUserId, |
| 16 | discountId, |
| 17 | }: OpenCheckoutProps) => { |
| 18 | // Payment not available in extension |
| 19 | const params = new URLSearchParams({ priceId }); |
| 20 | |
| 21 | if (giftToUserId) { |
| 22 | params.append('giftToUserId', giftToUserId); |
| 23 | } |
| 24 | if (discountId) { |
| 25 | params.append('discountId', discountId); |
| 26 | } |
| 27 | |
| 28 | const url = new URL(`${webappUrl}plus/payment?${params.toString()}`); |
| 29 | router.push(url.toString()); |
| 30 | }; |
| 31 | |
| 32 | return ( |
| 33 | <BasePaymentProvider |
no test coverage detected