Map Payment Methods in Braintree
Perform this task to map a payment method with a Braintree merchant account. If you do not map a payment method with a merchant account, the default merchant account ID in Braintree is used. You can map the merchant account ID at the payment method level (such as CreditCard) or at the payment method sub-type level (such as CreditCard.Visa).
Before you begin
You must create the merchant accounts in Braintree before mapping a payment method to a merchant account ID in the Payment Gateway Adapter. See the Braintree documentation for more information.
About this task
When Braintree is the Payment Gateway Provider, by default, Payment Service sends a payment method token with a default merchant account ID. You can map a merchant account to a merchant account ID so that the payment method token is sent to the payment gateway with a mapped merchant account within the payment authorization request.
Procedure
-
To map the merchant account ID at the payment method level, edit the
/opt/mtx/conf/payment-service.yaml file and add the
payment methods and merchant account IDs in the following format:
payment: gateway: braintree: configs: default: merchantAccountLookup: payment_method: id:merchantId
The payment_method is the payment method name as defined by Braintree and the merchantId is the merchant account ID of the account that you created in Braintree.
For example:merchantAccountLookupType: PaymentMethodType merchantAccountLookup: AmexExpressCheckoutCard: id: merchantId01 AndroidPayCard: id: merchantId02 ApplePayCard: id: merchantId03 CoinbaseAccount: id: merchantId04 CreditCard: id: merchantId05 "[CreditCard.AmericanExpress]": id: merchantId05 EuropeBankAccount: id: merchantId06 MasterpassCard: id: merchantId07 PayPalAccount: id: merchantId08 UnknownPaymentMethod: id: merchantId05 UsBankAccount: id: merchantId10 VenmoAccount: id: merchantId11 VisaCheckoutCard: id: merchantId12
-
To map the merchant account ID at the payment type level, edit the
/opt/mtx/conf/payment-service.yaml file and add the
payment type and merchant account IDs in the following format:
payment: gateway: braintree: configs: default: merchantAccountLookup: payment_type: id:merchantId
The payment_type is the payment type and the merchantId is the merchant account ID of the account that you created in Braintree.
For example:# Merchant Account Lookups by Purchase Type merchantAccountLookupType: PurchaseType merchantAccountLookup: purchase: id: 789 key: 78key recharge: id: 456 key: 45key recurring: id: 123 key: 12key
- Save the file.
-
Restart the
Payment Service.
systemctl restart mtx_payment_service