#jcnguyen_36895_03919
1 messages · Page 1 of 1 (latest)
Hello
You want customer.subscription.deleted-- see: https://stripe.com/docs/billing/subscriptions/webhooks
got it thanks
Sure
Another question, when I update the API version to "2023-08-16"? It seems like Stripe API required to have DefaultPaymentMethod is not null if I upgrade the subscription to another plan using paymentmethod = "pending_if_incomplete". In contrast, the previous version didn't require which allow me to let the user use another credit card.
Hmmm that should not be influenced by API version as far as I know.
You are seeing an error?
If you can share an example that I can look at that would be great as well
sure do you need a subscription id or something?
Yep
btw i'm using stripe.net api
ok let me generate a refresh one.
here's the error message "This customer has no attached payment source or default payment method. Please consider adding a default payment method"
subscriptionid "sub_1NvKcrCixCJn4IR4teRMAs55"
let me know if you need more details
Thanks let me take a look
Yeah okay I don't think that behavior should be any different with an older API version. Basically you can't run a pending update if there is no PM to attempt to charge
but my previous version it allowed me to update the subscription
Can you share an example Subscription ID where that happened?
previous subscription?
Yeah
Thanks, looking
Okay that Customer has a default_source set
Which is a fallback from having no default_payment_method set
Which is why you don't see the error there
It doesn't have to do with the API Version
ok so how can i stop a new invoice from auto collected when upgrade subscription execute
just want to give you a little more context. What i'm trying to do is when a user already subsribed to a subscription and wants to upgrade. I don't want the current subscription to move forward without user pay and give user an option to pick another credit
Pending Updates is the correct thing to do here, you just have to have collected a PaymentMethod from the customer to do this.
Why would you attempt to make an update without having a PaymentMethod set?
Because i want to allow user to change their credit card via paymentintent element
Is there a way i can set the invoice not autoadvance = false when subscription updated?
i tried to set when update subscription successfully but the payment already completed
Hi there taking over
So I think what you'd want to do here is use a setupintent to collect new payment details from the customer on your site prior to using pending updates: https://stripe.com/docs/billing/subscriptions/pending-updates
then that would end up changed the workflow of upgrade vs create subscriptions
for create subscription i create the subsription and invoice via api then get the clientsecrete from paymentintent which i can render on the front end so the user can just pay with their CC using "default_incomplete"
so i was hoping when user upgrade their subscription would behave the same where stripe created new invoice without auto collect payment
Yeah that's not how it works
You'll need to use pending updates to achieve that
And if you want to require they use new payment method, only issue the pending update once you've collected new payment info
is there a way to make payment failed so i can set autoadvance = false which then i can render payment element model to the front end
like how it shown in my old subscription
When i set defaultpaymentthod on the subscription to empty string and customer defaultpaymentmethod to empty string
I don't think that will work because I think default_source will always be populated. Not 100% sure though. You can test it out
You'd need to attempt to unset default_source, invoice_settings.default_payment_method, and the one on the sub
invoice_settings.default_payment_method on the new invoice or previous
That's on the customer
so unset both on customer will let me save the subscription with pending?
I don't think that will work. That's what I said above
But you're welcome to try it if you like
I'm not 100% sure
I think you NEED pending updates, which is what we suggested earlier
so how am I able to do it via through previous version which make payment go into failed
when you say pending meaning pending_if_incomplete on subscription update?
What do you mean? I don't understand.
when you say pending meaning pending_if_incomplete on subscription update?
yeah read https://stripe.com/docs/billing/subscriptions/pending-updates
meaning from previous api, i cleared both default payment both on customer and subscription which caused payment failed
but when I upgrade the sdk to the latest which return failed to update subscription
What's the error?
No this error: but when I upgrade the sdk to the latest which return failed to update subscription
"This customer has no attached payment source or default payment method. Please consider adding a default payment method"
Can you share the request id?
Also it would help if you could share a request id where this succeeded previously
req_mzymFtCkfuWoqr
Oh yeah this is because of what we talked about earlier
You need a payment method with pending updates
So you need to collect one via a setupintent first
We went over this here: #1156947881203343440 message
but i didn't need to do that on previous version to save it
here's previous version of the request "req_4x57duGIFCxFM7"
unset default payment on subscription "req_Qa9DKv49jwbFDC"
Hi there 👋 taking over, as my colleague needs to step away
Give me a few minutes to get caught up.
Those are 2 completely different requests with different parameters. It sounds like you have a conclusive answer here, but let me know if you have any other questions
From previous api before set the subscription to pending_if_complete i cleared all default payment method and able to update the subscription and generate new invoice and failed at payment
however on the new api i'm not able to save the subscription with pending_if_complete when cleared paymentmethod
that's where i got hung up at
and without going through setupin workflow can i set the invoice to not autoadvance when update subscription
I don't understand the question. Can you rephrase?
the question after upgrade the .net sdk version, I can't upgrade the customer subscription after clearing default payment method with pending_if_complete
Yeah, they have to have a Payment Method in order to do an upgrade
but didn't needed for previous because i went into the user and remove default payment
and update the subscription to defaultpaymentmethod = ""
and the update successful and when invoice was generated it went into failed which allowed me to set the invoice advance = false
Yup, the previous version and this one are different
so the new version it mandatory to have paymentmethod associate to user or subscription before i can update the subscription status?
if i use default_incomplete is there a way i can roll back to the previous invoice if user decided not to go forward with the payment
Yes
is it possible to create a new subsubscription that includes previous subsciprtion prorate?
I don't understand the question
i'm thinking of use upcoming invoice to capture prorate etcs but with new subscription it not allow to add a lineitem which is negative value
you should be able to add a negative invoice item. Do you have a request where you tried?
let say i have subscription 1 invoice $10
when the user wants to upgrade i create a subscription 2 invoices 20 + prorate value from the previous subscription
so how do i include prorate amount on new subscription
i don't see that from stripe API when create subscription
with this workflow subscription 1 unchange and subscription 2 stayed pending and if subscription 2 completed. I can cancelled the subscription 1 via webhook
There aren't 2 subscriptions in this scenario. It's just one subscription that gets updated with new prices.
We document prorations pretty extensively here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade