See output of POST from external endpoint / webhook

Viewed 36

Is there any way in PHP to see the output of a POST from an external source. For example, the POST from a stripe webhook.

$body = @file_get_contents('php://input');
$response = json_decode($body);

\Stripe\Stripe::setApiKey('MyKey');
if(!empty($response)) {
    switch($response->type) {
        case "customer.created":
            echo $response->data->object->email;
            exit;
    }
}

All what I can get is logs from the web server:

54.XXX.XXX.XXX - - [18/Jun/2020:15:55:06 +0200] "POST /external/webhooks/stripe/endpoint_subscriptions.php HTTP/1.1" 200 31 "-" "Stripe/1.0 (+https://stripe.com/docs/webhooks)"
0 Answers
Related