feat(payment): expand Stripe methods and checkout handoff
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
import { usePaymentLaunchFlow } from "@/app/_hooks/use-payment-launch-flow";
|
||||
import { PaymentLaunchDialogs } from "@/app/_components/payment/payment-launch-dialogs";
|
||||
import { ExternalBrowserCheckoutButton } from "@/app/_components/payment/external-browser-checkout-button";
|
||||
import { DEFAULT_CHARACTER_SLUG } from "@/data/constants/character";
|
||||
import type { SubscriptionReturnTo } from "@/lib/navigation/subscription_exit";
|
||||
import {
|
||||
@@ -70,6 +71,21 @@ export function SubscriptionCheckoutButton({
|
||||
>
|
||||
{label}
|
||||
</SubscriptionCtaButton>
|
||||
{payment.payChannel === "stripe" && payment.selectedPlanId ? (
|
||||
<ExternalBrowserCheckoutButton
|
||||
disabled={disabled || isLoading}
|
||||
checkoutIntent={{
|
||||
planId: payment.selectedPlanId,
|
||||
autoRenew: payment.autoRenew,
|
||||
...(payment.commercialOfferId
|
||||
? { commercialOfferId: payment.commercialOfferId }
|
||||
: {}),
|
||||
...(payment.chatActionId
|
||||
? { chatActionId: payment.chatActionId }
|
||||
: {}),
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
{payment.errorMessage ? (
|
||||
<p
|
||||
role="alert"
|
||||
|
||||
Reference in New Issue
Block a user