简体   繁体   English

Braintree客户端付款方式购买

[英]Braintree client side paymentMethod purchase

I'm looking at the setup integration example: 我正在看安装程序集成示例:

braintree.dropin.create({
  authorization: 'CLIENT_AUTHORIZATION',
  container: '#dropin-container'
}, function (createErr, instance) {
  button.addEventListener('click', function () {
    instance.requestPaymentMethod(function (requestPaymentMethodErr, payload) {
      // Submit payload.nonce to your server
    });
  });
});

Would this be the same code to submit payment info to the server to update an existing subscription to a different plan or is that the method used only for new subscriptions? 将这是用于向服务器提交付款信息以将现有订阅更新为其他计划的相同代码,还是该方法仅用于新订阅? Is it the same call to Braintree and my server is the one responsible for what it does with it? 是对Braintree的相同调用,而我的服务器是负责它的功能的人吗?

Disclaimer: I work for Braintree. 免责声明:我为Braintree工作。 If you need a more detailed answer, please don't hesitate to reach out to Braintree Support . 如果您需要更详细的答案,请随时与Braintree支持联系

You can absolutely use the Drop-In UI to make a call to the API that will create or update a subscription. 您绝对可以使用Drop-In UI来调用将创建或更新订阅的API。

That said, you will also have to build out logic on your server side to communicate with our API that you want to update a subscription. 也就是说,您还必须在服务器端建立逻辑以与您要更新订阅的API进行通信。 The documentation on Subscription.update() gives a detailed explanation on how to update your subscriptions using Braintree's SDKs. Subscription.update()上的文档详细说明了如何使用Braintree的SDK更新订阅。

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

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