airwallex / airwallex-payment-demo

Airwallex payment element integration demo
39 stars 24 forks source link

"export 'default' (imported as 'Airwallex') was not found in 'airwallex-payment-elements' #75

Closed dillonbailey closed 1 year ago

dillonbailey commented 1 year ago

Version "airwallex-payment-elements": "^0.2.103",

Issue Attempting to import Airwallex from airwallex-payment-elements fails with the error as below:

Screenshot 2023-04-03 at 5 29 29 pm

shirly-chen-awx commented 1 year ago

@dillonbailey can you try this way first? import { redirectToCheckout, loadAirwallex } from 'airwallex-payment-elements';

we will fix the default issue asap. thanks for raising this issue.

dillonbailey commented 1 year ago

@shirly-chen-awx - thank you - that is now working.

Can you also clariy, docs are a bit fuzzy on this, but do we need loadAirwallex? It seems to only set the environment, which is also done during the redirectToCheckout call (ref: https://codesandbox.io/s/github/airwallex/airwallex-payment-demo/tree/master/integrations/react-ts?from-embed=&initialpath=/hpp&file=/src/components/hpp.tsx)

Cheers.

shirly-chen-awx commented 1 year ago

@dillonbailey yes, we need loadAirwallex before redirectToCheckout, loadAirwallex not only sets the env, but also load airwallex element js.

dillonbailey commented 1 year ago

Thanks @shirly-chen-awx