diff --git a/src/Qbirr.php b/src/Qbirr.php index 6110b56..b4646a4 100644 --- a/src/Qbirr.php +++ b/src/Qbirr.php @@ -66,6 +66,8 @@ class Qbirr { 'receiver_name' => $req['receiver_name'] ?? '', ]; if (!empty($req['receiver_account'])) $body['receiver_account'] = $req['receiver_account']; + if (!empty($req['tolerance'])) $body['tolerance'] = $req['tolerance']; + if (isset($req['max_age_hours'])) $body['max_age_hours'] = (int) $req['max_age_hours']; return self::normalise($this->request('POST', '/api/v1/verify', $body)); } @@ -106,6 +108,8 @@ class Qbirr { 'retryable' => (bool) ($data['retryable'] ?? false), 'code' => isset($data['code']) ? (string) $data['code'] : null, 'receiver_source' => isset($data['receiver_source']) ? (string) $data['receiver_source'] : null, + // Written for the CUSTOMER. Show this to the payer; `error` is for you. + 'payer_error' => isset($data['payer_error']) ? (string) $data['payer_error'] : null, 'sandbox' => (bool) ($data['sandbox'] ?? false), ]; } @@ -138,7 +142,7 @@ class Qbirr { $boundary = '----qbirrphp' . bin2hex(random_bytes(8)); $body = ''; - foreach (['provider', 'amount', 'receiver_name', 'receiver_account'] as $k) { + foreach (['provider', 'amount', 'receiver_name', 'receiver_account', 'tolerance', 'max_age_hours'] as $k) { if (isset($req[$k]) && $req[$k] !== '') { $body .= "--{$boundary}\r\n" . "Content-Disposition: form-data; name=\"{$k}\"\r\n\r\n"