#suchismita_52568
1 messages · Page 1 of 1 (latest)
Hello suchismita_52568, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• https://discord.com/channels/841573134531821608/1164174476422938625, 0 days ago, 12 messages
Hello, are you getting an error when you try to create a session?
I am adding
<?php
require_once '../vendor/autoload.php';
require_once '../secrets.php';
\Stripe\Stripe::setApiKey($stripeSecretKey);
header('Content-Type: application/json');
$YOUR_DOMAIN = 'http://localhost:4242';
$checkout_session = \Stripe\Checkout\Session::create([
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => 'price_1O2AyoSJR5uDvUUEPO4j0Cx6',
'quantity' => 1,
]],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '/success.html',
'cancel_url' => $YOUR_DOMAIN . '/cancel.html',
]);
header("HTTP/1.1 303 See Other");
header("Location: " . $checkout_session->url);
this in the checkout.php file
and getting this error
can you please help me here
helloo
The server is very busy so it may be a bit between responses
It looks like your server returned a 500, which is not an error that Stripe could make your server throw
Your server may be returning it because of a Stripe error but you will need to debug your code to see if that is the case or if there is something else
Have you tried stepping through your code to see where the 500 comes from?
yes
but not getting exacly from where it's coming
Is the above code looks correct??
Yep that is it, you will need to dig in further on your server side to figure out the cuase
If your server is no seeing these requests at all, you may need to talk to your hosting provider
this file contains complete strip code which i found here https://stripe.com/docs/checkout/quickstart
can you assist me with direct API integration where i can directly call the strip API on a button click from our website??
I can help if the error is coming from Stripe, so if that 500 turns out to be happening because of a Stripe error, I can help you fix the Stripe error.
How do you know it is coming from Stripe? Can you show me the Stripe error?
the page contains only strip code
otherwise can you please help me to call strip API
but i need a way to integrate please help
I don't think that that page is the Stripe code page that you coded
It looks like a generic server error page
I know that code
this is the file which is loading that page