[Feature Request] Waffo Pancake gateway — full integration with subscription support + admin catalog binding flow (#4935)

This commit is contained in:
Hill-waffo
2026-05-22 11:00:58 +08:00
committed by GitHub
parent 8e5e89bb5b
commit 19f1821fc8
45 changed files with 2432 additions and 1086 deletions
@@ -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
}
}