#alvin_63959
1 messages · Page 1 of 1 (latest)
hi! what's the question exactly?
Hi, so I have this code and what it does is trying to upgrade a subscription using "service.Update(AccountSubscription.StripeSubscriptionID, options);"
question is I have already changed the subscription right then what if payment fails. Do I just update the subscription back to the previous subscription plan?
I can see that it has invoice.payment_failed event but I am more concerned abt how to revert the subscription back to the original subscription plan
well then yes, you'd have to do another update to set it back to the old plan.
But before doing that I suggest looking into using https://stripe.com/docs/billing/subscriptions/pending-updates which only applies the change if the payment succeds and is probably easier for you
say I want to the update back to the old plan, will the billing cycle reset or revert to normal?
it depends on the specifics of what type each plan was
in general updating doesn't change the billing cycle at all unless you pass parameters to change it, or you're changing from a monthly to yearly plan or vice versa etc
go for it
I passed in PaymentBehavior = "pending_if_incomplete
exception was
When payment_behavior is set to pending_if_incomplete, you can only pass supported params. items[0][metadata] is not supported. See https://stripe.com/docs/billing/subscriptions/pending-updates-reference#supported-attributes for more details.
my request was
is there something wrong with the request, it says I cannot pass in metdata?
What is the ID of the request that returned that error?
sub_1OdvFtGFC7Ks3wO6VDWNkyxI
I'll try to find it from that. For future reference, request IDs begin with req_, are returned in error messages surfaced by our API, and can also be found via the dashboard:
https://support.stripe.com/questions/finding-the-id-for-an-api-request#:~:text=Using the dashboard,the dashboard URL as well.
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Gotcha, it does look like you're providing both item level and subscription level metadata there. It seems to specifically be the item level metadata that is the issue, but I don't see where that is being defined in the code snippet you provided. Looks like it may be elsewhere in your code where items is being created/set.
Correct, you cannot pass item level metadata while also setting payment_behavior to pending_if_incomplete .
any alternatives if I cannot use payment_behavior?