.json written by webhook.php and shows a receipt with items $dataDir = __DIR__ . '/data'; $invoice = $_GET['invoice'] ?? ''; $cancel = isset($_GET['cancel']); $status = 'PENDING'; $details = null; $items = []; if ($invoice && is_file("$dataDir/$invoice.json")) { $details = json_decode(file_get_contents("$dataDir/$invoice.json"), true); if (!empty($details['status'])) { $status = $details['status']; } if (!empty($details['items']) && is_array($details['items'])) { $items = $details['items']; } } // Helpers function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); } function money_fmt($value, $currency) { if ($value === null || $value === '') return ''; return h($currency) . ' ' . h(number_format((float)$value, 2, '.', '')); } ?>
Invoice: = h($invoice) ?>
You can return to your cart and try again.
Invoice: = h($invoice) ?>
Status: = h($status) ?>
= h($details['resource_id'] ?? '') ?>= h($details['custom']) ?>| Server ID | Item | Qty | Unit Price | Line Total | '.h($sku).' | '; echo ''.h($name).' | '; echo ''.h($qty).' | '; echo ''.money_fmt($unit, $currency).' | '; echo ''.money_fmt($line, $currency).' | '; echo ''; } ?>
|---|---|---|---|---|
| Total | = money_fmt($grand, $currency) ?> | |||
No line items were included in this webhook. If you just paid, refresh in a few seconds.
Waiting for confirmation from PayPal… this can take a few seconds. Refresh to update.
We’re waiting for PayPal to confirm your payment. This page will show the receipt once we receive the webhook. Try refreshing in a few seconds.