Configure Braintree Duplicate Method Detection

You can configure the Braintree Payment Gateway Adapter to pass the .failOnDuplicatePaymentMethod option to the Braintree Payment Gateway Provider during a request to create a payment method. If the payment method has already been added to the Braintree Vault, the request fails.

About this task

After starting RS Gateway, the RS Gateway log (rsgateway.log) indicates the status of duplicate payment method detection. For example:
2018-03-18 | 193407.825 | main | INFO | MatrixxBraintreeGatewayContext | BT - failOnDuplicatePaymentMethod=true

Procedure

  1. Edit the /opt/mtx/conf/payment-service.yaml file and add the following parameter:
    payment:
      gateway:
        braintree:
          configs:
            default:
             failOnDuplicatePaymentMethod: true
  2. Save and close the properties file.
  3. Restart the Payment Service.
    systemctl restart mtx_payment_service

Results

Now, when using the SubMan APIs, if you attempt to add a payment method that already exists in the Braintree Vault, you get a response similar to the following response.
"status":"Duplicate card exists in the vault.","result":{"resourceId":null,"paymentToken":null,"name":null},"statusCode":500