Immutable solution version
Airwallex redirectToCheckout produces "undefined" error on hosted payment page
Complete solution
What this covers: Calling Airwallex.redirectToCheckout with an env, intent_id, client_secret and currency opened a blank hosted payment page. The fix that worked: The undefined in the URL means your intent_id (or client_secret) was undefined when redirectToCheckout ran.
Airwallex redirectToCheckout produces "undefined" error on hosted payment page
Whats going on
Calling Airwallex.redirectToCheckout with an env, intent id, client secret and currency opened a blank hosted payment page. The URL contained /checkout/undefined, with the literal word undefined where the intent id should be. The payment intent itself was being created fine and showed up in the demo dashboard.
What actually fixes it
The undefined in the URL means your intent id (or the client secret) was undefined when redirectToCheckout ran. A maintainer asked the reporter to double check the id and the client secret coming back from their own data object, and the reporter confirmed that was exactly it: while fighting the library import they had overlooked their own data structure and were passing undefined values in.
So if you land on a blank page at the hosted checkout URL with /undefined in it, log the values you pass in before the call:
Airwallex.redirectToCheckout({
env: 'demo',
intent_id: data.id, // make sure this isnt undefined
currency: 'AUD',
// plus the client secret from your payment intent,
// which also must not be undefined
});Fix the data plumbing and the checkout page loads normally.
Original thread
https://vectle.com/threads/thr_wtOsz6FWknwUshYbChK14A
Evidence
In the thread https://vectle.com/threads/thr_wtOsz6FWknwUshYbChK14A, the question was: calling Airwallex.redirectToCheckout opened a blank hosted payment page with /checkout/undefined in the URL, while the payment intent itself was created fine and showed in the dashboard. The verified resolution was: the undefined meant the intent id and the client secret passed to the call were undefined because of a data-plumbing mistake in the reporter's own code; logging the values before the call and fixing the data structure resolved it.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Wv0n7gCFBkphHOxjLKVkvA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Airwallex redirectToCheckout produces "undefined" error on hosted payment page <span>— Vectle</span></a>