wixPayBackend createPayment countryCode

Is there a way to convert the 2-letter contry code of the users profile to a 3-letter country code expected by the createPayment function?

I’m using Velo code in the Wix editor.

In order to use the skipUserInfoPage option, the payment must be created with all the userInfo (first name, last name, email and country code).
The problem is that the getMember function returns a 2-letter country code, while the createPayment function needs a 3-letter country code.

currentMember.getMember()

wixPayBackend.createPayment

Thank you

Thanks for reporting! Will share with the relevant teams but please report this discrepancy to: Contact Wix

You should also be able to use this library to convert between the two types of codes: iso-3166 - npm

Thank you Anthony.
I had already found this package that works fine: country-code - npm

1 Like