#slooperduper2_unexpected

1 messages · Page 1 of 1 (latest)

spiral terraceBOT
#

👋 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/1221936849077932112

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

fierce muskBOT
thorn grove
#

The API call I attempt looks something like:

Stripe::Subscription.resume(subscription_id, { billing_cycle_anchor: 'now' })

supple lagoon
#

Hi there! Do you have the Subscription ID for this Subscription?

thorn grove
#

Let me check if it is still in the correct state! This has all been in test so I change them a lot.

#

This one is in a time clock instance. Let me know if that will affect anything:

sub_1OyKGiBBbrkUCgHOMKwpX0lv

supple lagoon
#

Sorry for the delay! I see you used the Resume Subscription endpoint but yes, the subscription's status is still paused. When you resume the subscription, do you want to update the billing cycle anchor to now?

spiral terraceBOT
thorn grove
#

Yes I do. Is it expected that it would still be paused?

supple lagoon
#

If you reset it to now and a new invoice is generated, that invoice must be paid first before the subscription is moved back to active

thorn grove
#

And resume does not attempt to pay the invoice automatically if the billing anchor is reset?

supple lagoon
#

Resume should attempt to pay the invoice automatically if the subscription's collection_method is set to charge_automatically

thorn grove
#

It is set to charge automatically but does not attempt to charge. This may mean nothing, but if I select the resume option from the UI the subscription sets itself to active and pays the invoice. The interaction through the API seems to not have the same affect.

supple lagoon
#

Can you try advancing the clock 1 day?

thorn grove
#

It remains paused.

inner crystal
#

Hi, taking over as roadrunner_stripe needs to step away. Let me catch up

thorn grove
#

Ok!

inner crystal
#

Ok, it appears that the Subscirption was paused and it create an invoice that has not been paid yet: in_1OyM6ZBBbrkUCgHOkTjGAeRs. For the up-pausing to work, that invoice needs to. be paid or marked as uncollectible: https://docs.stripe.com/api/subscriptions/resume. Can you attempy to either pay or mark the invoice uncollectible and try again?

thorn grove
#

From what I understand from me and roadrunner_stripe’s correspondence is that it should attempt to automatically charge when resume is called because I have collection method set to charge automatically

inner crystal
#

Sorry, I'm attept to resproduce this on my end

#

That is because you added the payment method after that resume call.

#

There was no payment method on the customer so it could not charge automatically.

inner crystal
#

Sorry, testing this on my end fully.

thorn grove
#

If that were true shouldn't the resume functionality fail through the UI as well?

#

All good! Just reacting with my thoughts as you respond!

inner crystal
#

After fully testing this, this looks like the behavior is working as expected. Even if the Subscription has a payment behavior of charge_automatically, the invoice created in_1OyM6ZBBbrkUCgHOkTjGAeRs after the pause has auto_advance set to false: https://docs.stripe.com/api/invoices/object#invoice_object-auto_advance. For this reason, the invoice is not paid with the payment method attached to the customer.

#

To move forward, you would either pay the invoice or mark the invoice as uncollectible.

fierce muskBOT
thorn grove
#

What makes resuming through the API different from resuming through the UI? My desired flow fits with the stripe in app flow, I just assumed that hitting the resume button and calling resume from the API would result in identical behavior