Hi Ryan,
When a requested subscription modification requires a payment, Stripe
synchronously collects billables and attempts payment. If that
payment succeeds, the subscription update is committed, and an invoice
is saved to reflect the billing that occurred. If that payment fails,
you receive a 402, the subscription update is never committed, and no
invoice is saved (no invoice.payment_failed event).
The motivation here stems from the customer creation case: If an
attempt to create a customer (with a subscription) fails, the customer
creation itself is never committed, no invoice is saved, etc. There
is a just a 402 response, with no ghost objects (other than the failed
charge).
The other piece of motivation stems from the upgrade case --
attempting to move the customer to a paid plan, or off a trial, is an
"upgrade" so to speak, and the semantics that we provide are that if
the required payment failed, the upgrade never goes into affect.
I am surprised to see "1. The subscription's trial_end date is
extended beyond the current trial period to the next potentially
billed interval (unexpected)". This is not consistent with the
expected behavior on our end. I just did a manual test on my end of
(I believe) the steps that you provided, and wasn't able to reproduce
the behavior:
https://gist.github.com/jimdanz/cbfff1d825f7f2e58296
I'm hunting up some edits to the docs to make this more clear, but
also happy to answer any followup questions!
Cheers,
Jim
> --
> You received this message because you are subscribed to the Google Groups
> "Stripe API Discussion" group.
> To post to this group, send email to
api-d...@lists.stripe.com.
> Visit this group at
>
http://groups.google.com/a/lists.stripe.com/group/api-discuss/.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
api-discuss...@lists.stripe.com.