Get response using webhook
Note
Ensure that you include the webhook URL in the 'webhook_url' parameter when making a request to the Create Payment API.
Example Webhook Listner
<?php
$secretKey = 'YOUR SECRET KEY';
$headerKey = $_SERVER['HTTP_VP_MERCHANT_SECRET'] ?? null;
if(!empty($headerKey) && ($headerKey === $secretKey)) {
$data = file_get_contents("php://input");
$data = json_decode($data, true);
//do whataver you want with the data
} ?>
Simple Response
{
"pg_txnid": "VPCJ5QGCRW",
"merchant_txnid": "547844SDDHSDSD",
"amount": 500,
"charge": 10,
"stored_amount": 490,
"method": "nagad",
"method_txnid": "547ASDDXSD",
"meta_data": null,
"callback_url": "https://yourdomain.com/callback",
"webhook_url": "https://yourdomain.com/webhook",
"created_at": "2024-01-02 11:26:40",
"paid_at": "2024-01-02 11:40:40",,
"status": "success"
}