付款查询
本指南解释了如何在商户网站或应用程序中应用相应的源代码来生成强制支付请求参数。这些参数应包含在重定向链接中并发送至 PayMaster 以进行二维码支付查询处理。
- Java
- .Net
- PHP
- Python
- Node.js
第 1 步:图书馆
商户必须在商户应用程序中包含 PayMaster 商户插件 (MPI) Java 库 PayMaster.jar。
第 2 步:导入
对于二维码支付查询,商户应将以下内容导入到其代码中:
com.PayMaster.Entities.PayMasterEntity
com.PayMaster.PropertiesReader.PropertiesReader
com.PayMaster.MessageRequestBuilder.WebservicePaymentRequestMessageBuilder
第 3 步:源代码
import com.PayMaster.Entities.PayMasterEntity;
import com.PayMaster.PropertiesReader.PropertiesReader;
import com.PayMaster.MessageRequestBuilder.WebservicePaymentRequestMessageBuilder;
// Declare variable for Payment Master Properties
PropertiesReader propertiesReader = new PropertiesReader("./PayMasterProperties/", "UPPPayment.properties");
// Declare variable for Payment Master Entity
PayMasterEntity paymentRequestEntity = new PayMasterEntity();
// Set parameters in Payment Master Entity
paymentRequestEntity.setter("PaymentID", "U02");
paymentRequestEntity.setter("MerchantID", "000010000099939");
paymentRequestEntity.setter("ServiceID", "FNX");
paymentRequestEntity.setter("MerchRefNo", "MYB2023030315435025LL");
paymentRequestEntity.setter("QueryRespURL", "https://XXX.XXXXX.XXX/query.jsp");
// Call Payment Master Payment Request Message Builder to generate the message
WebservicePaymentRequestMessageBuilder messageBuilder = new WebservicePaymentRequestMessageBuilder();
messageBuilder.buildUPPQueryRequestMessage(paymentRequestEntity, propertiesReader);
// Retrieve values from Payment Master Entity
String MerchantID = paymentRequestEntity.getter("MerchantID");
String CardNo = paymentRequestEntity.getter("CardNo");
String TxnDtTm = paymentRequestEntity.getter("TxnDtTm");
String TxnAmt = paymentRequestEntity.getter("TxnAmt");
String TxnStatus = paymentRequestEntity.getter("TxnStatus");
String CurrCode = paymentRequestEntity.getter("CurrCode");
String AuthIDRespCode = paymentRequestEntity.getter("AuthIDRespCode");
String ExpTxnAmt = paymentRequestEntity.getter("ExpTxnAmt");
String RetrievalRefNo = paymentRequestEntity.getter("RetrievalRefNo");
String OrgRespCode = paymentRequestEntity.getter("OrgRespCode");
String OrigTxnAmt = paymentRequestEntity.getter("OrigTxnAmt");
String OrigCurrCode = paymentRequestEntity.getter("OrigCurrCode");
String TxnChannel = paymentRequestEntity.getter("TxnChannel");
String FICode = paymentRequestEntity.getter("FICode");
String PymtGwRefNo = paymentRequestEntity.getter("PymtGwRefNo");
String TxnStatDetCde = paymentRequestEntity.getter("TxnStatDetCde");
String TxnStatMsg = paymentRequestEntity.getter("TxnStatMsg");
String ServiceID = paymentRequestEntity.getter("ServiceID");
String MerchHostID = paymentRequestEntity.getter("MerchHostID");
String MerchSessionID = paymentRequestEntity.getter("MerchSessionID");
String MerchRefNo = paymentRequestEntity.getter("MerchRefNo");
String OrderRefNo = paymentRequestEntity.getter("OrderRefNo");
String QueryStatus = paymentRequestEntity.getter("QueryStatus");
String FPXRefNo = paymentRequestEntity.getter("FPXRefNo");
String UppPymtMode = paymentRequestEntity.getter("UppPymtMode");
String OrigRespCode = paymentRequestEntity.getter("OrigRespCode");
String ExporigTxnAmt = paymentRequestEntity.getter("ExporigTxnAmt");
第 4 步:指示 PayMaster 属性文件位置
商家必须使用PropertiesReader
指定 PayMaster 属性文件的位置。
第 5 步:为 PayMaster 请求实体分配值
商家应向 PayMaster 请求实体分配值。商家代码必须包含示例代码中所述的所有字段,因为它们是强制性的。
- 使用setter函数赋值,它需要两个参数:
setter(参数名,参数值)
。
第 6 步: 调用 Web 服务支付请求消息生成器
分配所有必需值后,使用buildUPPQueryRequestMessage
函数调用WebservicePaymentRequestMessageBuilder
。
- 这将生成付款查询请求消息并将其提交到 PayMaster 网关。
- 来自 PayMaster 网关的查询响应将被处理并分配回 PayMaster 请求实体。
第 7 步: 从 PayMaster 请求实体检索值
您可以使用相同的 PayMaster 请求实体来检索查询响应信息。
- 使用getter函数来检索值;它需要一个参数:
getter(参数名称)
。
PayMaster商户插件(MPI)支持的字段请参考 查询参数。
第 1 步:图书馆
商户必须在商户应用程序中包含 PayMaster 商户插件 (MPI) .NET 库 PayMaster.dll。
第 2 步:命名空间
对于二维码支付查询,商户应在商户代码中包含以下命名空间:
using com.PayMaster.Entities
using com.PayMaster.Properties
using com.PayMaster.MessageRequestBuilder
第 3 步:源代码
using com.PayMaster.Entities;
using com.PayMaster.Properties;
using com.PayMaster.MessageRequestBuilder;
// Declare variable for Payment Master Properties
PropertiesReader propertiesReader = new PropertiesReader("./PayMasterProperties/", "UPPPayment.properties");
// Declare variable for Payment Master Entity
PayMasterEntity qrPaymentRequestEntity = new PayMasterEntity();
// Set parameters in Payment Master Entity
qrPaymentRequestEntity.setter("PaymentID", "U02");
qrPaymentRequestEntity.setter("MerchantID", "000010000099939");
qrPaymentRequestEntity.setter("ServiceID", "FNX");
qrPaymentRequestEntity.setter("MerchRefNo", "MYB2023030315435025LL");
qrPaymentRequestEntity.setter("QueryRespURL", "https://XXX.XXXXX.XXX/query.jsp");
// Call Payment Master Web Service Payment Request Message Builder for QR query request
WebServicePaymentRequestMessageBuilder qrMessageBuilder = new WebServicePaymentRequestMessageBuilder();
qrMessageBuilder.builderUPPPaymentQueryRequest(qrPaymentRequestEntity, propertiesReader);
// Retrieve values from Payment Master Entity
string MerchantID = qrPaymentRequestEntity.getter("MerchantID");
string CardNo = qrPaymentRequestEntity.getter("CardNo");
string TxnDtTm = qrPaymentRequestEntity.getter("TxnDtTm");
string TxnAmt = qrPaymentRequestEntity.getter("TxnAmt");
string TxnStatus = qrPaymentRequestEntity.getter("TxnStatus");
string CurrCode = qrPaymentRequestEntity.getter("CurrCode");
string AuthIDRespCode = qrPaymentRequestEntity.getter("AuthIDRespCode");
string ExpTxnAmt = qrPaymentRequestEntity.getter("ExpTxnAmt");
string RetrievalRefNo = qrPaymentRequestEntity.getter("RetrievalRefNo");
string OrgRespCode = qrPaymentRequestEntity.getter("OrgRespCode");
string OrigTxnAmt = qrPaymentRequestEntity.getter("OrigTxnAmt");
string OrigCurrCode = qrPaymentRequestEntity.getter("OrigCurrCode");
string TxnChannel = qrPaymentRequestEntity.getter("TxnChannel");
string FICode = qrPaymentRequestEntity.getter("FICode");
string PymtGwRefNo = qrPaymentRequestEntity.getter("PymtGwRefNo");
string TxnStatDetCde = qrPaymentRequestEntity.getter("TxnStatDetCde");
string TxnStatMsg = qrPaymentRequestEntity.getter("TxnStatMsg");
string ServiceID = qrPaymentRequestEntity.getter("ServiceID");
string MerchHostID = qrPaymentRequestEntity.getter("MerchHostID");
string MerchSessionID = qrPaymentRequestEntity.getter("MerchSessionID");
string MerchRefNo = qrPaymentRequestEntity.getter("MerchRefNo");
string OrderRefNo = qrPaymentRequestEntity.getter("OrderRefNo");
string QueryStatus = qrPaymentRequestEntity.getter("QueryStatus");
string FPXRefNo = qrPaymentRequestEntity.getter("FPXRefNo");
string UppPymtMode = qrPaymentRequestEntity.getter("UppPymtMode");
string OrigRespCode = qrPaymentRequestEntity.getter("OrigRespCode");
string ExporigTxnAmt = qrPaymentRequestEntity.getter("ExporigTxnAmt");
第 4 步:指示 PayMaster 属性文件位置
商家必须使用PropertiesReader
指定 PayMaster 属性文件的位置。
第 5 步: 为付款请求实体分配值
商家应向 PayMaster 请求实体分配值。商家代码必须包含示例代码中所述的所有字段,因为它们是强制性的。
- 使用setter函数来赋值,它接受两个参数:
setter(参数名,参数值)
。
第 6 步: 调用 Web 服务付款请求
分配所有必需值后,使用“builderUPPPaymentQueryRequest”函数调用WebServicePaymentRequestMessageBuilder
。
- 这将生成付款查询请求消息并将其提交到 PayMaster 网关。
- 从 PayMaster 网关收到的查询响应将被处理并 分配回 PayMaster 请求实体。
第 7 步: 从 PayMaster 请求实体检索值
使用相同的 PayMaster 请求实体来检索查询响应信息。
- 使用getter函数来检索值;它接受一个参数:
getter(参数名称)
。
PayMaster商户插件(MPI)支持的字段请参考 查询参数。
第 1 步:图书馆
商户必须在商户应用程序中包含 PayMaster 商户插件 (MPI) PHP 库 PayMaster.phar。
第 2 步:商户代码
对于二维码支付查询,商户应将以下内容导入到其代码中:
PropertiesReader
– 读取属性文件。PayMasterEntity
– 为 PayMaster QR 支付查询分配所有可接受的值。WebServicePaymentRequestMessageBuilder
– 生成PayMaster二维码支付查询请求消息。
第 3 步:源代码
<?php
use com\PayMaster\Entities\PayMasterEntity;
use com\PayMaster\PropertiesReader\PropertiesReader;
use com\PayMaster\MessageRequestBuilder\WebServicePaymentRequestMessageBuilder;
use com\PayMaster\Import\ImportFile;
// Locate the absolute path of PayMaster.phar
$basePath = 'phar://<PayMaster.phar path>/';
include_once $basePath.'com/PayMaster/Import/ImportFile.php';
$import = new ImportFile();
$import->includeFile($basePath);
// Declare variable for Payment Master Properties
$propertiesReader = new PropertiesReader();
$propertiesReader->PropertiesReader("./PayMasterProperties/", "UPPPayment.ini");
// Declare variable for Payment Master Entity
$paymentRequestEntity = new PayMasterEntity();
// Set parameters in Payment Master Entity
$paymentRequestEntity->setter("PaymentID", "U02");
$paymentRequestEntity->setter("MerchantID", "000010000099939");
$paymentRequestEntity->setter("ServiceID", "FNX");
$paymentRequestEntity->setter("MerchRefNo", "MYB2023030315435025LL");
$paymentRequestEntity->setter("QueryRespURL", "https://XXX.XXXXX.XXX/query.jsp");
// Call Payment Master Payment Response Message Builder to set value
$webServicePaymentRequestMessageBuilder = new WebServicePaymentRequestMessageBuilder();
$webServicePaymentRequestMessageBuilder->buildUPPQueryRequestMessage($paymentRequestEntity, $propertiesReader);
// Retrieve values from Payment Master Entity
$MerchantID = $paymentRequestEntity->getter("MerchantID");
$CardNo = $paymentRequestEntity->getter("CardNo");
$TxnDtTm = $paymentRequestEntity->getter("TxnDtTm");
$TxnAmt = $paymentRequestEntity->getter("TxnAmt");
$TxnStatus = $paymentRequestEntity->getter("TxnStatus");
$CurrCode = $paymentRequestEntity->getter("CurrCode");
$AuthIDRespCode = $paymentRequestEntity->getter("AuthIDRespCode");
$ExpTxnAmt = $paymentRequestEntity->getter("ExpTxnAmt");
$RetrievalRefNo = $paymentRequestEntity->getter("RetrievalRefNo");
$OrgRespCode = $paymentRequestEntity->getter("OrgRespCode");
$OrigTxnAmt = $paymentRequestEntity->getter("OrigTxnAmt");
$OrigCurrCode = $paymentRequestEntity->getter("OrigCurrCode");
$TxnChannel = $paymentRequestEntity->getter("TxnChannel");
$FICode = $paymentRequestEntity->getter("FICode");
$PymtGwRefNo = $paymentRequestEntity->getter("PymtGwRefNo");
$TxnStatDetCde = $paymentRequestEntity->getter("TxnStatDetCde");
$TxnStatMsg = $paymentRequestEntity->getter("TxnStatMsg");
$ServiceID = $paymentRequestEntity->getter("ServiceID");
$MerchHostID = $paymentRequestEntity->getter("MerchHostID");
$MerchSessionID = $paymentRequestEntity->getter("MerchSessionID");
$MerchRefNo = $paymentRequestEntity->getter("MerchRefNo");
$OrderRefNo = $paymentRequestEntity->getter("OrderRefNo");
$QueryStatus = $paymentRequestEntity->getter("QueryStatus");
$FPXRefNo = $paymentRequestEntity->getter("FPXRefNo");
$UppPymtMode = $paymentRequestEntity->getter("UppPymtMode");
$OrigRespCode = $paymentRequestEntity->getter("OrigRespCode");
$ExporigTxnAmt = $paymentRequestEntity->getter("ExporigTxnAmt");
?>
第 4 步:找到 PayMaster.phar 的绝对路径
商户必须找到 PayMaster.phar 的绝对路径,并将其设置为商户源代码中的 $basePath
(上例中的第 7 行)。
例子:$basePath=’phar://<absolute path of PayMaster.phar>/'
第 5 步:将值分配给 PayMaster 请求实体
商家应向 PayMaster 请求实体分配值。商家代码必须包含示例代码中所述的所有字段,因为它们是强制性的。
- 使用setter函数来赋值,它接受两个参数:
setter(参数名,参数值)
。
第 6 步: 调用 Web 服务付款请求
分配所有必需值后,使用buildUPPQueryRequestMessage
函数调用WebServicePaymentRequestMessageBuilder
。
- 这将生成付款查询请求消息并将其提交到 PayMaster 网关。
- 来自 PayMaster 网关的查询响应将被处理并分配回 PayMaster 请求实体。
第 7 步: 从 PayMaster 请求实体检索值
使用相同的 PayMaster 请求实体来检索查询响应信息。
- 使用getter函数来检索值;它接受一个参数:
getter(参数名称)
。
PayMaster商户插件(MPI)支持的字段请参考 查询参数。
第 1 步:打包
商户必须在商户应用程序中设置并包含 PayMaster 商户插件 (MPI) Python 包。
第 2 步:导入
对于二维码支付查询,商户应在其代码中包含以下内容:
PropertiesReader
– 读取属性文件。PayMasterEntity
– 为 PayMaster QR 支付查询分配所有可接受的值。WebServicePaymentRequestMessageBuilder
– 生成PayMaster二维码支付查询请求消息。
第 3 步:源代码
from com.PayMaster.Entities.PayMasterEntity import PayMasterEntity
from com.PayMaster.PropertiesReader.PropertiesReader import PropertiesReader
from com.PayMaster.MessageRequestBuilder.WebServicePaymentRequestMessageBuilder import WebServicePaymentRequestMessageBuilder
# Declare variable for Payment Master Properties
propertiesReader = PropertiesReader("PayMasterProperties/", "UPPPayment.properties")
# Declare variable for Payment Master Entity
qrPaymentRequestEntity = PayMasterEntity()
# Set parameters in Payment Master Entity
qrPaymentRequestEntity.setter("PaymentID", "U02")
qrPaymentRequestEntity.setter("MerchantID", "000010000099939")
qrPaymentRequestEntity.setter("ServiceID", "FNX")
qrPaymentRequestEntity.setter("MerchRefNo", "MYB2023030315435025LL")
qrPaymentRequestEntity.setter("QueryRespURL", "https://XXX.XXXXX.XXX/query.jsp")
# Call Payment Master Web Service Payment Request Message Builder for QR query request
qrMessageBuilder = WebServicePaymentRequestMessageBuilder()
qrMessageBuilder.buildUPPQueryRequestMessage(qrPaymentRequestEntity, propertiesReader)
# Retrieve values from Payment Master Entity
MerchantID = qrPaymentRequestEntity.getter("MerchantID")
CardNo = qrPaymentRequestEntity.getter("CardNo")
TxnDtTm = qrPaymentRequestEntity.getter("TxnDtTm")
TxnAmt = qrPaymentRequestEntity.getter("TxnAmt")
TxnStatus = qrPaymentRequestEntity.getter("TxnStatus")
CurrCode = qrPaymentRequestEntity.getter("CurrCode")
AuthIDRespCode = qrPaymentRequestEntity.getter("AuthIDRespCode")
ExpTxnAmt = qrPaymentRequestEntity.getter("ExpTxnAmt")
RetrievalRefNo = qrPaymentRequestEntity.getter("RetrievalRefNo")
OrgRespCode = qrPaymentRequestEntity.getter("OrgRespCode")
OrigTxnAmt = qrPaymentRequestEntity.getter("OrigTxnAmt")
OrigCurrCode = qrPaymentRequestEntity.getter("OrigCurrCode")
TxnChannel = qrPaymentRequestEntity.getter("TxnChannel")
FICode = qrPaymentRequestEntity.getter("FICode")
PymtGwRefNo = qrPaymentRequestEntity.getter("PymtGwRefNo")
TxnStatDetCde = qrPaymentRequestEntity.getter("TxnStatDetCde")
TxnStatMsg = qrPaymentRequestEntity.getter("TxnStatMsg")
ServiceID = qrPaymentRequestEntity.getter("ServiceID")
MerchHostID = qrPaymentRequestEntity.getter("MerchHostID")
MerchSessionID = qrPaymentRequestEntity.getter("MerchSessionID")
MerchRefNo = qrPaymentRequestEntity.getter("MerchRefNo")
OrderRefNo = qrPaymentRequestEntity.getter("OrderRefNo")
QueryStatus = qrPaymentRequestEntity.getter("QueryStatus")
FPXRefNo = qrPaymentRequestEntity.getter("FPXRefNo")
UppPymtMode = qrPaymentRequestEntity.getter("UppPymtMode")
OrigRespCode = qrPaymentRequestEntity.getter("OrigRespCode")
ExporigTxnAmt = qrPaymentRequestEntity.getter("ExporigTxnAmt")
第 4 步:指示 PayMaster 属性文件位置
商家必须使用PropertiesReader
指定 PayMaster 属性文件的位置。
第 5 步:将值分配给 PayMaster 请求实体
商家应向 PayMaster 请求实体分配值。商家代码必须包含示例代码中所述的所有字段,因为它们是强制性的。
- 使用setter函数来赋值,它接受两个参数:
setter(参数名,参数值)
。
第 6 步: 调用 Web 服务付款请求
分配所有必需值后,使用buildUPPQueryRequestMessage
函数调用WebServicePaymentRequestMessageBuilder
。
- 这将生成付款查询请求消息并将其提交到 PayMaster 网关。
- 来自 PayMaster 网关的查询响应将被处理并分配回 PayMaster 请求实体。
第 7 步: 从 PayMaster 请求实体检索值
使用相同的 PayMaster 请求实体来检索查询响应信息。
- 使用getter函数来检索值;它接受一个参数:
getter(参数名称)
。
PayMaster商户插件(MPI)支持的字段请参考 查询参数。
第 1 步:图书馆
商户应设置 PayMaster 商户插件 (MPI) Node.js 库并将其包含到商户应用程序中。
第 2 步源代码
var paymaster = require('./js/PayMaster.min.js');
module.exports = function (app) {
app.get('/QRQuery', (req, res) => {
// Set parameters for QR Payment Query
paymaster.setter('PaymentID', 'U02');
paymaster.setter('MerchantID', '000010000099939');
paymaster.setter('ServiceID', 'FNX');
paymaster.setter('MerchRefNo', 'MYB2023030315435025LL');
paymaster.setter('QueryRespURL', 'https://XXX.XXXXX.XXX/query.jsp');
// Submit the payment request
paymaster.MERCH_QRPaymentQueryRequest(paymaster.PaymasterRequestEntity, paymaster.propDetails, function(err, response, result) {
if (err) {
return res.status(500).send(err);
}
if (response) {
// Retrieve values from the response
var MerchantID = paymaster.getter('MerchantID');
var CardNo = paymaster.getter('CardNo');
var TxnDtTm = paymaster.getter('TxnDtTm');
var TxnAmt = paymaster.getter('TxnAmt');
var TxnStatus = paymaster.getter('TxnStatus');
var CurrCode = paymaster.getter('CurrCode');
var AuthIDRespCode = paymaster.getter('AuthIDRespCode');
var ExpTxnAmt = paymaster.getter('ExpTxnAmt');
var RetrievalRefNo = paymaster.getter('RetrievalRefNo');
var OrgRespCode = paymaster.getter('OrgRespCode');
var OrigTxnAmt = paymaster.getter('OrigTxnAmt');
var OrigCurrCode = paymaster.getter('OrigCurrCode');
var TxnChannel = paymaster.getter('TxnChannel');
var FICode = paymaster.getter('FICode');
var PymtGwRefNo = paymaster.getter('PymtGwRefNo');
var TxnStatDetCde = paymaster.getter('TxnStatDetCde');
var TxnStatMsg = paymaster.getter('TxnStatMsg');
var ServiceID = paymaster.getter('ServiceID');
var MerchHostID = paymaster.getter('MerchHostID');
var MerchSessionID = paymaster.getter('MerchSessionID');
var MerchRefNo = paymaster.getter('MerchRefNo');
var OrderRefNo = paymaster.getter('OrderRefNo');
var QueryStatus = paymaster.getter('QueryStatus');
var FPXRefNo = paymaster.getter('FPXRefNo');
var UppPymtMode = paymaster.getter('UppPymtMode');
var OrigRespCode = paymaster.getter('OrigRespCode');
var ExporigTxnAmt = paymaster.getter('ExporigTxnAmt');
// Send response to the client
res.json({
MerchantID, CardNo, TxnDtTm, TxnAmt, TxnStatus, CurrCode,
AuthIDRespCode, ExpTxnAmt, RetrievalRefNo, OrgRespCode,
OrigTxnAmt, OrigCurrCode, TxnChannel, FICode, PymtGwRefNo,
TxnStatDetCde, TxnStatMsg, ServiceID, MerchHostID,
MerchSessionID, MerchRefNo, OrderRefNo, QueryStatus,
FPXRefNo, UppPymtMode, OrigRespCode, ExporigTxnAmt
});
}
});
});
}
第 3 步:指示 PayMaster 属性文件位置
商户使用PropertiesReader
启动 PayMaster 属性文件所在的位置。
第 4 步:为所有字段分配值
Merchant code must include and assign value to all the fields as stated in sample code as it’s mandatory.
- 使用setter函数来赋值,它接受两个参数:
setter(参数名,参数值)
。
第 5 步:向 PayMaster 提交付款请求
使用 MERCH_QRPaymentQueryRequest()
函数生成付款请求消息并将其提交给 PayMaster。
第 6 步: Handle PayMaster 返回的响应参数
PayMaster 返回的响应参数将由 PayMaster MPI NodeJS 发送消息。
第 7 步: 检索支付查询响应参数的值
使用 getter 函数从支付查询响应中检索值:getter(参数名称)
。
PayMaster商户插件(MPI)支持的字段请参考 查询参数。