Configure UDFs for Braintree
You can configure the Braintree Payment Gateway Adapter to pass user-defined fields (UDFs) to the Braintree Payment Gateway Provider during a transaction.
Before you begin
To pass a UDF, you must define a custom MATRIXX Data Containers (MDCs) that extends the MtxBraintreeChargeMethodExtension to contain the UDF field name. For more information about creating custom MDCs, see the discussion about MDCs in MATRIXX Installation and Upgrade.
Procedure
-
Create the UDFs in Braintree.
For example, create a field named
fraud_transaction_type
.See the Braintree documentation for information about creating UDFs. - Open the payment-service.yaml file.
-
Set the following under
userDefinedFields
:- customField — The name of the UDF defined in Braintree.
mdcFieldName
— The name of the field in the custom MDC that extends the MtxBraintreeChargeMethodExtension MDC.defaultValue
— The default value for the customField for situations when the MtxChargeMethodExtension is set, but the MDC_field_name is not set in the request.systemInitiatedValue
— A value for the customField for situations where the MtxChargeMethodExtension is not set andSystemInitiated
is enabled in the request.
For example:payment: gateway: braintree: configs: default: user_defined_fields: fraud_transaction_type: mdcFieldName: TransactionType defaultValue: CARE systemInitiatedValue: AutoPay
-
Save and close the properties file.
For an example, see the discussion about mapping a UDF.