feat(payment): expand Stripe methods and checkout handoff
Docker Image / Build and Push Docker Image (push) Successful in 2m10s
Docker Image / Build and Push Docker Image (push) Successful in 2m10s
This commit is contained in:
@@ -4,6 +4,7 @@ import { type Dispatch, useEffect, useRef, useState } from "react";
|
||||
|
||||
import {
|
||||
getPaymentUrl,
|
||||
getStripeCustomerSessionClientSecret,
|
||||
getStripeClientSecret,
|
||||
isEzpayPayment,
|
||||
launchEzpayRedirect,
|
||||
@@ -59,6 +60,8 @@ export interface PaymentLaunchFlow {
|
||||
shouldShowQrisDialog: boolean;
|
||||
shouldShowStripeDialog: boolean;
|
||||
stripeClientSecret: string | null;
|
||||
stripeCustomerSessionClientSecret: string | null;
|
||||
savedPaymentMethodsEnabled: boolean;
|
||||
}
|
||||
|
||||
export interface QrisPaymentDetails {
|
||||
@@ -165,6 +168,9 @@ export function usePaymentLaunchFlow({
|
||||
const stripeClientSecret = payment.payParams
|
||||
? getStripeClientSecret(payment.payParams)
|
||||
: null;
|
||||
const stripeCustomerSessionClientSecret = payment.payParams
|
||||
? getStripeCustomerSessionClientSecret(payment.payParams)
|
||||
: null;
|
||||
const ezpayLaunchTarget =
|
||||
payment.payParams && isEzpayPayment(payment.payParams)
|
||||
? resolveEzpayLaunchTarget(payment.payParams)
|
||||
@@ -385,5 +391,8 @@ export function usePaymentLaunchFlow({
|
||||
shouldShowQrisDialog,
|
||||
shouldShowStripeDialog,
|
||||
stripeClientSecret,
|
||||
stripeCustomerSessionClientSecret,
|
||||
savedPaymentMethodsEnabled:
|
||||
stripeCustomerSessionClientSecret !== null,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user