feat(analytics): add behavior and payment funnel tracking
This commit is contained in:
@@ -64,6 +64,7 @@ export interface LaunchEzpayRedirectInput {
|
||||
subscriptionType: PendingPaymentSubscriptionType;
|
||||
tipCoffeeType?: PendingPaymentTipCoffeeType;
|
||||
returnTo?: PendingPaymentReturnTo;
|
||||
onOpened?: () => void;
|
||||
onFailed: (errorMessage: string) => void;
|
||||
}
|
||||
|
||||
@@ -73,6 +74,7 @@ export async function launchEzpayRedirect({
|
||||
subscriptionType,
|
||||
tipCoffeeType,
|
||||
returnTo,
|
||||
onOpened,
|
||||
onFailed,
|
||||
}: LaunchEzpayRedirectInput): Promise<void> {
|
||||
log.debug("[payment-launch] launchEzpayRedirect START", {
|
||||
@@ -121,5 +123,10 @@ export async function launchEzpayRedirect({
|
||||
subscriptionType,
|
||||
paymentUrl,
|
||||
});
|
||||
window.location.href = paymentUrl;
|
||||
try {
|
||||
window.location.href = paymentUrl;
|
||||
onOpened?.();
|
||||
} catch {
|
||||
onFailed("Could not open Ezpay. Please try again.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user