Skip links

API Documentation for Fundout

Chapter 1 Overview

This document is the Payment Gateway Interface Specification for Quomo payment System.

It describes the interface details between online merchant and Quomo payment gateway. Interested Reader of this document would be developers and testers of Merchant System.

HTTP protocol and JSON format are adopted for data interaction between merchant and Quomo payment gateway. Details of API specification shall be shown as below

Chapter 2 Digital Signature

To ensure the integrity and authenticity of request parameter transmitted to Quomo payment gateway, RSA algorithm are adopted to sign the plaintext of the request message and the signed data will be set as a field of request message for verification purpose of Quomo payment gateway. RSA private key to sign request message shall be agreed and set during merchant registration with Quomo payment gateway.

Both private key and public key are necessary for RSA signature. Both private key and public key are generated with OPENSSL by merchant. Merchant and Quomo need to exchange their own public key. Therefore, Merchant uses Quomo public key and Merchant private key.

During the merchant sending the pre-sign string when requesting, the merchant private key and the pre-sign string are used in the RSA signature algorithm by the RSA signature function to get the result string.

After receiving the pre-sign string during responding from Quomo system, the Quomo public key, the pre-sign string and the parameter “signData” are used in the RSA signature asymmetric algorithm by the RSA signature function to accomplish the signature verification.

Chapter 3 Interface Specification

3.1 Query Account Balance

By calling to this API URL, merchant can query their account balance. Merchant system shall send the query message with correct parameters, Quomo digital will then reply with a response code and along with merchant’s current balance amount.

Payment Gateway API URL

https://www.quomo.digital/Payapi_Index_PBalance.html

Request parameters for Merchant to send to Quomo

ParameterDescription
merchantIdmerchantId assigned by Quomo System
requestTimecurrent time, format: “2015-01-23 14:27:30 ”
signDataThe correct signed data

Response parameters from Quomo

ParameterDescriptionLengthData Type
responseCodeKindly refer appendix for more details3Int
responseMessageKindly refer appendix for more details200String
merchantIdsame value as the merchantId from request parameter12String
balanceAmountcurrent available amount12Decimal
UbalanceAmountcurrent available amount12Decimal
3.2 Submit Payout Transaction

Payment Gateway API URL

https://quomo.digital/Payapi_Index_TransdfUser.html

Request parameter for merchant to send to Quomo (Excel file format follow below sequence)

ParameterDescriptionLengthData TypeRequired
merchantIdmerchantId assigned by Quomo12StringYes
merchantTransactionIdunique reference to each transaction100StringYes
currencyCodevalue example “VND”, “THB” etc ( Pls refer to Appendix D)3StringYes
accountNameThe card holder name30StringYes
accountNumThe card number to receive the fund30IntYes
transactionAmountThe transaction amount12DecimalYes
bankNameThe bank name “DAB” “CIMB”100StringYes
requestTimecurrent time, format: “2015-01-23 14:27:30 ”15IntYes
bankProvThe bank location for province10StringYes
bankCityThe bank location for city10StringYes
callbackTo notify merchant’s application when a transaction has been made100StringYes
signDataRSA, Please refer appendix A200StringYes

Response parameters from Quomo

ParameterDescriptionLengthData Type
responseCodeKindly refer appendix for more details3Int
responseMessageKindly refer appendix for more details200String
merchantIdsame value as the merchantId from request parameter12String
merchantTransactionIdsame value as the merchantTransactionId from request parameter100String
3.3 Query Order Status

By calling to this API URL, merchant can query their payout order status. Merchant system shall send the query message with correct parameters, Quomo will then reply with a response code and along with merchant’s current order status.

Payment Gateway API URL

https://quomo.digital/Payapi_Orderenquiry_payout.html

Request parameters for Merchant to send to Quomo

ParameterDescription
merchantIdmerchantId assigned by Quomo
merchantTransactionIdsame value as the merchantTransactionId from request parameter
signDataThe correct signed data

Response parameters from Quomo

