#jcnguyen_36895_03919

1 messages · Page 1 of 1 (latest)

glossy geyserBOT
lucid oasis
#

Hello

rustic lava
#

got it thanks

lucid oasis
#

Sure

rustic lava
#

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.

lucid oasis
#

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

rustic lava
#

sure do you need a subscription id or something?

lucid oasis
#

Yep

rustic lava
#

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

lucid oasis
#

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

rustic lava
#

but my previous version it allowed me to update the subscription

lucid oasis
#

Can you share an example Subscription ID where that happened?

glossy geyserBOT
rustic lava
#

previous subscription?

lucid oasis
#

Yeah

rustic lava
#

sub_1NsU0jCixCJn4IR4SiNHgB3W

#

the api version that i used "2022-11-15"

lucid oasis
#

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

rustic lava
#

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

lucid oasis
#

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?

rustic lava
#

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

earnest creek
#

Hi there taking over

rustic lava
#

then that would end up changed the workflow of upgrade vs create subscriptions

earnest creek
#

It would

#

What you want to do requires that

rustic lava
#

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

earnest creek
#

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

rustic lava
#

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

earnest creek
#

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

rustic lava
#

invoice_settings.default_payment_method on the new invoice or previous

earnest creek
#

That's on the customer

rustic lava
#

so unset both on customer will let me save the subscription with pending?

earnest creek
#

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

rustic lava
#

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?

earnest creek
rustic lava
#

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

earnest creek
#

What's the error?

rustic lava
#

payment failed?

#

or when save subscription via api

earnest creek
#

No this error: but when I upgrade the sdk to the latest which return failed to update subscription

rustic lava
#

"This customer has no attached payment source or default payment method. Please consider adding a default payment method"

earnest creek
#

Can you share the request id?

#

Also it would help if you could share a request id where this succeeded previously

rustic lava
#

req_mzymFtCkfuWoqr

earnest creek
#

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

rustic lava
#

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"

glossy geyserBOT
burnt peak
#

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

rustic lava
#

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

burnt peak
#

I don't understand the question. Can you rephrase?

rustic lava
#

the question after upgrade the .net sdk version, I can't upgrade the customer subscription after clearing default payment method with pending_if_complete

burnt peak
#

Yeah, they have to have a Payment Method in order to do an upgrade

rustic lava
#

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

burnt peak
#

Yup, the previous version and this one are different

rustic lava
#

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

rustic lava
#

is it possible to create a new subsubscription that includes previous subsciprtion prorate?

burnt peak
#

I don't understand the question

rustic lava
#

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

burnt peak
#

you should be able to add a negative invoice item. Do you have a request where you tried?

rustic lava
#

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

burnt peak
rustic lava
#

right but that assuming the user completed their payment

#

if user not completed their payment the subscription is now updated to new invoice price which user not agree on so need to reverted back to previous state