如何在 IOS 应用程序上使用 Braintree V Zero?

How to use Braintree V Zero on IOS app?

我正在编写一个具有支付功能的 IOS 应用程序。 我决定使用 Braintree V Zero。

一开始,我使用他们出色的 DropIn UI 功能,一切正常。 但是当付款发生时,Drop In UI 要求最终用户每次都输入他的信用卡或 Paypal 信息。

有没有人知道如何通过BrainTree V zero 实现一种自动充电方案?

喜欢优步的收费方案。

我想可能需要从应用端或服务端标记用户的信用卡信息?

    router.get('/token', function (req, res) {
  console.log('Kevin in token be called %s', req.param('aCustomerId'));
  var aCustomerId = req.param('aCustomerId');
  console.log('Kevin %s', aCustomerId);
  gateway.clientToken.generate({customerId: aCustomerId}, function (error, response) {
    res.send(response.clientToken);
    console.log(response.clientToken);
  });
});

在此先感谢您!

完全披露:我为 Braintree 工作。

Braintree 插件将 display previously used payment methods for a customer, if you pass the customer_id in when generating a client token 在您的服务器上。 的 下面是如何在 Node 中执行此操作的示例:

gateway.clientToken.generate({
  customerId: aCustomerId
}, function (err, response) {
  var clientToken = response.clientToken
});

使用付款方式后,它将保存在 drop-in 中,客户无需再次输入。创建交易时传递保存的支付方式的token:

gateway.transaction.sale({
  amount: "10.00",
  paymentMethodToken: theToken,
  options: {
    submitForSettlement: true
  }
}, function (err, result) {
});

如有任何疑问,请随时联系Braintree support。 3133e