Skip to content

Commit

Permalink
Merge pull request #15 from xendit/0505gonzalez-patch-1
Browse files Browse the repository at this point in the history
Update post_invoice_status_callback_server_example.php
  • Loading branch information
albertlieyingadrian authored Jan 25, 2017
2 parents 64a9e50 + 4ff1e4e commit 0979a44
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/examples/post_invoice_status_callback_server_example.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST" && $_SERVER["SCRIPT_NAME"] === "/paid_invoice_from_xendit") {
$dataJSON = file_get_contents("php://input");
$data = json_decode($dataJSON, TRUE);
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$data = file_get_contents("php://input");

print_r("Get the paid invoice when it is paid. \n");
print_r(json_encode($data, JSON_PRETTY_PRINT)."\n");
print_r("Updating your database with the response data that you get. \n");
print_r("\n\$data contains the updated invoice data \n\n");
print_r($data);
print_r("\n\nUpdate your database with the invoice status \n\n");
} else {
print_r("Cannot ".$_SERVER["REQUEST_METHOD"]." ".$_SERVER["SCRIPT_NAME"]);
}
Expand Down

0 comments on commit 0979a44

Please sign in to comment.