如何更改Braintree的订阅期? [英] How can I change subscription period on braintree?

查看:85
本文介绍了如何更改Braintree的订阅期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为使用braintree的计费系统添加一些单元测试,但是我不知道如何将订阅期从1个月(目前为braintree的最小值)更改为1天。我不能等待1个月来执行测试。

解决方案

我最近问Braintree支持类似的问题,下面是给我的建议: -



沙箱环境已设置为完全模仿生产环境。不幸的是,这也使我们受到实时的支配。但是,您可以使用以下步骤创建过期订阅,从而绝对可以在沙盒中测试subscription_charged_unsuccessfully和subscription_went_past_due网络挂钩:



创建一个包含1天试用期和2000美元价格的计划(将自动模拟下降的测试金额)
使用信用卡创建客户
使用计划和客户
创建新订阅首次尝试将在1天后( (试用期满)并且将失败
自动重试将在订阅到期的+10天和+20天–通过更新控制面板
中的重复计费重试逻辑,可以更改此时间表您还可以使用相同的基本原理来测试subscription_charged_successful Webhook,只需创建一个试用期为1天且价格低于$ 2000的计划即可。



我希望对您有所帮助。 / p>

I want to add some unit tests for our billing system which is using braintree but I don't know how to change the subscription period from 1 month (minimum in braintree for now) to 1 day. I cannot wait 1 month to execute my test. is there any solution to do that?

解决方案

I recently asked Braintree support a similar question and here is the advice I was given:-

The sandbox environment is setup to mimic the production environment exactly. Unfortunately, this leaves us at the mercy of real time as well. However you can definitely test the subscription_charged_unsuccessfully and subscription_went_past_due webhooks in the sandbox by creating a past due subscription using the steps below:

Create a plan with a 1 day trial and $2000 price (a test amount that will automatically simulate a decline) Create a customer with a credit card Create a new subscription using the plan and customer The first charge attempt will be after 1 day (when the trial expires) and will fail The automatic retries will be at +10 and +20 days of the subscription going past due – this timeline can be changed by updating the recurring billing retry logic in your Control Panel You could also test the subscription_charged_successfully webhook using the same basic principles – simply create a plan with a 1 day trial and a price less than $2000.

I hope that helps.

这篇关于如何更改Braintree的订阅期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