Jump to content

Recommended Posts

Posted

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!

Posted

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?

Posted

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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...