#nathan-sucesspage

1 messages · Page 1 of 1 (latest)

late finch
#

Yes we can take a look. What's your concern?

somber sage
#

hi

#

where i can get this session id

#

and put string to replace it

late finch
#

No, you just put it exactly like that

#

...?session_id={CHECKOUT_SESSION_ID}

#

It's a template. Stripe wil use it to insert the session id for you

somber sage
#

<?php

require 'vendor/autoload.php';
\Stripe\Stripe::setApiKey('sk_test_51JZVslERg7yCZcir1A5JW4vVBMQoI5R5hmRwlsvbkfskrgql4WKemiDsSpjOHClMrH73MZzqInoVxiqXxaGDvAlxxxxxx');

header('Content-Type: application/json');

$YOUR_DOMAIN = 'http://prosfinity.com/public';

$checkout_session = \Stripe\Checkout\Session::create([
'line_items' => [[
# TODO: replace this with the price of the product you want to sell
'price' => 'price_1Jb6XXERg7yCZcirJSBS4nrf',
'quantity' => 1,
]],
'payment_method_types' => [
'card',
],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '/success?session_id=={CHECKOUT_SESSION_ID}',
'cancel_url' => $YOUR_DOMAIN . '/cancel.html',
]);

header("HTTP/1.1 303 See Other");
header("Location: " . $checkout_session->url);

#

and i correct now?

late finch
#

you have == instead of =

#

just follow the Doc

somber sage
#

fixed

#

In doc don't have .php extension

#

Do i need ?

#

?

late finch
#

it's the file extension, yes you need it

somber sage
#

how?

#

now cannot show the success page

#

'success_url' => $YOUR_DOMAIN . '/success?session_id={CHECKOUT_SESSION_ID}',

#

there is no any php extension

#

if i add php

late finch
#

ah you mean in the url? yeah you need it sorry

#

the error is 500 error. Please check your server log to see where it failed

somber sage
#

where place i put .php?

#

can you show me ?

#

I think the is correct

#

?

#

[Thu Sep 30 18:24:35.826644 2021] [php7:error] [pid 15814] [client 112.120.250.139:49488] PHP Fatal error: Uncaught Error: Class 'Slim\App' not found in /home/admin/web/prosfinity.com/public_shtml/success.php:11\nStack trace:\n#0 {main}\n thrown in /home/admin/web/prosfinity.com/public_shtml/success.php on line 11

#

I found this

#

Am i missing slim framework?

#

I was google search and could you tell me how to install slim?

late finch
#

You might be using a Slim example? Try google "how to create a Slim PHP web application"

somber sage
#

this would help?

#

Another question

#

How to collect my website login account cookies from success page?

#

I have a cookies of sessionid from success.html and I want to collect it .

late finch
#

I am afraid I don't follow the question. You have success.php, not success.html, correct? And when your customer went to success.php, Stripe already sent in the session_id inside the url. You can take it from the URL

somber sage
#

no

#

if i didn't use success.php

#

I am using simple success.html

#

<html>
<head>
<title>Thanks for your order!</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section>
<p>
We appreciate your business! If you have any questions, please email
<a href="mailto:orders@example.com">orders@example.com</a>.
</p>
</section>
</body>
</html>

#

In this page I can read the sessionid of my website account

late finch
#

You would need to create a handler like success.php instead, when receiving the request, log the session_id came within the url, then display the html you want

somber sage
#

success.php

#

just slim app?

#

the success.php many problem cause http 500 status

#

any one can help?

late finch
#

It's the correct direction to go: to resolve the 500 by reviewing Slim usage, and after you succeed, intercept the reponse inside the method and capture the SESISON_ID

somber sage
#

I used composer to install slim

#

but it's still not work

#

what mean It's the correct direction to go: to resolve the 500 by reviewing Slim usage

somber sage
#

less information from stripe about Slim

#

I thought the success.php cannot find the Slim app

late finch
#

Yeah the issue if how to make your PHP application recognize Slim, other than just composer install

#

I think you would need to search around the usage of PHP/Slim to figure it out first

somber sage
#

I already done by composer install

#

OK