Skip to content

Commit ca947ec

Browse files
webhook samples
1 parent 996585c commit ca947ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/example6-payment-status-webhook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function handleRequest()
3939
}
4040

4141
// Decode the JSON payload into an associative array
42-
$data = json_decode($rawPayload, true);
42+
$jsonBody = json_decode($rawPayload, true);
4343
if (json_last_error() !== JSON_ERROR_NONE) {
4444
http_response_code(400);
4545
header('Content-Type: application/json');
@@ -48,7 +48,7 @@ public function handleRequest()
4848
}
4949

5050
try {
51-
$payment = new Payment($data);
51+
$payment = new Payment($jsonBody['data']);
5252
} catch (Exception $e) {
5353
http_response_code(400);
5454
header('Content-Type: application/json');

0 commit comments

Comments
 (0)