ParameterDescriptionLengthData Type
merchantIdThe unique parameter to verify the merchant’s Identify in the Quomo system5Int
merchantTransactionIdOrder ID that sent by merchant100String
OrderNoTransaction ID, generated by the Quomo system for merchant’s reference100String
orderAmountThe actual exact amount for each transaction12Decimal
tradecompdateOrder completion time, format: “2015-01-23 14:27:30”15Int
orderStatusValue –
100 : Success,101: Fail , 102:In Progress , 10081003: 3 Incorrect Hash Value , 10091008: Incorrect Order ID
3Int
signDataRSA, Please refer appendix A200String
3.4 Query Order History

Payment Gateway API URL

http://quomo.digital/Payapi_Orderenquiry_orderhistory.html

Request parameters for Merchant to send to Quomo

ParameterDescriptionSample
merchantIdThe unique parameter to verify the merchant’s Identity during the whole payment procedure“20067”
ordertypeDetailed order type needed to be specified“1001”
startdate“2018-12-19 00:53:43”
enddate“2018-12-19 00:53:43”
hmacRSA, Please refer appendix A

Response parameters from Quomo

ParameterDescriptionLengthData Type
merchantIdThe unique parameter to verify the merchant’s Identify in the Quomo system5Int
merchantTransactionIdGenerated by the Quomo system for merchant’s reference100String
transactionAmountThe actual exact amount for each transaction100String
feeThe transaction fee for each transaction12Decimal
requestTimeOrder request time, format: “2015-01-23 14:27:30”15Int
transactionResultValue –
100 : Success,101: Fail , 102:In Progress
3Int
completeTimeOrder Completion time, format: “2015-01-23 14:27:30”200String
signDataRSA, Please refer appendix A200String

Chapter 4 Callback Mechanism

Callback URL shall be registered during merchant transaction send to Quomo system. After the business process of transaction uploaded by the Merchant System, transaction result will be sent to merchant by calling to the previously setup callback URL. And response of acknowledgement should be sent to Quomo payment gateway once merchant received transaction result. If above mentioned acknowledgement response are not sent by merchant, Quomo payment gateway shall send transaction result with certain time interval and max retry limit. If resend exceeds max retry limit, then transaction result will no longer being sent to merchant.

Parameters for callback request from Quomo System to Merchant

ParameterDescriptionLengthData Type
responseCodeKindly refer appendix for more details3Int
merchantIdmerchantId assigned by Quomo System12String
merchantTransactionIdunique reference to each transaction100String
currencyCodevalue example “VND” “THB” etc3String
accountNameThe card holder name, must be Simplified Chinese30String
accountNumThe card number to receive the fund30Int
transactionAmountThe transaction amount10,3Decimal
bankNameThe bank name, must be Simplified Chinese100String
transactionResultKindly refer appendix for more details10Int
failedReasonreason for transaction failure based on different  transactionResult255String
completeTimecurrent time, format: “1421994450032”15Int
signDataRSA, Please refer appendix A200String

Parameters for callback response from Merchant

ParameterDescriptionLengthData Type
merchantTransactionIdMust be same value for merchantTransactionId in callback100String
merchantIdmerchantId assigned by Quomo System12String
receivedReturn 100 to QUOMO, if other value, Quomo will consider callback failed and resend again3Int

Appendix A

When the merchant signs with Quomo, it will be granted access right for the APIs. The API call that the merchant makes normally should contains MID and signature information. The digital signature used for the digital signature for this System supports RSA. Merchant and Quomo will exchange the public key for each side.

The typical use cases for the merchant’s private key during requests are:

  • Payout
  • Order Enquiry
    Please make sure combine the parameters in a correct declared order in the interface when generation the original signaturestring, otherwise wrong sign data will be generated.

1. Constructing Pre-sign String

  • Choosing the parameters
    Get all the parameters. The parameters are converted into a set of name-value pairs. Keep those with no value. The “signData” key should not be included.
  • Sorting
    The name-value pairs are sorted in the order of the sequence in requested parameters list.
  • Concatenating
    Construct the string by concatenating the name value pair(‘name=value’) with the ampersand ‘&’•
  • Signature Generation
    After the pre-signed string is constructed, it would be signed by the applicable signature method (e.g. RSA). The result is the digital signature that would be put into the parameter ‘signData’ . The parameter of ‘signData’ would be appended to the string. Append the previous result string to base address of Quomo API, then change It to json format and we will get the final string for the API call.
  • Example Code (PHP):
