4
votes

How can I re-verify payment method [credit card] in vault before doing sale transaction.

Note: CVV and AVS rules are enable.

Scenario is:

  • Customer in braintree vault doing sale transaction with payment method [Credit card] in vault.
  • I want to re-verify credit card before sale transaction to make sure credit card is not expire.
1

1 Answers

1
votes

I believe it depends on how you are integrated with Braintree. Are you using their Hosted Fields? Drop-In?

Basically, according to their docs, you would create a nonce that contains only the CVV you prompted the user for.

braintree.setup('YOUR_CLIENT_TOKEN', 'custom', {
  id: 'my-sample-form',
  hostedFields: {
    cvv: {
      selector: '#cvv'
    }
  }
});

Once you have that nonce, you can pass it to a PaymentMethod.update() call for the appropriate payment method token, and ensure verify_card is set to true.

result = braintree.PaymentMethod.update("the_payment_method_token", {
    "payment_method_nonce": nonce_from_the_client,
    "options": {
        "verify_card": True,
    }
})

Found at https://developers.braintreepayments.com/reference/request/payment-method/update/#card-verification