[Feature Request] Waffo Pancake gateway — full integration with subscription support + admin catalog binding flow (#4935)
This commit is contained in:
@@ -59,11 +59,10 @@ function getErrorMessage(message: string | undefined, data: unknown): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook for handling Waffo Pancake payment processing
|
||||
* Hook for the Waffo Pancake hosted-checkout flow.
|
||||
*
|
||||
* Pancake uses a hosted checkout URL flow rather than the generic epay form
|
||||
* submission, so we open the returned URL in a new tab once the backend
|
||||
* returns a successful response.
|
||||
* Same-tab redirect (window.location.href) rather than window.open: the
|
||||
* user-gesture context is lost across the await, so popups get blocked.
|
||||
*/
|
||||
export function useWaffoPancakePayment() {
|
||||
const [processing, setProcessing] = useState(false)
|
||||
@@ -85,8 +84,8 @@ export function useWaffoPancakePayment() {
|
||||
toast.error(i18next.t('Invalid payment redirect URL'))
|
||||
return false
|
||||
}
|
||||
window.open(checkoutUrl, '_blank', 'noopener,noreferrer')
|
||||
toast.success(i18next.t('Redirecting to payment page...'))
|
||||
window.location.href = checkoutUrl
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user