Skip to main content

Payment Response

The following guideline is to explain how to apply the corresponding source codes to retrieve the payment response parameters from the response message returned by PayMaster.

Step 1 : Library

Merchant shall include PayMaster Merchant Plug-In (MPI) Java library – PayMaster.jar into merchant application.

Step 2 : Import

For UPP payment, merchant shall import below into merchant code:

  • com.PayMaster.Entities.PayMasterEntity
  • com.PayMaster.PropertiesReader.PropertiesReader
  • com.PayMaster.MessageResponseBuilder.PaymentResponseMessageBuilder

Step 3 : Source Code

import com.PayMaster.Entities.PayMasterEntity;
import com.PayMaster.PropertiesReader.PropertiseReader;
import com.PayMaster.MessageResponseBuilder.PaymentResponseMessageBuilder;

.....

//Declare variable for Payment Master Properties - 1st Parameter = File Path , 2nd Parameter = File name
PropertiesReader propertiesReader = new PropertiesReader("./PayMasterProperties/","UPPPayment.properties");

//Declare variable for Payment Master Entity
PayMasterEntity paymentResponseEntity = new PayMasterEntity();

//Get response message from PayMaster and set into Payment Master Entity
paymentResponseEntity.setter("ResponseMessage", responseMessage);

//Call Payment Master Payment Response Message Builder to set value
PaymentResponseMessageBuilder paymentResponseMessageBuilder = new PaymentResponseMessageBuilder();
paymentResponseMessageBuilder.buildUPPPaymentResponseMessage(paymentResponseEntity, propertiesReader);

if(paymentResponseEntity.getter("TxnStatDetCde").equals("0000")){
String MerchantID = paymentResponseEntity.getter("MerchantID");
String MerchRefNo = paymentResponseEntity.getter("MerchRefNo");
String TxnStatus = paymentResponseEntity.getter("TxnStatus");
String SHAlgorithmType = paymentResponseEntity.getter("SHAlgorithmType");
String SHValue = paymentResponseEntity.getter("SHValue");
//to do ...
}

.....

Step 4 : Indicate PayMaster Properties File location using PropertiesReader

Merchant must indicate where the PayMaster Properties File located using PropertiesReader.

Step 5 : Indicate PayMaster Properties File location using setter

Merchant must indicate where the PayMaster Properties File located using setter(“ResponseMessage”,”<response message returned by PayMaster Gateway>”).

Step 6 : Assign value into PayMaster Response Entity

Merchant call to UPP Payment Response Message Builder to message the response message and assign the values into PayMaster Response Entity.

info

Refer to Pre-Auth Payment Parameters for fields supported by PayMaster Merchant Plug-In (MPI).

Step 7 : Retrieve value from PayMaster Response Entity

Merchant can retrieve the values from PayMaster Response Entity.

  • The getter function is used to retrieve value and the function only accepts one parameter – getter(parameter name).
note

Make sure that the value of TxnStatDetCde is not equal to 5015, as this represents an invalid secure hash value.