Skip to main content

Payment Request

This guideline provides instructions on how to apply the corresponding source code to a merchant website and application to form the payment request parameters. These parameters are included in the redirect link sent to PayMaster for UPP payment processing.

Step 1 : Library

Include the PayMaster Merchant Plug-In (MPI) Java library PayMaster.jar in your application.

Step 2 : Import

For UPP payments, import the following into your 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 PayMaster Properties - 1st Parameter = File Path, 2nd Parameter = File name
PropertiesReader propertiesReader = new PropertiesReader("./PayMasterProperties/", "UPPPayment.properties");

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

// Get all the parameter values from the user side and set into PayMaster Entity
paymentRequestEntity.setParameter("PaymentID", "U01");
paymentRequestEntity.setParameter("MerchRefNo", "merchant-refNo-0001");
paymentRequestEntity.setParameter("CurrCode", "458");
paymentRequestEntity.setParameter("TxnAmt", "1.00");
paymentRequestEntity.setParameter("ExpTxnAmt", "2");
paymentRequestEntity.setParameter("CountryCode", "MY");
paymentRequestEntity.setParameter("TokenFlag", "N");
paymentRequestEntity.setParameter("MerchUserID", "User ID");
paymentRequestEntity.setParameter("PreAuthFlag", "N");

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

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

Step 4 : Indicate PayMaster Properties File Location

Indicate where the PayMaster Properties File is located using PropertiesReader.

Step 5 : Assign Values to the Payment Request Entity

Assign values into the PayMaster Request Entity. Include all the fields as they are mandatory. Use the setter function setter(parameter name, parameter value) to assign values.

Refer to UPP Payment Parameters for a complete list of fields supported by the PayMaster Merchant Plug-In (MPI). This will ensure all necessary parameters are included and correctly formatted in your payment request.

Step 6 : Generate UPP Payment

Once all mandatory values are assigned, call the PaymentRequestMessageBuilder to generate the UPP Payment message (paymentMessage).

Step 7 : Send the Payment Message to the PayMaster Gateway

Use the paymentMessage to redirect to the PayMaster Gateway for the UPP Payment.

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