# 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:

```js
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
