-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is your feature request related to a problem? Please describe.
Vendure got first class support for handling multiple currencies, languages all within a single channel. Although for most shops operating in the EU the most common currency will be EUR, there are dozen other currencies which can be offered during checkout for a better customer experience. Our own shop also uses a multi-currency setup and while migrating to vendure realized that the built-in braintree integration doesn't support this.
Describe the solution you'd like
We have implemented in our previous commerce stack the braintree API and used a small helper function to set the correct MERCHANT_ID during runtime, based on currency.
function setMerchantAccountId(currency: string) {
if (currency) {
let merchantAccountId: string = '';
switch (currency.toLowerCase()) {
case 'usd':
merchantAccountId = process.env['BT_MERCHANT_ACCOUNT_ID_USD']!;
break;
case 'eur':
merchantAccountId = process.env['BT_MERCHANT_ACCOUNT_ID_EUR']!;
break;
default:
merchantAccountId = process.env['BT_MERCHANT_ACCOUNT_ID_USD']!;
}
return merchantAccountId;
} else {
throw Error('Currency is not set!')
}
}This merchantAccountId is then used in function calls against the BraintreeGateway.
Describe alternatives you've considered
Stripe supports multi currency out-of-box. From braintree, we are using PayPal right now only and use it as a backup to reduce risk using only one payment provider. I think multi-currency support should be included in the braintree payments plugin.
Additional context
I started to work on this.
Metadata
Metadata
Assignees
Labels
Projects
Status