#matt11-testdecline

1 messages · Page 1 of 1 (latest)

red coral
#

what you can maybe try doing is to create a subscription with a trial with this card

#

or alternatively, the other way i can think of, is to use test card A first, then after the subscription is created, switch to test card B which would decline after attaching, so that the payment will fail upon renewal

fierce cape
#

Hi! Thanks for the quick response. I will try for sure and then report to you

#

Another question..

#

how can I achieve the paymentIntent status = 'requires_payment_method' during a subscription renewal?

red coral
fierce cape
#

ok thanks.
Currently I have a subscription with a trial period of 7 days.
I set the cancel_at_period_end = true so Stripe tells me that the subscription will end at the end of the trial period (7th April) and there won't be other invoices.

#

I think that at the end of trial period the subscription status will be 'canceled' isn't it?

red coral
#

yes, the status should be canceled

fierce cape
#

so if I go to the subscritpion settings and I set 0 days remaining for the trial period, the subscription should be end immediately

#

but the status stay 'active'

red coral
#

you can't set 0 days for trial period i believe

#

there's a minimum amount of time for the trial period

#

how are you setting it to 0 days can you share a screenshot perhaps?

fierce cape
#

here, I set from 7 to 0

#

sorry the customer Stripe account is in italian

#

but If I set 0, stripe tells me that the next incoice will be of 17,18€

#

and not 0€

red coral
#

when you set the trial period to 0, this means that you want to end the trial - not that you want to cancel the subscription.

fierce cape
#

yes you right. But the subscription has the cancel_at_period_end = true, so it is straightforward that the subscription should ends

red coral
#

i'm a bit confused as to what you're trying to achieve here. If you want to cancel the subscription at the end of the trial, i would simply set cancel_at_period_end=true. If i wanted to cancel the subscription immediately, then i would cancel the subscription directly.

Is there a reason why you're trying to set the trial period to 0 AND cancel at period end?

fierce cape
#

In my application I registered a user with a plan with trial period. Now I have to simulate like the trials ends and stripe calls my application with webhooks

#

so I would like to simulate that the trial period ends now

#

without manually click on "cancel subscription"

#

but letting Stripe doing his stuff like in normal use-case scenario

red coral
fierce cape
#

I saw that with test clock you cannot test an existing subscription but you need to create a new subscription, is it right?

red coral
#

yes, you need to create a new subscription

fierce cape
#

so with test_clocks I can't simulate a real case for my application

red coral
#

is there a reason why you can't create a new subscription, then advance the test clock to the date/time that the subscription's trial ends?

fierce cape
#

yes, because on my database I have lots of tables and I need to do stuff when stripe calls the webhooks

#

a new subscription won't be linked to any user on my database

red coral
#

alright, how about calling trial_end=now and off_session=true on an existing subscription?

fierce cape
#

yep, I'm trying it right now

#

what the off_session is about?

#

I confirm that now the status in 'canceled'

red coral
#

to indicate that this is happening off_session i.e. your customer isn't on your website

fierce cape
#

ok, so this is an "automatic" procedure

#

and if I need to end the "active" period of subscription? I set the end=now?

red coral
#

by end, you mean cancel the subscription?

fierce cape
#

yes I would like to do the same thing. So I pass from trial to active, I cancel the renewal and then "simulate" the end of period

red coral
#

i'm assuming that all you really care about here is that the subscription has ended. you would probably want to cancel the subscription [0] and set prorate=false since you're simulating cancelling it at period end

[0] https://stripe.com/docs/api/subscriptions/cancel

#

but really, i'd strongly recommend that you set things up in your test environment so that it'll run with test clocks

fierce cape
#

i really don't know how to achieve this. Stripe requires to create a new subscription that is not linked to any user in my database, so it is impossible to use the webhooks and communicate between the two apps

#

is it a bad idea to set the current_period_end = now? to simulate that subscription ends immediately?

red coral
#

you can set the current_period_end=now, but you would have to literally wait till the subscription ends

#

if your subscription is on a daily schedule, i guess it's not too bad, you could wait