I have setup a PHP script on a cron which contacts Braintree via the API to look up the status of each subscription that we have on file. We then update our local records based on the customer's subscription status. Because I can manually cancel a subscription from the Braintree control panel, I have been able to test that my script can detect canceled subscriptions.
However, I can't find any way to test a past-due status other than to wait for the billing cycle to go 'round. Because the minimum length of a billing cycle in Braintree is one month, this makes debugging my script very difficult.
I know that in theory I should just see a different string for the status of the subscription, but I'm looking for a reproducible way to simulate past-due status, along with a positive balance and value for daysPastDue.
Can anyone help?
$BT_subscription = Braintree_Subscription::find($BT_subscription_id);
if ($BT_subscription && $BT_subscription instanceof Braintree_Subscription) {
if ($BT_subscription->status == 'Past Due' && $BT_subscription->balance > 0) {
// ...