Braintree Auth (Beta)
Multi-Currency
If you support new Braintree signups through your platform, Braintree Auth allows you to add and list presentment currencies for a connected merchant.
Adding a currency
Once you have completed the OAuth Flow and received an access_token
for a merchant, you can use the merchant API to add a currency:
- Java
MerchantAccountRequest request = new MerchantAccountRequest().currency("USD");
BraintreeGateway gateway = new BraintreeGateway(merchantAccessToken);
Result<MerchantAccount> result = gateway.merchantAccount().createForCurrency(request);
if (result.isSuccess()) {
System.out.println(result.getTarget().getCurrencyIsoCode());
}
If any of the merchant's payment_method
s do not accept the provided currency
, a validation error is returned and a new merchant account will not be created. For more information see currency support.
You can view the supported currencies for a merchant by inspecting their merchant accounts:
- Java
BraintreeGateway gateway = new BraintreeGateway(merchantAccessToken);
/* all returns an Iterable<MerchantAccount> */
PaginatedCollection<MerchantAccount> merchantAccountsIterable = gateway.merchantAccount().all();
for (MerchantAccount merchantAccount : merchantAccountsIterable) {
System.out.println(merchantAccount.getCurrencyIsoCode());
}
Currency support
To add a currency for a merchant through [Merchant Account: Create For Currency
] (/braintree/docs/reference/request/merchant-account/create-for-currency), all of the payment methods the merchant accepts must support the new currency. For details on which currencies are supported for each payment method, see the following references:
See also
Next Page: Testing and Go Live →