Hi,
I asked this on IRC #stripe and was referred here for an answer.
Use case:
A user has a subscription.
The trial period has ended.
They have not yet entered a payment source.
Their subscription status is 'past_due'
---
When the user does add a card, I do this:
customer = stripe.Customer.retrieve(stripe_customer_id)
card = customer.sources.create(source=
token.id)
customer.default_source = card['id']
customer.save()
---
It is my understanding that when I add the default payment source, the past_due invoice will immediately be charged.
Does that happen synchronously in the customer.save call?
ie:if my next line of code is this:
stripe.Subscription.retrieve(sub_...)
is the status is guaranteed to be active, if the card was good?
or can the charge end up being good, but I make the Subscription.retrieve call before the status is updated?
Thanks,
Steve