#bikash_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/1305876954192285811
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
i have added but still not working
$checkout_session = $stripe->checkout->sessions->create([
'customer_email' => 'bikash@cleonix.com',
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => 'price_1Q5nwVHjdlmJCM9iKP3Akpd4',
'quantity' => 1,
]],
'mode' => 'subscription',
'success_url' => $domain_url . '/'.$success_redirect_url.'?resp={CHECKOUT_SESSION_ID}',
'cancel_url' => $domain_url . '/'.$failure_redirect_url.'?is_cancel=yes',
'saved_payment_method_options' => ['payment_method_save' => 'enabled'],
'automatic_tax' => [
'enabled' => true,
],
]);
is this the first or the second time you do the checkout for this customer?
it doesn't work with customer_email
you need to pass an existing customer ID
you're passing
'customer_email' => 'bikash@cleonix.com',
this is wrong
you need to pass
'customer' => 'cus_xxx'
$checkout_session = $stripe->checkout->sessions->create([
'customer' => $customer_profile_id,
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => $price_id,
'quantity' => 1,
]],
'mode' => 'subscription',
'success_url' => $domain_url . '/'.$success_redirect_url.'?resp={CHECKOUT_SESSION_ID}',
'cancel_url' => $domain_url . '/'.$failure_redirect_url.'?is_cancel=yes',
'saved_payment_method_options' => ['payment_method_save' => 'enabled'],
]);
still not fetching the default card
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
this is sandbox env
the pm should have an allow_redisplay: 'always'
ok thanks!
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
I've updated the code, so if the user clicks on "Save my payment information for future purchases," it will auto-fill the data during their next purchase. However, there's a high chance customers might overlook this feature. Are there any alternative solutions for making this more visible? I'm also sharing the code. // Create the Checkout session
$checkout_session = $stripe->checkout->sessions->create([
'customer' => $customer_profile_id,
'line_items' => [[
// Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => $price_id,
'quantity' => 1,
]],
'mode' => 'subscription',
'success_url' => $domain_url . '/' . $success_redirect_url . '?resp={CHECKOUT_SESSION_ID}',
'cancel_url' => $domain_url . '/' . $failure_redirect_url . '?is_cancel=yes',
'payment_method_types' => ['card'],
'allow_promotion_codes' => true,
'saved_payment_method_options' => [
'payment_method_save' => 'enabled' // This enables saving the payment method for future use
],
]);
// Redirect to the Stripe Checkout page
echo '<script>window.location.href="' . $checkout_session->url . '"</script>';
There are not no