feat(payment): expand Stripe methods and checkout handoff
Docker Image / Build and Push Docker Image (push) Successful in 2m10s

This commit is contained in:
Codex
2026-07-28 16:27:03 +08:00
parent 2e402de15b
commit 59e4eac736
42 changed files with 1151 additions and 92 deletions
+21
View File
@@ -143,6 +143,27 @@ export function getStripeClientSecret(
return null;
}
export function getStripeCustomerSessionClientSecret(
payParams: Record<string, unknown>,
): string | null {
const provider = payParams.provider;
const isStripeProvider =
typeof provider !== "string" || provider.toLowerCase() === "stripe";
const enabled = payParams.savedPaymentMethodsEnabled === true;
const clientSecret = payParams.customerSessionClientSecret;
if (
isStripeProvider &&
enabled &&
typeof clientSecret === "string" &&
/^cuss_[^\s]+_secret_[^\s]+$/i.test(clientSecret)
) {
return clientSecret;
}
return null;
}
export interface LaunchEzpayRedirectInput {
orderId: string | null;
paymentUrl: string;