With Braintree's recurring billing, you can charge your customers automatically in monthly increments.
To set this up, you'll need to create a plan in the Control Panel and store your customers in the Vault. Then use
Subscription.create() to associate each customer's preferred payment method with the plan.
In addition to the steps listed below, you must create customers with payment methods in the Vault before you can use recurring billing.
Pending subscriptions are subscriptions that have not started yet. For example, if you create a subscription with a specific billing date in the future, the subscription will start out as Pending.
Active subscriptions will be charged on the next billing date. You can get the dates from the subscription object. Subscriptions in a trial period are Active.
A subscription status can change to Past Due for multiple reasons. The most common reason is a failed subscription payment. Other less common reasons for a Past Due status include that the balance is too high to be processed or issues in the merchant account setup, that would prevent a transaction from being created.
If the reason for your Past Due status is a failed subscription payment, you can manually retry the charge, or you can set up logic in the Control Panel to automatically retry a declined or failed charge at specific intervals. Additionally, a Past Due subscription will be automatically retried if the payment method associated with the subscription is updated and you have proration enabled. If the retried transaction is successful and the subscription has not passed its final billing date, the status will change to Active.
If a retried transaction is unsuccessful, the balance on the past due subscription will continue to increase every billing cycle, and we'll continue to retry the transaction each billing cycle—either indefinitely or until the number of cycles in the subscription is reached. If all retries are unsuccessful, the subscription’s status will remain Past Due until the subscription a) reaches the specified number of billing cycles and the status changes to Expired, or b) is canceled.
Subscriptions are Expired when they have reached the specified number of billing cycles.
If you cancel the subscription, the status will be Canceled and no further billing will occur.