#yassinec_subscription-pendingupdate

1 messages ยท Page 1 of 1 (latest)

clear compassBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1286362049311408128

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

sinful shale
#

yassinec_subscription-pendingupdate

#

@fossil hazel that's expected. The Invoice will alwas be finalized immediately and attempted to be paid. And if the payment fails or requires 3DS for example it goes into "pending"
You can't just do this and then hope to change the Invoice after the fact, that won't work

fossil hazel
#

Oh no ๐Ÿ˜ฆ

#

Is there no way to apply a coupon on subscription update only?

#

Say I created a 200 USD / year subscription, and one month later customer makes an upgrade for the remainder of the year costing 50 USD

sinful shale
#

Why aren't you passing the Coupon during the update?

fossil hazel
sinful shale
#

ah my bad. Then yeah looks like you just can't do this. My advice is to not use the pending updates approach at all in that case (it's not a great feature if you ask me)

fossil hazel
#

I use it so that if payment fails, the subscription updates are not applied

#

Would there be another way of charging the customer for an upgrade, and updating the subscription on payment success?

sinful shale
#

no that's the only way. Sadly it doesn't support your use-case I'm sorry

fossil hazel
#

It's weird because I can do that on the dashboard

#

subscription update with immediate proration and ad-hoc coupon applied

sinful shale
#

yes but not with pending updates which you are explicitly trying to use

#

If you don't use pending updates then it works totally fine in the API too

fossil hazel
#

ok I get it regarding pending updates

#

so what can I do in general to avoid updating the subscription if payment of an invoice with coupon fails?

#

as pending updates do not work

sinful shale
#

There's nothing you can do I'm sorry. We don't support such a flow. The only way is to update, and then get the customer to pay you and if they don't update again back to what it was before

#

that's exactly what the Dashboard UI does offer

fossil hazel
#

that's tragic ๐Ÿ˜…

#

Do you know if I can from the UI attach a one-time coupon to an active subscription for the next automatic renewal?

#

I am trying to provide alternatives to my customers

sinful shale
#

yes you can do that easily both in code and the Dashboard. If you have questions about the Dashboard, I recommend contacting our support team at https://support.stripe.com/contact

fossil hazel
#

OK

#

Thanks for the help man

#

One last thought

#

I guess I can create one-off invoices to upgrade a subscription, and apply a discount on them?

clear compassBOT
sinful shale
#

you can but it'll mess up your reporting, so I wouldn't do that

#

I have to run but my colleague is taking over if you have more questions!

fossil hazel
#

Thank you ๐Ÿ™

tropic wave
#

๐Ÿ‘‹ let me know if I can help any further

fossil hazel
#

Hello bismarck

#

Can you clarify koopajah's point about one-off invoices messing up reporting?

tropic wave
#

Sure, let me catch up on the context

fossil hazel
#

OK

#

I basically want to apply a coupon on a subscription update with pending update

#

But that's not supported by Stripe's API

#

pending updates = no coupons

tropic wave
#

Gotcha so you are considering creating a one-off Invoice and if they pay that successfully then updating the Subscription with a coupon?

#

Are these updates for Prices with the same interval?

#

Like both monthly?

#

What is the update that is occurring exactly?

fossil hazel
#

More like updating the subscription, applying a discount but sending the invoice to the customer for payment

#

Could be a switch from monthly to yearly

tropic wave
#

Okay let's back up a second.

#

Can you give me an exact scenario of what you are trying to accomplish?

#

Like what is your ideal world? What problem or scenario are you trying to solve for here?

fossil hazel
#

A customer has an active subscription, they want to:

  • add an item to it
  • or switch from monthly to yearly (pay the remaining 11 months)
  • or both
#

They should be prorated immediately

#

And ideally they should be able to apply a coupon on the proration charge

tropic wave
#

And your concern here is that you only want to perform this update on successful payment?

fossil hazel
#

Problem I solve for: customer upgrades subscription in app and want to use a promo code to pay less for that upgrade, and if the payment fails because of whatever the subscription is not updated

tropic wave
#

Gotcha, have you tried adding a negative Invoice Item to represent the discount instead of using a coupon?

#

I think this will work with Pending Updates

#

As that newly created Invoice should still pick up the Invoice Item

#

But I haven't tested this exact scenario myself

#

So you'll want to test it out

fossil hazel
#

Interesting

#

I would lose on automatic discount computation though

#

If I use a percentage discount

#

no?

tropic wave
#

You would need to perform that calculation yourself, yes.

#

But that shouldn't be hard really

#

You can preview the upcoming Invoice to get the proration amount

fossil hazel
#

So I could get the upcoming invoice, update its items, see the proration amount?

tropic wave
#

Then create an Invoice Item for that negative amount that corresponds with the discount

fossil hazel
#

That sounds interesting

#

Discord support > web support haha

#

I will try this

tropic wave
#

Yeah give it a test and see if it works -- like I said I'm not positive how this negative Invoice Item will interact with Pending Updates

#

I think it should work though

#

Ah wait no

#

That only allows for positive Invoice Items

#

So you do need to create it separately I believe

clear compassBOT
fossil hazel
#

๐Ÿ‘€

#

there is no createPreview method, is it available in recent SDK versions only?

iron breach
#

Hello! I'm taking over and catching up...

fossil hazel
#

hello

iron breach
#

Yeah, it's a more recent addition. What SDK are you using?

fossil hazel
#

Java SDK 20.106.0

#

A really old one I think

#

I think I can upgrade if there are no breaking changes

iron breach
#

There are breaking changes between that version and yours.