airwallex / airwallex-payment-demo

Airwallex payment element integration demo
39 stars 24 forks source link

Airwallex.RedirectToCheckout produces "undefined" error on Hosted Payment Page #76

Closed dillonbailey closed 1 year ago

dillonbailey commented 1 year ago

Version Using https://checkout.airwallex.com/assets/elements.bundle.min.js as import is failing, refer to https://github.com/airwallex/airwallex-payment-demo/issues/75

Issue

Our call looks like the below:

          Airwallex.redirectToCheckout({
            env: 'demo', // Which env('staging' | 'demo' | 'prod') you would like to integrate with
            intent_id: data.id,
            client_secret: data.client_secret,
            currency: 'AUD',
          });

RedirectToCheckout produces a blank airwallex page: https://checkout-demo.airwallex.com/#/standalone/checkout/undefined?currency=AUD&from=http://localhost:3000&sessionId=bfbdec2c-ad2c-4766-a178-de22f13e7627

Screenshot 2023-04-03 at 5 37 31 pm

Notes

Sidenote: attempting to use versioned hosted bundles that are versioned, e.g. https://checkout.airwallex.com/assets/bundle.0.2.103.min.js - does not appear to work as expected as this serves a HTML page, not the library.

shirly-chen-awx commented 1 year ago

Hi, @dillonbailey, could you check yourdata.idand data.client_secret to make sure they are not undefined?

dillonbailey commented 1 year ago

Ah too right @shirly-chen-awx - thank you! In trying to get the library loading I overlooked my data structure!

Thank you!