Skip to main content

Completion Request

This guideline explains how to apply the corresponding source codes to form the mandatory payment request parameters in the redirect link and send them to PayMaster for payment completion 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 UPP payments, the merchant should import the following into their code:

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

Step 3 : Source Code

import com.PayMaster.Entities.PayMasterEntity;
import com.PayMaster.PropertiesReader.PropertiesReader;
import com.PayMaster.MessageRequestBuilder.PaymentRequestMessageBuilder;

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

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

// Get all the parameter values from the user side and set them into the Payment Master Entity
paymentRequestEntity.setter("PaymentID", "C13");
paymentRequestEntity.setter("MerchRefNo", "merchant-refNo-0001");
paymentRequestEntity.setter("CurrCode", "458");
paymentRequestEntity.setter("TxnAmt", "1.00");
paymentRequestEntity.setter("ExpTxnAmt", "2");
paymentRequestEntity.setter("CardNo", "8853010000095323");

// Call Payment Master Payment Request Message Builder to generate the message
PaymentRequestMessageBuilder messageBuilder = new PaymentRequestMessageBuilder();
String paymentMessage = messageBuilder.buildPaymentRequestMessage(paymentRequestEntity, propertiesReader);

// POST request to Payment Master Gateway for pre-authorization payment
String initialUrl = "https://xxx.finexusgroup.com/upp/faces/preauthcomplete.xhtml?" + paymentMessage;
HttpURLConnection connection = null;
URL url = new URL(initialUrl);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
in.close();
String finalUrl = connection.getURL().toString();

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 Payment 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.

  • The setter function is used to assign values, and it accepts two parameters: setter(parameter name, parameter value).

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

Step 6 : Generate UPP Payment

Once all the mandatory values are assigned, the merchant calls the Payment Request Message Builder to generate the UPP Payment – paymentMessage.

Step 7 : Send the Payment Message to the PayMaster Gateway

The paymentMessage will be used to send to the PayMaster Gateway for the UPP Payment.

Refer to Pre-Auth Completion Response for security controls supported by PayMaster Merchant Plug-In (MPI).