Skip to main content

Payment Query

This guideline provides an explanation of how to apply the corresponding source code in the merchant's website or application to generate the mandatory payment request parameters. These parameters should be included in the redirect link and sent to PayMaster for QR payment query processing.

Step 1 : Library

The merchant must include the PayMaster Merchant Plug-In (MPI) Java library, PayMaster.jar, in the merchant application.

Step 2 : Import

For QR payment query, the merchant should import the following into their code:

  • com.PayMaster.Entities.PayMasterEntity
  • com.PayMaster.PropertiesReader.PropertiesReader
  • com.PayMaster.MessageRequestBuilder.WebservicePaymentRequestMessageBuilder

Step 3 : Source Code

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");

Step 4 : Indicate PayMaster Properties File Location

The merchant must specify the location of the PayMaster Properties File using PropertiesReader.

Step 5: Assign Values to the PayMaster Request Entity

The merchant should assign values to the PayMaster Request Entity. The merchant's code must include all the fields as stated in the sample code, as they are mandatory.

  • Use the setter function to assign values, it takes two parameters: setter(parameter name, parameter value).

Step 6 : Call the Web Service Payment Request Message Builder

After assigning all mandatory values, call the WebservicePaymentRequestMessageBuilder with the buildUPPQueryRequestMessage function.

  • This will generate and submit the Payment Query Request message to the PayMaster Gateway.
  • The query response from PayMaster Gateway will be processed and assigned back to the PayMaster Request Entity.

Step 7 : Retrieve Values from PayMaster Request Entity

You can use the same PayMaster Request Entity to retrieve the query response information.

  • Use the getter function to retrieve values; it takes one parameter: getter(parameter name).

Refer to Query Parameters for the fields supported by the PayMaster Merchant Plug-In (MPI).