#omar-connect
1 messages · Page 1 of 1 (latest)
Okay
We are trying to integrate our platform and Strip Connect
But there is a difficulty in doing this
Can anyone help me?
Happy to help! But I need more details about what exactly you want to achieve and where do you face the difficulty.
when i press chckout button
It takes me to a blank page
include ('stripe/stripe-php-master/init.php');
$CONNECTED_STRIPE_ACCOUNT_ID = 'acct_1KT1JREjVldP1NPm';
\Stripe\Stripe::setApiKey('sk_test_51IxeRVH5VHdK3XAsfzkXmJ4NaaNdmAY9Iw2doE74W8q0XjhMNV28NQ8i4P1WGaa0hZakeJhNWP2CH4UJe93CuYQm009YPMue6H');
$session = \Stripe\Checkout\Session::create([
'payment_method_types' => ['card'],
'line_items' => [[
'name' => 'Stainless Steel Water Bottle',
'amount' => 1000,
'currency' => 'usd',
'quantity' => 1,
]],
'payment_intent_data' => [
'application_fee_amount' => 123,
],
'mode' => 'payment',
'success_url' => 'https://www.hyoffer.com/success.php',
'cancel_url' => 'https://www.hyoffer.com/cancel.php',
], ['stripe_account' => 'acct_1KT1JREjVldP1NPm']);
this is my code
Thanks! I just checked your account, and it looks like the Checkout Session was correctly created on the connected account. So the code above seems correct.
What do you do on the frontend to redirect users to the Checkout Session URL?
<html>
<head>
<title>Buy cool new product</title>
</head>
<body>
<form action="stripe2.php" method="POST">
<button type="submit">Checkout</button>
</form>
</body>
</html>
what is wrong with my code ?
Thanks! Did you add these two lines at the end of your PHP file?
header("HTTP/1.1 303 See Other");
header("Location: " . $session->url);
I would recommend you to first read this Stripe guide, that's where I found these two lines
https://stripe.com/docs/checkout/quickstart
(make sure to select "PHP" for the backend)