【问题标题】:How to Proceed 3D Secure transactions for cards that are stored in Vault using BrainTree API如何使用 BrainTree API 对存储在 Vault 中的卡进行 3D 安全交易
【发布时间】:2015-07-05 17:26:12
【问题描述】:

我已经在我的 Dotnet webform 应用程序中尝试了 Braintree API,并且能够成功创建事务。现在我陷入了为存储在 Braintree Vault 中的卡设置 3D 安全验证交易的问题之一。

在 API 中,他们提到要从服务器传递 NONCE 和来自客户端的金额来验证交易。但是,我无法获得该链接。在访问责任转移概念时,我也非常困惑。我可以对此有更好的解释吗?

我已经非常彻底地浏览了 API,但无法弄清楚这个问题。

我的要求:我需要在我的应用程序中为启用 3D Secure 的卡创建 3DSecure 交易。如果客户没有启用 3D 安全,我应该能够完成交易。(我通过将 3D 安全 - 必需属性从服务器端传递给 false 来理解这一点) 现在我还需要在 Vault for Saved Cards 部分保存卡片详细信息。因此,当我尝试调用 3DSecure for Saved cards 部分时,从客户端生成的 response.nonce 与在服务器端生成的 Nonce 相同。所以它说NONCE ALREADY USED。

所以请在这方面帮助我。提前致谢。

斯里坎特

【问题讨论】:

    标签: asp.net braintree


    【解决方案1】:

    我在 Braintree 担任开发人员。如果您的服务器和客户端代码是integrated properly,则客户端上的verify3DS() 方法返回的nonce 应该与最初在您的服务器上生成的不同。

    服务器端:使用支付方式的令牌在您的服务器上生成支付方式随机数。

    // Generate a nonce for the payment method on your server
    
    var result = gateway.PaymentMethodNonce.Create("PaymentMethodToken");
    var nonce = result.Target.Nonce;
    

    注意:我正在努力在我们的documentation 中包含这样的代码 sn-ps,以防止将来对如何在服务器上生成 nonce 产生混淆。

    客户端:使用来自服务器的 nonce 验证卡。然后使用客户端的 nonce 来完成交易。

    var paymentMethodNonce = 'nonce_from_server';
    
    client.verify3DS({
      amount: 500,
      creditCard: paymentMethodNonce
    }, function (error, response) {
      if (!error) {
        // 3D Secure finished. 
        // Use nonce in response to create transaction. This should be different from the nonce created on your server.
    
        // console.log(response.nonce);
      } else {
        // Handle errors
      }
    });
    

    关于您关于责任转移的问题,3D-Secure 协议可以将欺诈责任从您作为商家转移到发卡机构depending on which parties participate in 3D-Secure

    回调中的响应对象包含有关责任是否转移或给定付款方式是否可能转移责任的详细信息。

    client.verify3DS({
      amount: 500,
      creditCard: paymentMethodNonce
    }, function (error, response) {
      if (!error) {
        // Response will also include liability shift details for you to use
    
        // console.log(response.verificationDetails);
      } else {
        // Handle errors
      }
    });
    

    我建议重新访问what to do with the liability shift response values 上的文档。希望对您有所帮助!

    【讨论】:

    • 谢谢凯瑟琳,我按照您的建议解决了这个问题。再次感谢
    猜你喜欢
    • 2018-11-19
    • 2016-12-01
    • 2016-03-09
    • 1970-01-01
    • 2021-12-02
    • 2019-11-07
    • 2015-11-04
    • 2018-08-09
    • 2021-08-30
    相关资源
    最近更新 更多