afurmanov
asked this on January 21, 2011 07:31 pm
I want to write an integration test checking if app handles
correctly a situation when payment has not been received. That is
what I've tried to achieve this
1. Create a valid subscription with valid card "1"
2. Update card to "2" (invalid card)
3. Apply some charge to subscription created on step "1", this step
fails as it should
4. Now I expect to find a subscription in 'past_due' or 'unpaid'
state, however subscription state is 'active'
The other way would be to wait until the end of billing cycle, so
chargify would try to apply a recurring subscription charge, but
that does not really work well for automated tests.
Ideally I want to ask chargify to do something like "retry charges
and update subscription statuses and call all webhooks." Is there
any way to do this?
Thanks!
Comments
Hey there,
I'm not technical enough to help here, but there are some great & gracious developers out there who can help sometimes.
I'm going to tweet this and we'll see if anyone pops in to help you. We have a great community!
Thanks.
--- Lance
Has the great community come up with an answer to this?
Hey, I just got this from our developers:
Update the card on the subscription to "2".
Set the next billing date to a minute or two away.
Wait max 20 minutes.
It will simulate a failed renewal, and will go past due.
Please try that. Thanks.
The original poster had everything correct, except for step 3 is to set the "Next Billing Date" to a few minutes away to force renewal (see http://docs.chargify.com/billing-dates).
Adding a charge is considered a one-time operation and doesn't affect recurring billing state.