The payment result is delivered by redirect. When the customer finishes paying on the hosted checkout, QRPay sends them back to the return_url you passed to initiate payment, carrying the result payload shown on the right. There is no polling to set up — your return_url handler is the verification step.
{
"message": {
"code": 200,
"success": ["SUCCESS"]
},
"data": {
"token": "2zMRmT3KeYT2BWMAyGhqEfuw4tOYOfGXKeyKqehZ8mF1E35hMwE69gPpyo3e",
"trx_id": "BP2c7sAvw75MTlrP",
"payer": {
"username": "testuser",
"email": "user@appdevs.net"
}
},
"type": "success"
}<?php
// return_url handler
$token = $result['data']['token'];
$trxId = $result['data']['trx_id'];
$order = Order::where('qrpay_token', $token)
->where('status', 'pending')
->first();
if (!$order) {
// unknown or already-fulfilled token
abort(404);
}
// amount/currency: trust YOUR record,
// not anything from the redirect
$order->markPaid($trxId);