#Justin (Shades)

1 messages ยท Page 1 of 1 (latest)

subtle larkBOT
rapid lotus
#

Are you encountering any errors in the browser dev console or your server logs?

#

Wondering whether your server is not reaching the redirect, or if the browser isn't honouring it.

shrewd ferry
#

Console says the following:

#

Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
DevTools failed to load source map: Could not load content for chrome-extension://ddlakobiikmpnaeakgbdeodclnmiablf/content/content.js.map: System error: net::ERR_BLOCKED_BY_CLIENT

rapid lotus
#

How are you running this code and accessing it?

shrewd ferry
#

I have a custom built customer management program, built with PHP. I do not want to process payments directly on the website, I prefer to send customers to a secure site to collect payment, and use a webhook to update my customer account when payment is received.

Currently I use PayPal button code to do that, but I want to switch to Stripe instead.

Here's the code I've got

#

Here's the relevant code from the customer facing page, that just sends the information along to "sendToStripe.php" when customer chooses to pay

rapid lotus
#

Ok, and are you hosting this locally with php -S 127.0.0.1:4242 --docroot=public like the quickstart guide suggests, or another pattern for your own application? Assuming you are, what do you logs tell you is happening in that sendToStripe.php file? (I assume thats where the Checkout creation is)

shrewd ferry
#

I'm on my live web server

#

developing in pages that aren't hyperlinked anywhere so customers can't accidentally stumble on them in the meantime - customers are still using my previous PayPal code

rapid lotus
#

I'd suggest building & testing this in test mode offline first, but sure even in this case what do the logs from the server show is happening when you expect the cehckout session creation + redirect?

shrewd ferry
#

I'm not sure where I would find the logs you're asking for

rapid lotus
#

Presumably on your server somewhere. You need to validate that you're actually reaching that Checkout session code, and handle any errors that might be happening. Unfortunately I don't know how your application or server works, so you'll need to use whatever debug techniques you use normally to trace where there might be errors.

#

Can you copy that price ID from your server code here?

#

I can use that to see if there are any Stripe request logs to shine some light

shrewd ferry
#

price_1MW2ofGaYFTIJfOAyHzEXvyS

rapid lotus
#

Hmm ok I'm not seeing any requests at all for your account over the last couple of days

#

so it seems like that session create call is never happening

shrewd ferry
#

I agree, it's like the header code is simply being ignored

#

there's no attempt at refreshing the page and redirecting

#

This is the error log from my cPanel. I don't believe any of that is helpful

rapid lotus
#

I cant see secrets.php to confirm $stripeSecretKey is valid - one thing to try would be putting your test mode secret key in there as a string instead of a variable

#

(dont share any secret keys here)

shrewd ferry
#

I have the test mode Secret key in there within quotation marks. Wouldn't this be a string as you suggest?

#

I did a very simple test to see where the code was failing. I put an "echo" before this segment of code and it appeared properly on the screen.

When I placed the echo after this segment of code, it did not appear on the screen.

Therefore, this code must be the throwing an error somewhere. But this is exactly what is given in the quickstart guide, so where am I going wrong?

rapid lotus
#

Are you able to get the details of that error? It's hard to speculate on the problem without that.

shrewd ferry
#

I'm not sure how I would? Is there code I could write into that "checkout_sesion"?

#

That's gotta be something within the Stripe files I downloaded from GitHub, who knows where within there the problem lies. \Stripe\Checkout\Session::create is not my code, so I don't know how I could analyze and debug it

elfin wyvern
#

Hello ๐Ÿ‘‹
Taking over as synthrider needs to step away

shrewd ferry
#

Hello, thanks

elfin wyvern
#

There's a lot of context in this thread, so while I catch up, would you mind giving me a short summary of where you're currently at?

shrewd ferry
#

Just trying to figure out why I don't get redirected to Stripe with the code from the quickstart guide

elfin wyvern
#

Have you checked your web server log? There should be some indication of what's failing exactly

elfin wyvern
shrewd ferry
elfin wyvern
shrewd ferry
#

Hmm, OK I'll see if I can do something with that