#matt11-testdecline
1 messages · Page 1 of 1 (latest)
hi there! on this page : https://stripe.com/docs/testing, it mentions a card that can be attached to a customer but will Decline after attaching
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
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?
generally if a PaymentIntent isn't successful, it would move into requires_payment_mthod status - https://stripe.com/docs/payments/intents
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?
btw, this might help you with your testing : https://stripe.com/docs/billing/testing/test_clocks
yes, the status should be canceled
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'
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?
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€
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.
yes you right. But the subscription has the cancel_at_period_end = true, so it is straightforward that the subscription should ends
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?
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
you can either update the subscription with trial_end=now and off_session=true, or make use of test clocks to simulate this : https://stripe.com/docs/billing/testing/test_clocks
I saw that with test clock you cannot test an existing subscription but you need to create a new subscription, is it right?
yes, you need to create a new subscription
so with test_clocks I can't simulate a real case for my application
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?
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
alright, how about calling trial_end=now and off_session=true on an existing subscription?
yep, I'm trying it right now
what the off_session is about?
I confirm that now the status in 'canceled'
to indicate that this is happening off_session i.e. your customer isn't on your website
ok, so this is an "automatic" procedure
and if I need to end the "active" period of subscription? I set the end=now?
by end, you mean cancel the subscription?
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
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
but really, i'd strongly recommend that you set things up in your test environment so that it'll run with test clocks
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?