#V3NG3ANC3
1 messages ยท Page 1 of 1 (latest)
Why is your integration creating a 2nd subscription for a renewal?
Can you share the sub_xxx ID for the first subscription?
I want to figure out why the automatic renewal is failing
The automatic renewal isn't failing, it's succeeding on the stripe side, the issue is, I'm unable to update my side of things as I'm not able to cross reference the renewed subscription.
For example, when a subscription expires, it cancels the original subscription, and creates a new one (which I'm guessing is expected). The customer ID for example on the first subscription would be cus_123, and the renewed subscription would have a customer ID of cus_321, is this normal?
But why is the subscription expiring? That shouldn't happen unless explicitly canceled
Can you share some IDs please
For example, when a subscription expires, it cancels the original subscription, and creates a new one (which I'm guessing is expected). The customer ID for example on the first subscription would be cus_123, and the renewed subscription would have a customer ID of cus_321, is this normal?
Depends on how you're integrating/creating subscriptions.
I'm logging into the stripe website and setting the expiry date to the next day for testing (I'm using test mode) what could I do to ensure the the customer ID does not change when a subscription is being renewed? Surely as its the same customer it shouldn't change anyway?
It shouldn't, no. But I suspect what you're describing as a 'renewal' isn't actually a renewal
But I can't really confirm without some object IDs for me to look at
OK, I'm just logging into the database now, what object IDs would you need?
The sub_xxx ID of the subscription(s)
When I created the subscription, it was
sub_1Lk5IwE0UCR6EQ1L6i8JWweC
the renewed ID is
sub_1LjiB1E0UCR6EQ1LHYPwILFK
Taking a look!
So, sub_1Lk5IwE0UCR6EQ1L6i8JWweC was actually canceled: https://dashboard.stripe.com/test/logs/req_hHDwLAhVGRpu3M
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
That's a terminal state. You can't recover that Subscription, so it's only possible to create a new subscription at that point
When for example a monthly subscription expires after a month, does it not automatically cancel that subscription and create a new one?
sub_1LjiB1E0UCR6EQ1LHYPwILFK was created via Checkout: https://dashboard.stripe.com/test/logs/req_Da3UmK54PjBBHR
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You didn't pass the customer parameter when creating that session, so Checkout created a new Customer object for you:
If blank for Checkout Sessions in payment or subscription mode, Checkout will create a new Customer object based on information provided during the payment flow.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
No, the same Subscription object would be updated to reflect the status at the time. I recommended reading this: https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
The same Subscription object would exist for the duration of the subscription until it is either canceled, lapses (according to your settings for failed payments)
how could I go about simulating a subscription expiration for testing?
Can you define what you mean by 'expiring'?
I basically want to test it by creating a subscription (1 month) then fast forwarding to the end of that 30 day period in which the subscription ends and gets renewed
๐ taking over for my colleague. Let me catch up.
have you had the chance to look at test clocks? https://stripe.com/docs/billing/testing/test-clocks
I haven't seen this before, thanks! Ill read up on it now ๐
can I add an existing customer/ subscription to the test clock?
I've created a subscription via my website, which has updated my website model, now I would like to use that same subscription I've created and use that with the test clock, but the only option I see is to add a new customer rather than an existing one
no unfortunately you can't
you'd have to create a new customer and a new subscription
That's a shame, is there a way of simulating this without a test clock on a live subscription?
test clocks are only available in test mode
you should never use them on a live subscription
I am in test mode
but you can replicate the subscription and backdate it and everything
I just want to test that when my subscription expires, it correctly updates the seperate models on my own database
so it would be the same
as using that other subscription
and since you're in test mode I don't see the issue with creating a new customer/subscription
Just because I know everything works on stripes side, I just want to check that I've set my webhook up correctly to update my seperate database