Skip to main content

Payment Request

The following 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 request processing.

Step 1 : Library

The merchant shall include the PayMaster Merchant Plug-In (MPI) Java library, PayMaster.jar, into 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 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 paymentRequestEntity = new PayMasterEntity();

// Get all the parameter values from the user side and set into Payment Master Entity
paymentRequestEntity.set("PaymentID", "U01");
paymentRequestEntity.set("MerchRefNo", "merchant-refNo-0001");
paymentRequestEntity.set("CurrCode", "458");
paymentRequestEntity.set("TxnAmt", "1.00");
paymentRequestEntity.set("ExpTxnAmt", "2");
paymentRequestEntity.set("CountryCode", "MY");
paymentRequestEntity.set("MerchUserID", "guest-finexus");
paymentRequestEntity.set("TokenFlag", "Y");
paymentRequestEntity.set("PreAuthFlag", "Y");

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

// Redirect the message generated to Payment Master Gateway for settlement
res.sendRedirect("https://xxx.finexusgroup.com/upp/faces/upp/payment.xhtml?" + paymentMessage);

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 Payment Parameters for the fields supported by the PayMaster Merchant Plug-In (MPI).

Step 6 : Generate UPP Payment

Once all 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 Payment Response for security controls supported by PayMaster Merchant Plug-In (MPI).