【问题标题】:Braintree / Javascript: how to get transaction data (card and address) to prefill for customers with previous transactions?Braintree / Javascript:如何获取交易数据(卡和地址)以预填充以前交易的客户?
【发布时间】:2018-10-29 00:36:57
【问题描述】:

我正在使用 Braintree 的托管字段和 Javascript。我成功地进行了成功注册并发送了一个付款随机数,但是我无法弄清楚如何让已经在 Braintree 门户中订阅的用户显示他们已经在 Braintree 托管字段中预加载的信息(地址、信用卡的一部分等)。

【问题讨论】:

    标签: javascript braintree


    【解决方案1】:

    托管字段中唯一的地址字段是邮政编码。您可能需要构建一个自定义表单来填充其他地址值。

    您可以使用payment method lookup 从您的服务器获取 Vault 数据。然后您可以在托管字段中预填充数据。

    下面是一个示例,说明如何使用预填充的值作为到期日期:

    var storedCreditCardInformation = {   
      // get this info from your server with a payment method lookup   
      month: '09',   
      year: '2017' 
    }; 
    
    braintree.hostedFields.create({   
      client: clientInstance,   
      fields: {     
        expirationMonth: {       
          selector: '#expiration-month',       
          prefill: storedCreditCardInformation.month     
        },     
        expirationYear: {       
          selector: '#expiration-year',       
          prefill: storedCreditCardInformation.year     
        }   
      } 
    }, 
    callback);
    

    完全披露:我在 Braintree 工作。如有其他问题,请随时联系 Braintree 支持 support@getbraintree.com。

    【讨论】:

    • 使用 Drop-in UI 时是否同样适用?
    • 是的 - 可以在 here 找到关于 Drop-In 的文档。其中一些功能包括: 允许客户删除已保存的付款方式 收集付款表格中包含的信息: -信用卡号 -到期日期 -邮政编码和 CVV(当启用 AVS 和 CVV 规则时) PaymentMethod.update() 上的文档可以找到here
    • 嘿@turaco。我有一个 JS Braintree v3 客户端,并获得了一个后端 api 来更新 paymentMethod。它需要一个不记名令牌,如果成功,它会返回一个随机数。我究竟要如何处理这个 nonce 来更新付款信息?我真的不知道该在哪里打电话。
    • @Anthony 我正在回答你的问题in this post
    猜你喜欢
    • 2019-05-12
    • 2021-02-12
    • 2015-01-09
    • 2014-11-06
    • 2022-07-07
    • 2022-07-22
    • 1970-01-01
    • 2018-08-09
    • 2021-11-29
    相关资源
    最近更新 更多