简体   繁体   English

在不成功的Braintree交易中返回参数/信用卡信息

[英]Returning params/credit card info during unsuccessful Braintree transaction

When I submit a braintree transaction, and it is unsuccessful, it returns result.params that I can use. 当我提交braintree事务但未成功时,它将返回我可以使用的result.params。 However, due to PCI compliance reasons, it cannot return CC or CVV information. 但是,由于PCI合规性原因,它无法返回CC或CVV信息。

Since it's an unsuccessful txn, the page renders the current page. 由于txn失败,因此该页面将呈现当前页面。 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. 我想自动填充付款信息(无论是CC还是Paypal交易),因此用户无需重新输入付款。 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. 如果无法重新填充付款信息,我可以以某种方式重用所生成的payment_method_nonce并将其发送到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 https://developers.braintreepayments.com/javascript+ruby/reference/general/result-handling/result-objects#params

I work at Braintree. 我在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 . Braintree客户端SDK获得的付款方式随机数可以在任何地方使用信用卡信息,或者在Braintree 服务器端客户端库中使用付款方式令牌。

So since you can create a payment method token from credit card params, you can also create it from a payment method nonce. 因此,由于您可以从信用卡参数创建付款方式令牌,因此也可以从付款方式随机数创建它。

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 . 您可能希望将它们排除在日志之外

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM