#suchismita_52568

1 messages · Page 1 of 1 (latest)

coarse oceanBOT
#

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

pliant shell
#

Hello, are you getting an error when you try to create a session?

trail oar
#

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

pliant shell
#

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?

trail oar
#

yes

#

but not getting exacly from where it's coming

#

Is the above code looks correct??

pliant shell
#

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

trail oar
#

can you assist me with direct API integration where i can directly call the strip API on a button click from our website??

pliant shell
#

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.

trail oar
#

yes please

#

it's coming from Stripe

#

please help me to fix this

pliant shell
#

How do you know it is coming from Stripe? Can you show me the Stripe error?

trail oar
#

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

pliant shell
#

I don't think that that page is the Stripe code page that you coded

#

It looks like a generic server error page

trail oar
pliant shell
#

I know that code

trail oar
#

this is the file which is loading that page

pliant shell
#

If you debug

#

If you place a breakpoint in that code