Skip to main content

Completion Response

The following guidelines explain how to use the source code to retrieve payment completion response parameters from the response message returned by PayMaster.

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 UPP payments, the merchant should import the following into their 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.PropertiesReader;
import com.PayMaster.MessageResponseBuilder.PaymentResponseMessageBuilder;

// Declare variable for PayMaster Properties - 1st Parameter = File Path, 2nd Parameter = File Name
PropertiesReader propertiesReader = new PropertiesReader("./PayMasterProperties/", "CCPayment.properties");

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

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

// Call Payment Response Message Builder to set the value
PaymentResponseMessageBuilder paymentResponseMessageBuilder = new PaymentResponseMessageBuilder();
paymentResponseMessageBuilder.buildCardPaymentResponseMessage(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");
// TODO: Add additional processing here
}

Step 4 : Indicate PayMaster Properties File Location

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

Step 5 : Indicate PayMaster Properties File Location Using Setter

Merchant must set the location of the PayMaster Properties File using the setter method setter(“ResponseMessage”,”<response message returned by PayMaster Gateway>”).

Step 6 : Assign Values to the PayMaster Response Entity

The merchant should call the UPP Payment Response Message Builder to process the response message and assign the values to the PayMaster Response Entity.

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

Step 7 : Retrieve Values from PayMaster Response Entity

The merchant can retrieve values from the PayMaster Response Entity. Use the getter function to retrieve values; this function only accepts one parameter: getter(parameter name).

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