Skip to main content

Payment Request

The following guideline is to provide explanation on how to apply the corresponding source code in merchant website and application in order to form the payment request parameters which the merchant can have in the redirect link and send to PayMaster for UPP payment processing.

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.MessageRequestBuilder.PaymentRequestMessageBuilder

Step 3 : Source Code

import com.PayMaster.Entities.PayMasterEntity;
import com.PayMaster.PropertiesReader.PropertiseReader;
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("PaymentID", "U01");
paymentRequestEntity("MerchRefNo", "merchant-refNo-0001");
paymentRequestEntity("CurrCode", "458");
paymentRequestEntity("TxnAmt", "1.00");
paymentRequestEntity("ExpTxnAmt", "2");
paymentRequestEntity("CountryCode", "MY");
paymentRequestEntity("TokenFlag", "N");
paymentRequestEntity("MerchUserID", "User ID");
paymentRequestEntity("PreAuthFlag", "N");

//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

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

Step 5 : Assign value into Payment Request Entity

Merchant to assign value into PayMaster Request Entity. Merchant code must include all the fields as stated in sample code as it’s mandatory.

  • The setter function is used to assign value and the function accepts two parameters – setter(parameter name, parameter value).
info

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

Step 6 : Generate UPP Payment

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

Step 7 : Send payment message to PayMaster Gateway

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

Step 8 (Optional) : Manage Your Own Payment Link

The merchant is required to maintain a table that includes the Payment Link used for the UPP Payment and the Secure Payment Link, along with their respective statues.

Merchant's Reference NoFinexus' Payment LinkMerchant's Payment LinkStatus
MRN202405260000001https://xxx/upp/faces/upp/payment.xhtml?...https://xxx/MRN202405260000001Clicked
MRN202405260000002https://xxx/upp/faces/upp/payment.xhtml?...https://xxx/MRN202405260000002Not Clicked

The Secure Payment Link is shared through messaging and social platforms such as WhatsApp, Telegram, as well as email, among others.

info

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