opalepatrick Posted August 10, 2021 Share Posted August 10, 2021 I am trying to process a Stripe POST response with a webhook endpoint script. $payload = json_decode(file_get_contents("php://input")); var_dump($payload); Problem is that I am getting NULL. However... the Stripe Dashboard that shows the request & response to the Stripe request is correct for the specific event, even to the extent of showing the dump and error messages afterwards. Any ideas would gratefully received as I have spent way too long on this... although having to pick apart stuff like this does end up with me learning a lot more! Link to comment Share on other sites More sharing options...
opalepatrick Posted August 10, 2021 Author Share Posted August 10, 2021 Narrowed this right down to $payload = file_get_contents('php://input'); if ($payload) { // $payload = file_get_contents("php://input"); echo "worked"; } else { echo "not working"; } So, in the browser, I am getting "not working" - in the stripe dashboard response, I am getting "worked" - how is this possible? Link to comment Share on other sites More sharing options...
opalepatrick Posted August 11, 2021 Author Share Posted August 11, 2021 I should point out that I have tried a few different solutions offered elsewhere in other posts including the trailing slash. I used reqbin and got a "worked" back as well. I am baffled Link to comment Share on other sites More sharing options...
opalepatrick Posted August 13, 2021 Author Share Posted August 13, 2021 OK, I have resolved this although I am not sure I fully understand but basically I was trying to use webhook code on a 'success' page. Moved it to something that could be polled asynchronously an it worked straightaway. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now