Stripe retrieve checkout session fails

Wappler Version : 3.9.2
Operating System : mac
Server Model: PHP
Database Type:
Hosting Type:

Expected behavior

I should be able to retrieve a checkout session

Actual behavior

The order is processed, but upon returning to the checkout result, an error is received:


  "code": 0,
  "file": "/var/www/html/dmxConnectLib/modules/stripe.php",
  "line": 480,
  "message": "Use of undefined constant session - assumed 'session' (this will throw an Error in a future version of PHP)",
  "trace": "#0 /var/www/html/dmxConnectLib/modules/stripe.php(480): exception_error_handler(2, 'Use of undefine...', '/var/www/html/d...', 480, Array)\n#1 /var/www/html/dmxConnectLib/lib/App.php(195): modules\\stripe->retrieveCheckoutSession(Object(stdClass), 'retrieveCheckou...')\n#2 /var/www/html/dmxConnectLib/lib/App.php(127): lib\\App->execSteps(Object(stdClass))\n#3 /var/www/html/dmxConnectLib/lib/App.php(94): lib\\App->exec(Object(stdClass))\n#4 /var/www/html/dmxConnect/api/result.php(8): lib\\App->define(Object(stdClass))\n#5 {main}"
}

How to reproduce

Store the checkout session id on checkout:

And attempt to retrieve the checkout session using that id:

I have confirmed the session.id is available at time of checkout.

Unzip the stripe.php and place it in dmxConnectLib/modules

stripe.zip (6.7 KB)

Thanks George…New error:


  "code": 0,
  "file": "/var/www/html/dmxConnectLib/stripe/lib/Exception/ApiErrorException.php",
  "line": 38,
  "message": "Invalid checkout.session id: {{$_SESSION.id}}",
  "trace": "#0 /var/www/html/dmxConnectLib/stripe/lib/Exception/InvalidRequestException.php(35): Stripe\\Exception\\ApiErrorException::factory('Invalid checkou...', 404, '{\\n  \"error\": {\\n...', Array, Object(Stripe\\Util\\CaseInsensitiveArray), NULL)\n#1 /var/www/html/dmxConnectLib/stripe/lib/ApiRequestor.php(189): Stripe\\Exception\\InvalidRequestException::factory('Invalid checkou...', 404, '{\\n  \"error\": {\\n...', Array, Object(Stripe\\Util\\CaseInsensitiveArray), NULL, NULL)\n#2 /var/www/html/dmxConnectLib/stripe/lib/ApiRequestor.php(151): Stripe\\ApiRequestor::_specificAPIError('{\\n  \"error\": {\\n...', 404, Object(Stripe\\Util\\CaseInsensitiveArray), Array, Array)\n#3 /var/www/html/dmxConnectLib/stripe/lib/ApiRequestor.php(489): Stripe\\ApiRequestor->handleErrorResponse('{\\n  \"error\": {\\n...', 404, Object(Stripe\\Util\\CaseInsensitiveArray), Array)\n#4 /var/www/html/dmxConnectLib/stripe/lib/ApiRequestor.php(120): Stripe\\ApiRequestor->_interpretResponse('{\\n  \"error\": {\\n...', 404, Object(Stripe\\Util\\CaseInsensitiveArray))\n#5 /var/www/html/dmxConnectLib/stripe/lib/BaseStripeClient.php(134): Stripe\\ApiRequestor->request('get', '/v1/checkout/se...', Array, Array)\n#6 /var/www/html/dmxConnectLib/stripe/lib/Service/AbstractService.php(59): Stripe\\BaseStripeClient->request('get', '/v1/checkout/se...', NULL, Object(Stripe\\Util\\RequestOptions))\n#7 /var/www/html/dmxConnectLib/stripe/lib/Service/Checkout/SessionService.php(71): Stripe\\Service\\AbstractService->request('get', '/v1/checkout/se...', NULL, NULL)\n#8 /var/www/html/dmxConnectLib/modules/stripe.php(543): Stripe\\Service\\Checkout\\SessionService->retrieve('{{$_SESSION.id}...')\n#9 /var/www/html/dmxConnectLib/lib/App.php(195): modules\\stripe->retrieveCheckoutSession(Object(stdClass), 'retrieveCheckou...')\n#10 /var/www/html/dmxConnectLib/lib/App.php(127): lib\\App->execSteps(Object(stdClass))\n#11 /var/www/html/dmxConnectLib/lib/App.php(94): lib\\App->exec(Object(stdClass))\n#12 /var/www/html/dmxConnect/api/result.php(8): lib\\App->define(Object(stdClass))\n#13 {main}"
}

next try :slight_smile:

stripe.zip (6.7 KB)

1 Like

That did it. Thanks! :slight_smile:

1 Like

Fixed in Wappler 3.9.3

This topic was automatically closed after 30 hours. New replies are no longer allowed.