#muhammad-junaid-babar_api
1 messages ¡ Page 1 of 1 (latest)
đ 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/1310881753744937040
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
If any one can help me out.
Hi there, I can only support if you have a direct integration with Stripe. If you have questions related to a 3rd-party plugin, I'd suggest you to reach out to the plugin developer directly.
No I am not using any thirdparty
I am using the strip PHP library
Here is my code
$checkoutSession = CheckoutSession::create([
'payment_method_types' => ['card'],
'mode' => 'subscription',
'line_items' => [
[
'price' => $id, // Replace with your price ID
'quantity' => 1,
'adjustable_quantity' => [
'enabled' => true,
'minimum' => 1,
],
]
],
'customer' => $user->stripe_id, // Include the customer ID
'subscription_data' => [
'metadata' => [
'user_id' => $user->id,
'template_code' => $code
],
],
'allow_promotion_codes' => true, // Enable promo codes
'success_url' => route('home'),
'cancel_url' => route('checkout.cancel'),
]);
OK, so you want your customer to have more than one subscriptions?
yes