Tan Code
Sell Confirm function
After sell function called this function can be called by using TanCode as a parameter. This function checks customer transaction and confirms it if everything is right.
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.monpay.mn/resource/partner/v1/sellconfirm');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('<request>
<customer system="ISDN">99XXXXXX</customer>
<amount>2</amount>
<tancode>273257</tancode>
</request>');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Content-Type' => 'application/xml',
'Authorization' => 'Bearer {Your token}'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/xml");
RequestBody body = RequestBody.create(mediaType, "<request>
<customer system="ISDN">99XXXXXX</customer>
<amount>2</amount>
<tancode>273257</tancode>
</request>");
Request request = new Request.Builder()
.url("https://api.monpay.mn/resource/partner/v1/sellconfirm")
.method("POST", body)
.addHeader("Content-Type", "application/xml")
.addHeader("Authorization", "Bearer {your token}")
.build();
Response response = client.newCall(request).execute();
Header
Method | POST |
Authorization | Bearer XXXXXXXXXX |
Content-Type | application/xml |
Request
Parameters | Type | Required | Description | Example | |
---|---|---|---|---|---|
request | customer | object | Yes | Customer ID /99xxxxxx, 9999888877776666, 12FA5B1A5D6C5E9E7A/'|trans }} | <customer system="ISDN">99xxxxxx</customer> |
attribute | Yes | ISDN – Phone number, CARDID – Card number, NFCID - NFC Card number, LOYALTYID – Account number | |||
amount | double | Yes | Total amount | ||
tancode | string | No | Code delivered by sms | 123456 |
Response
Parameters | Type | Description | Example |
---|---|---|---|
code | integer | Code determines if request was successful or not | 0 |
info | string | Description | |
requestId | string | Request ID | |
transactionId | string | Transaction No |
Response type
Parameters | Response | Description |
---|---|---|
code | 0 | Successful |
1 | Bad request | |
999 | Internal error | |
info | Successful | |
... | Other descriptions |