feat(payment): expand Stripe methods and checkout handoff

This commit is contained in:
Codex
2026-07-28 16:27:03 +08:00
parent 38ae06fe04
commit e43912eebf
42 changed files with 1151 additions and 92 deletions
@@ -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"