0
votes

When I submit a braintree transaction, and it is unsuccessful, it returns result.params that I can use. However, due to PCI compliance reasons, it cannot return CC or CVV information.

Since it's an unsuccessful txn, the page renders the current page. I would like to auto populate the payment info, whether it's a CC or paypal transaction, so the user does not need to reenter the payment. I think it's bad user experience.

If repopulating the payment info is not possible, could I just somehow reuse the generated payment_method_nonce and send it to braintree. Looking through the docs, I can't seem to find anything that I can use to solve this.

https://developers.braintreepayments.com/javascript+ruby/reference/general/result-handling/result-objects#params

2

2 Answers

2
votes

I work at Braintree. If you're looking for more help with your integration, you can always get in touch with our support team.

Instead of creating a transaction with the payment method nonce, create a payment method with the nonce. This will give you a reusable token you can then use to create a transaction.

From the "Getting Started" guide:

Create a transaction

Obtained from the Braintree client SDK, a payment method nonce can be used in any place credit card information or a payment method token is used in the Braintree server-side client libraries.

So since you can create a payment method token from credit card params, you can also create it from a payment method nonce.

-1
votes

Simply post it to your own controller/action that is set up to make the request. From there, you can check the success of the transaction and respond accordingly. You also have full access to the params, to do with as you wish. You probably want to keep them out of your logs.