简体   繁体   English

付款方式删除后重新加载Braintree插入UI

[英]Reload Braintree Drop-In UI After Payment Method Delete

When I perform, this.gateway.paymentMethod.delete(response.paymentMethod.token); 当我执行时, this.gateway.paymentMethod.delete(response.paymentMethod.token); , is there any way to reload the Drop-In UI to explicitly show the user that their payment method has been deleted? ,是否有任何方法可以重新加载Drop-In UI,以明确向用户显示其付款方式已被删除? In other words, the payment method is removed from the list of payment methods within the Drop-In UI. 换句话说,付款方式已从Drop-In UI中的付款方式列表中删除。

Full disclosure: I work at Braintree. 全面披露:我在Braintree工作。 If you have any further questions, feel free to contact support . 如果您还有其他疑问,请随时与支持小组联系。

You can reload the Drop-in UI by using the teardown method on the Drop-in instance, followed by a subsequent braintree.dropin.create() call. 您可以通过使用Drop-in实例上的teardown方法并随后进行随后的braintree.dropin.create()调用来重新加载Drop-in UI。 The teardown method will cleanly remove everything setup by a dropin.create call. teardown方法将通过dropin.create调用彻底删除所有设置。 You can use the method similarly to this: 您可以使用与此类似的方法:

instance.teardown(function (teardownErr) {
  if (teardownErr) {
    console.error('Could not tear down Drop-in UI!');
  } else {
    console.info('Drop-in UI has been torn down!');
  }
});

Once the Drop-in is torn down, you can then call braintree.dropin.create() again to setup the Drop-in to display the customer's accurate stored payment methods. braintree.dropin.create()后,您可以再次调用braintree.dropin.create()来设置braintree.dropin.create() ,以显示客户准确的存储付款方式。

While slightly different implementation, there is an example of the teardown method in this tutorial . 尽管实现方式略有不同,但本教程中有一个teardown方法的示例

UPDATE: A newer version of the Drop-in UI was just released that allows customers to delete their payment methods from within the Drop-in. 更新:刚刚发布了一个新版本的Drop-in UI,它允许客户从Drop-in中删除其付款方式。 You can use this by upgrading to the latest version of the Drop-in (v1.12.0) . 您可以通过升级到Drop-in的最新版本(v1.12.0)来使用它

Once you've upgraded, set vaultManager to true within your braintree.dropin.create() call, similar to this: 一旦你升级,设置vaultManagertrue的内braintree.dropin.create()调用,与此类似:

braintree.dropin.create({
  authorization: 'CLIENT_AUTHORIZATION',
  container: '#dropin-container',
  vaultManager: true
}, callback);

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

相关问题 将更改付款方式设置为默认braintree插入式ui - set change payment method to default braintree drop-in ui 使用Braintree插入式用户界面选择定期结算的付款方式 - 或:查找paymentMethodNonce的付款方式 - Using the Braintree drop-in UI to select the payment method for recurring billing — or: finding the payment method of a paymentMethodNonce 在Spree商店中添加Braintree嵌入式UI时,付款方式选择存在问题 - Issue with Payment method selection when I add Braintree Drop-in UI in Spree Store Braintree Drop-In UI需要重新加载才能正常工作 - Braintree Drop-In UI requires reload to work properly Braintree支付表格提交将被AngularJS拦截 - Braintree drop-in payment form submission to be intercepted by AngularJS 带有Braintree插件的PayPal - PayPal with Braintree Drop-In ui的Braintree何时创建付款方式现时? - When does braintree drop in ui create payment method nonce? JS-如何检查Braintree插入式ui是否正确加载? - JS-How to check if Braintree drop-in ui loaded correctly? Braintree插件未加载Django - Braintree drop-in not loading django 如何在Braintree插入式UI中实现选择加入和选择退出功能 - How to implement opt-in and opt-out functionality in braintree drop-in UI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM