#eztaxi-500

1 messages · Page 1 of 1 (latest)

gusty rivet
#

hello, can you share the request ID for the 500? is the 500 error coming from Stripe?

arctic quiver
#

Summary
URL: https://myezadmin.com/tickets/public/success.php?session_id=cs_test_a1tKtHKy6gfQnGHfQXx7ZQYEH8DSTA0b5Hncb5iEsjwyn5f50IRBQvJ8lQ
Status: 500
Source: Network
Address: 208.97.157.147:443

Request
:method: GET
:scheme: https
:authority: myezadmin.com
:path: /tickets/public/success.php?session_id=cs_test_a1tKtHKy6gfQnGHfQXx7ZQYEH8DSTA0b5Hncb5iEsjwyn5f50IRBQvJ8lQ
Cookie: __stripe_mid=df04ea1b-47d2-4900-b48e-3dd4af2e999e14fd00
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding: gzip, deflate, br
Host: myezadmin.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15
Accept-Language: en-us
Referer: https://checkout.stripe.com/
Connection: keep-alive

Response
:status: 500
Content-Type: text/html; charset=UTF-8
Pragma: no-cache
Vary: User-Agent
Date: Fri, 24 Sep 2021 15:07:52 GMT
Content-Length: 0
Expires: 0
Cache-Control: no-cache, no-store, must-revalidate
Server: Apache

Query String Parameters
session_id: cs_test_a1tKtHKy6gfQnGHfQXx7ZQYEH8DSTA0b5Hncb5iEsjwyn5f50IRBQvJ8lQ

Stripe Checkout is a drop-in payments flow designed to drive conversion with just a few lines of code.

gusty rivet
#

that is a 500 on your backend though right

arctic quiver
# gusty rivet hello, can you share the request ID for the 500? is the 500 error coming from St...

this is request:

'

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

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

$YOUR_DOMAIN = 'https://myezadmin.com/tickets/public';
$price_id = $_POST['price_id'];
//$successpage = '/success.php?orderid='.$checkout_session;

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

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

gusty rivet
#

not from Stripe

#

so you would have to add logs and debug your code more

arctic quiver
#

but payment goes success from stripe

gusty rivet
#

yes exactly, that is what I'm saying

Stripe is doing its part
Stripe Checkout navigates back to your url above
and your page is crashing / 500'ing

#

there's some bug in your code on your success.php page

#

I can't say what it is, this is on the developer to debug

arctic quiver
#

this is the code on success.php:

`<?php
require '../vendor/autoload.php';

$orderid = $_GET['session_id'];

$stripe = new \Stripe\StripeClient(
'sk_test_51J..........'
);
$stripe->charges->retrieve(
$orderid,
[]
);

$amount = $stripe->amount;
$qty = $stripe->quantity;

?>`

arctic quiver
#

I opened ticked for hosting server support, let's see what they will inform

#

Is this ok with this line?
$stripe->charges->retrieve( $orderid, [] );