Cashier Stripe Version
15.6.4
Laravel Version
12.14.1
PHP Version
8.4
Database Driver & Version
Postgres
Description
Hello,
I am facing the following problem:
I am using stripe checkout to create a subscription. In order to do so, I am generating the link this way:
<?php
$user
->collectTaxIds()
->newSubscription('default', 'price_1')
->checkout([
'success_url' => $url,
'cancel_url' => $url,
])->url;
That works and the user can subsribe.
If I then cancel the subscription using the billing portal:
$user->billingPortalUrl($url)
And re-enable it by checking out again using:
<?php
$user
->collectTaxIds()
->newSubscription('default', 'price_1...')
->checkout([
'success_url' => $url,
'cancel_url' => $url,
])->url;
This throws the following error:
duplicate key value violates unique constraint "subscriptions_stripe_id_unique"
Steps To Reproduce
- Use checkout to create a subscription
- Cancel that subscription (now!)
- Use checkout to re-create a subscription