$requestData = array(
"merchantId" => $merchantId, 
"merchantTransactionId" => $merchantTransactionId, 
"currencyCode" => $currencyCode,
"accountName" => $accountName,
"accountNum" => $accountNum,
"transactionAmount" => $transactionAmount,
"bankName" => $bankName,
"requestTime" => $requestTime,
"bankProv" => $val['bankProv,
"bankCity" => $bankCity,
"callback" => $callback
);

function signMsg($array){
$msg = "";
$i = 0;
foreach ($array as $key => $val) {
if($i == 0 ){
$msg = $msg."$key=$val"; }
else {$msg = $msg."&$key=$val"; } 
$i++; }
return $msg; }

$preSignString = signMsg($requestData);

function rsaSign($data, $private_key) {
//formatting
$private_key=str_replace("-----BEGIN PRIVATE KEY-----","",$private_key);
$private_key=str_replace("-----END PRIVATE KEY-----","",$private_key); 
$private_key=str_replace("\n","",$private_key);
$private_key="-----BEGIN RSA PRIVATE KEY-----".PHP_EOL .wordwrap($private_key, 64, "\n", true). PHP_EOL."-----END RSA PRIVATE KEY-----";
$res = openssl_pkey_get_private ( $private_key );

if ($res) {
openssl_sign($data, $sign, $res, OPENSSL_ALGO_SHA1); }
else {
"The format of your private_key is incorrect!"; 
exit ();
}

openssl_free_key ( $res );
$sign = base64_encode ( $sign ); 
return $sign; }
$signData = rsaSign($preSignString, $privateKey); //Merchant’s Private Key
$finalrequest = array( 
"merchantId" => $merchantId,
"merchantTransactionId" => $merchantTransactionId, 
"currencyCode" => $currencyCode,
"accountName" => $accountName,
"accountNum" => $accountNum, 
"transactionAmount" => $transactionAmount, 
"bankName" => $bankName,
"requestTime" => $requestTime, 
"bankProv" => $val['bankProv, 
"bankCity" => $bankCity, 
"callback" => $callback,
 "signData" => $signData
);

$finalrequestData = json_encode(finalrequest);
  • Example of the pre sign String:
merchantId=99999&merchantTransactionId=15667877471566787747¤cyCode=RMB&accountName=XiaoMing& accountNum=9879988778868687687&transactionAmount=10&bankName=ICBC&requestTime=2015-01-23 14:27:30&bankProv=Guangzhou&bankCity=Guangzhou&callback=callback.com

Example Response from Quomo: (No Verification required)

{"responseCode":100,"responseMessage":"The order has been received successfully","merchantId":"10002","merchantTransactionId":"15667877471566787747"}

2. Verifying the Signature

Construct the string for signature verification

Only take the string from the response in JSON. Normally the values are already sorted by requested orders by the keys of all the JSON nodes. The JSON content should include the beginning and ending braces “{” and “}”, the quotation mark, etc.

Call the verification function

Call the verification function, passing in the string to be verified, Quomo public key, and signature. Decide if it will pass by the return value.

Example Code:

function verify($strData, $signature, $publicKey) {
if (!openssl_get_publickey($publicKey)) { 
echo 'verifyTaiping openssl_get_publickey failed.'; 
return false; } 
$base64Signature = base64_decode($signature); 
if (!openssl_verify($strData, $base64Signature, $publicKey, OPENSSL_ALGO_SHA1)) {
echo 'openssl_verify failed.'; return false; } 
return true; }

function signMsg($array){
$msg = "";
$i = 0;
foreach ($array as $key => $val) { 
if($i == 0 ){
$msg = $msg."$key=$val";
}else {
$msg = $msg."&$key=$val";}
$i++;} 
return $msg; }

$respdata= array(
'responseCode' => $responseCode,
'merchantId' => merchantId,
'merchantTransactionId' => $merchantTransactionId,
'currencyCode' => "RMB",
'accountName' => $accountName,
'accountNum' => $accountNum,
'transactionAmount' => $transactionAmount,
'bankName' => $bankName,
'transactionResult' => $transactionResult,
'failedReason' => $failedReason'
'completeTime' => $completeTime
);

$respdataFinal = signMsg($respdata); 
$res = verify($respdataFinal, $signData,$pubkey); // Verify if the signData match, uses Quomo public key

Example Response to Quomo: (No Verification required)

{"received":"100",""merchantId":"1234567","merchantTransactionId":"778899887 05ac80"}

Notes:

For Java developers, we need to removed the header, footer, , and space from the pkcs8 private key outout in the console. For.NET and PHP developer, there is no need for the pkcs8 operation.

Appendix B

Response Code Table

Response CodeResponse Description
0Connection time out
4Server unavailable
100Request sent/Order status Successful
101Request sent/Order status Failed
102In progress
103Cancelled
10091001Insufficient amount in the account
10091002Account details can not be null
10091003Merchant ID can not be null
10091004Account name can not be null
10091005Account number can not be null
10091006Account city can not be null
10091007Amount should be between 1 to 49999 RMB
10091008Incorrect merchant transaction ID
10081002User account incorrect
10081003Hash value incorrect
10081004Merchant ID incorrect
10081005Service is under maintenance
10081006Format incorrect
10081007Transaction number incorrect
10081008Exceeds max allowed transaction times
10081009Merchant transaction number exist
10081012Transaction time incorrect

Appendix C

MYR Bank Name List

No.Bank IDBank Name
1CIMBCIMB Bank
2MBBMay Bank
3HLBHong Leong Bank
4PBBPublic Bank
5RHBRHB Bank
6AFB.MYAffin Bank Berhad
7ALB.MYAlliance Bank
8ARB.MYAmbank
9BIMB.MYBank Islam Malaysia
10BKR.MYBank Rakyat Malaysia Berhad
11BSN.MYBank Simpanan Nasional Berhad
12CITI.MYCITI Bank
13HSBC.MYHSBC Bank Malaysia Berhad
14OCBC.MYOCBC Bank (Malaysia) BHD
15SCB.MYStandard Chartered Bank
16UOB.MYUOB Bank
17HSBCHSBC Bank
18ABMBAlliance Bank
19SCBStandard Chartered
20OCBCOCBC Bank
21BSNBank Simpanan National
22AMBBAmBank
23UOBUOB Bank

THB Bank Name List

No.Bank IDBank Name
1BAYKrungsri Bank
2BBLBangkok Bank
3KBANKKasikorn Bank
4KTBKrung Thai Bank
5SCBSiam Commercial Bank
6TMBThai Military Bank
7GSB.THGovernment Savings Bank

VND Bank Name List

No.Bank IDBank Name
1VBARD.VNAgri Bank
2ACBAsia Commercial Bank
3ACB.QR.VNAsia Commercial Bank (QR Services)
4BIDVBIDV Bank
5BIDV.OR.VNBIDV Bank (QR Services)
6DABDongA Bank
7EXIMExim Bank
8MM.QR.VNMomo QR Payment (QR Services)
9SCMSacom Bank
10TCBTechcom Bank
11VCBVietcom Bank
12VCB.QR.VNVietcom Bank (QR Services)
13VTBVietin Bank
14ZL.H5.VNZalo H5 Payment (H5 service)
15ZL.QR.VNZalo QR Payment (QR service)

IDR Bank Name List

No.Bank IDBank Name
1BCA.IDBank Central Asia
2BNI.IDBank Negara Indoneisa
3MDR.IDBank Mandiri
4BRI.IDBank Rakyat
5BAG.VA.IDBank Artha Graha (VA)
6BNI.VA.IDBank Negara Indonesia (VA)
7MDR.VA.IDBank Mandiri (VA)
8BRI.VA.IDBank Rakyat Indonesia (VA)
9MBBI.VA.IDMaybank Indonesia (VA)
10BSS.VA.IDBank Sahabat Sampoerna (VA)
11BSM.VA.IDBank Sinarmas (VA)
12CIMN.VA.IDCIMB Niaga (VA)
13PTB.VA.IDBank Permata (VA)

Appendix D

Currency Code

CurrencyCode
Vietnamese đồng VND
Thai baht THB
Malaysia ringgit MYR
Indonesian rupiah IDR
Korean won KRW
Philippine pesoPHP
We use cookies to personalize content and ads, and to analyze our traffic and improve our service. By continuing to browse our website, you agree to our privacy policy.