QR

Check Purchase Transaction

Хэрэглэгч QR кодоо уншуулан төлбөрөө төлсөний дараа борлуулалтын систем энэ функцыг ашиглан төлөлтийг баталгаажуулна.

                
$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://wallet.monpay.mn/rest/branch/qrpurchase/check?uuid=17793258e2ad4163a54d92b8d271c24d');
$request->setRequestMethod('GET');

$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Basic {Basic auth combination of Your branch username and MonPay account id}'
));

$client->enqueue($request)->send();

$response = $client->getResponse();
echo $response->getBody();
                
            
                
OkHttpClient client = new OkHttpClient().newBuilder().build();

Request request = new Request.Builder()
  .url("https://wallet.monpay.mn/rest/branch/qrpurchase/check?uuid=17793258e2ad4163a54d92b8d271c24d")
  .method("GET", null)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Basic {Basic auth combination of Your branch username and MonPay account id}")
  .build();

Response response = client.newCall(request).execute();
                
            
Header
Method GET
URL https://wallet.monpay.mn/rest/branch/qrpurchase/check
Authorization Basic Access Authentication
Accept application/json
Хүсэлт
Параметр Төрөл Заавал эсэх Тайлбар
uuid string Тийм “uuid” returned by previous generate QR api call.
Хариу
Параметр Төрөл Тайлбар
code integer Үйлдэл амжилттай эсэхийг тодорхойлно
info string Тайлбар
Хариуны төрөл
Http Status Code Тайлбар
200 0 Үйлдэл амжилттай
400 5 Хүсэлт буруу
400 23 QR not scanned
401 1 Unauthorized
500 999 Дотоод алдаа