#migatotech_unexpected

1 messages ยท Page 1 of 1 (latest)

restive plankBOT
#

๐Ÿ‘‹ 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/1215230403527577691

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

olive karmaBOT
mint mulch
#

Hi, let me help you with this.

final ledge
#

I'll check that but shouldn't I get customer.subscription.pending_update_applied for the second update?

mint mulch
#

At the time of the update request, the update would either be applied immediately, so no pending update, but just customer.subscription.updated event. Or, if payment can't be processed, it will become the new pending update, which won't be applied until payment info is updated. So no, customer.subscription.pending_update_applied event is not expected.

olive karmaBOT
final ledge
#

So what should I do to get customer.subscription.pending_update_applied event?
I've changed the scenario to - add a card then start subscription, change card to one that requires 3ds and then perform upgrade
https://dashboard.stripe.com/test/subscriptions/sub_1OrdbWHZvjvUJinyZR6Oeu8N
I thought that as the upgrade is now pending I'd get the customer.subscription.pending_update_applied event

modest pendant
#

_applied means the pending update was applied i.e.

  • you updated the subscription
  • payment failed so a pending_update is created instead of the subscription items changing
  • later the customer fixes the problem and pays the invoice
  • the pending_update to change the subscription items is applied, and the event happens
#

in sub_1OrdbWHZvjvUJinyZR6Oeu8N those last two steps never happened right? So it's totally expected to not get the event since the pending update was not applied.

#

I think you misunderstand what the _applied event is. I think you expect it to mean "a pending update was created and is pending" but it doesn't, it means the update was applied to the subscription after the payment was made and the subscription changed and now there is no pending_update.

to know if a pending update was created you either check for pending_update existing on the subscription after your API call to update it, or the customer.subscription.updated event where previous_attributes.pending_update == null && pending_update != null
https://docs.stripe.com/billing/subscriptions/pending-updates-reference#lifecycle

flint tide
#

hm we still not get it, when we sent the update request we set:

"payment_behavior"="pending_if_incomplete"
"proration_behavior"="always_invoice"

and the card that was assigned to subscription required 3ds, so why this pending update didn't work?

modest pendant
#

not sure what you mean, it did "work" โ€” i.e. a payment was required, that payment requires 3D Secure so it fails/is not complete, so a pending_update is created instead and the subscription is unchanged.

#

that's exactly what this feature is meant to do

flint tide
#

ok I think I got it, let me analyse the events once again