Bank Listing Response
The following guideline explains how to apply the corresponding source code to retrieve Bank Listing response parameters from the message returned by PayMaster.
- Java
- .Net
- PHP
- Python
- Node.js
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 Bank Listing, the merchant must import the following into the merchant code:
com.PayMaster.Entities.PayMasterEntitycom.PayMaster.PropertiesReader.PropertiesReadercom.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 Payment Master Properties - 1st Parameter = File Path, 2nd Parameter = File Name
PropertiesReader propertiesReader = new PropertiesReader("./PayMasterProperties/", "BankListing.properties");
// Declare variable for Payment Master Entity
PayMasterEntity paymentResponseEntity = new PayMasterEntity();
// Get response message from PayMaster and set it into Payment Master Entity
paymentResponseEntity.setter("ResponseMessage", responseMessage);
paymentResponseEntity.setter("MerchantID", "000010000099939");
PaymentResponseMessageBuilder paymentResponseMessageBuilder = new PaymentResponseMessageBuilder();
paymentResponseMessageBuilder.buildBankListingResponseMessage(paymentResponseEntity, propertiesReader);
if (paymentResponseEntity.getter("TxnStatDetCde").equals("0000")) {
String merchRefNo = paymentResponseEntity.getter("MerchRefNo");
String txnStatus = paymentResponseEntity.getter("TxnStatus");
String queryStatus = paymentResponseEntity.getter("QueryStatus");
String txnStatMsg = paymentResponseEntity.getter("TxnStatMsg");
String merchantID = paymentResponseEntity.getter("MerchantID");
String cardNo = paymentResponseEntity.getter("CardNo");
String txnDtTm = paymentResponseEntity.getter("TxnDtTm");
String txnAmt = paymentResponseEntity.getter("TxnAmt");
String currCode = paymentResponseEntity.getter("CurrCode");
String versionNo = paymentResponseEntity.getter("VersionNo");
String retrievalRefNo = paymentResponseEntity.getter("RetrievalRefNo");
String uppPymtMode = paymentResponseEntity.getter("UppPymtMode");
String succRespURL = paymentResponseEntity.getter("SuccRespURL");
String txnStatDetCde = paymentResponseEntity.getter("TxnStatDetCde");
String preAuthFlag = paymentResponseEntity.getter("PreAuthFlag");
String pymtGwRefNo = paymentResponseEntity.getter("PymtGwRefNo");
// To do ...
}
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
The merchant must indicate where the PayMaster Properties File is located using the setter function setter("ResponseMessage","<response message returned by PayMaster Gateway>").
The setter function assigns a value and accepts two parameters: setter(parameter name, parameter value).
Step 6 : Assign Values to the PayMaster Response Entity
The merchant should call the Bank Listing Response Message Builder to process the response message and assign the values to the PayMaster Response Entity.
Refer to Bank Listing 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 using the getter function, which accepts only one parameter: getter(parameter name).
Ensure that the value of TxnStatDetCde is not equal to 5015, as this represents an invalid secure hash value.
Step 1 : Library
The merchant must include the PayMaster Merchant Plug-In (MPI) .NET library, PayMaster.dll, in the merchant application.
Step 2 : Namespace
For Bank Listing, the merchant shall include the following namespaces in the merchant code:
using com.PayMaster.Entitiesusing com.PayMaster.Propertiesusing com.PayMaster.MessageResponseBuilder
Step 3 : Source Code
using com.PayMaster.Entities;
using com.PayMaster.Properties;
using com.PayMaster.MessageResponseBuilder;
// Declare variable for Payment Master Properties - 1st Parameter = File Path, 2nd Parameter = File Name
PropertiesReader propertiesReader = new PropertiesReader("./PayMasterProperties/", "BankListing.properties");
// Declare variable for Payment Master Entity
PayMasterEntity paymentResponseEntity = new PayMasterEntity();
// Get response message from PayMaster and set it into Payment Master Entity
paymentResponseEntity.setter("ResponseMessage", responseMessage);
paymentResponseEntity.setter("MerchantID", "000010000099939");
// Call Payment Master Payment Response Message Builder to set value
PaymentResponseMessageBuilder paymentResponseMessageBuilder = new PaymentResponseMessageBuilder();
paymentResponseMessageBuilder.buildBankListingResponseMessage(paymentResponseEntity, propertiesReader);
if (paymentResponseEntity.getter("TxnStatDetCde").Equals("0000")) {
string merchRefNo = paymentResponseEntity.getter("MerchRefNo");
string txnStatus = paymentResponseEntity.getter("TxnStatus");
string queryStatus = paymentResponseEntity.getter("QueryStatus");
string txnStatMsg = paymentResponseEntity.getter("TxnStatMsg");
string merchantID = paymentResponseEntity.getter("MerchantID");
string cardNo = paymentResponseEntity.getter("CardNo");
string txnDtTm = paymentResponseEntity.getter("TxnDtTm");
string txnAmt = paymentResponseEntity.getter("TxnAmt");
string currCode = paymentResponseEntity.getter("CurrCode");
string versionNo = paymentResponseEntity.getter("VersionNo");
string retrievalRefNo = paymentResponseEntity.getter("RetrievalRefNo");
string uppPymtMode = paymentResponseEntity.getter("UppPymtMode");
string succRespURL = paymentResponseEntity.getter("SuccRespURL");
string txnStatDetCde = paymentResponseEntity.getter("TxnStatDetCde");
string preAuthFlag = paymentResponseEntity.getter("PreAuthFlag");
string pymtGwRefNo = paymentResponseEntity.getter("PymtGwRefNo");
// To do ...
}
Step 4 : Indicate PayMaster Properties File Location
The merchant must specify the location of the PayMaster Properties File using the PropertiesReader.
Step 5 : Assign Response Message into Payment Response Entity
The merchant should assign the response message received from PayMaster into the PayMaster Response Entity using the setter function: setter("ResponseMessage","<response message returned by PayMaster Gateway>").
Step 6 : Assign Values into PayMaster Response Entity
The merchant should call the Bank Listing Response Message Builder to process the response message and assign the values to the PayMaster Response Entity.
Refer to Bank Listing 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 using the getter function, which accepts only one parameter: getter(parameter name).
Ensure that the value of TxnStatDetCde is not equal to 5015, as this represents an invalid secure hash value.
Step 1 : Library
The merchant must include the PayMaster Merchant Plug-In (MPI) PHP library, PayMaster.phar, in the merchant application.
Step 2 : Merchant Code
For Bank Listing, the merchant should import the following into their code:
PropertiesReader- to read the properties files.PayMasterEntity– to assign all the acceptable values for PayMaster Bank Listing.PaymentResponseMessageBuilder– to generate the PayMaster Bank Listing response message.
Step 3 : Source Code
<?php
use com\PayMaster\Entities\PayMasterEntity;
use com\PayMaster\PropertiesReader\PropertiesReader;
use com\PayMaster\MessageResponseBuilder\PaymentResponseMessageBuilder;
use com\PayMaster\Import\ImportFile;
// Locate the absolute path of PayMaster.phar
$basePath = 'phar://<absolute path of PayMaster.phar>/paymaster/PayMaster.phar/';
include_once $basePath . 'com/PayMaster/Import/ImportFile.php';
$import = new ImportFile();
$import->includeFile($basePath);
// Declare variable for Payment Master Properties - 1st Parameter = File Path, 2nd Parameter = File Name
$propertiesReader = new PropertiesReader();
$propertiesReader->PropertiesReader(<absolute path> . "/paymaster", "BankListing.ini");
// Declare variable for Payment Master Entity
$paymentResponseEntity = new PayMasterEntity();
// Get response message from PayMaster and set it into Payment Master Entity
$paymentResponseEntity->setter("ResponseMessage", $responseMessage);
$paymentResponseEntity->setter("MerchantID", "000010000099939");
// Call Payment Master Payment Response Message Builder to set value
$paymentResponseMessageBuilder = new PaymentResponseMessageBuilder();
$paymentResponseMessageBuilder->buildBankListingResponseMessage($paymentResponseEntity, $propertiesReader);
if (strncmp($paymentResponseEntity->getter("TxnStatDetCde"), "0000") == 0) {
$merchRefNo = $paymentResponseEntity->getter("MerchRefNo");
$txnStatus = $paymentResponseEntity->getter("TxnStatus");
$queryStatus = $paymentResponseEntity->getter("QueryStatus");
$txnStatMsg = $paymentResponseEntity->getter("TxnStatMsg");
$merchantID = $paymentResponseEntity->getter("MerchantID");
$cardNo = $paymentResponseEntity->getter("CardNo");
$txnDtTm = $paymentResponseEntity->getter("TxnDtTm");
$txnAmt = $paymentResponseEntity->getter("TxnAmt");
$currCode = $paymentResponseEntity->getter("CurrCode");
$versionNo = $paymentResponseEntity->getter("VersionNo");
$retrievalRefNo = $paymentResponseEntity->getter("RetrievalRefNo");
$uppPymtMode = $paymentResponseEntity->getter("UppPymtMode");
$succRespURL = $paymentResponseEntity->getter("SuccRespURL");
$txnStatDetCde = $paymentResponseEntity->getter("TxnStatDetCde");
$preAuthFlag = $paymentResponseEntity->getter("PreAuthFlag");
$pymtGwRefNo = $paymentResponseEntity->getter("PymtGwRefNo");
// To do ...
}
?>
Step 4 : Locate Absolute Path of PayMaster.phar
The merchant must locate the absolute path of PayMaster.phar and set it as the $basePath in the merchant source code (line 7 in the example above).
Example:$basePath='phar://<absolute path of PayMaster.phar>/'
Step 5 : Indicate PayMaster Properties File Location
The merchant must specify the location of the PayMaster Properties File using the PropertiesReader.
Step 6 : Assign Response Message into Payment Response Entity
The merchant should assign the response message received from PayMaster into the PayMaster Response Entity using the setter("ResponseMessage",<response message returned by PayMaster Gateway>") function.
Step 7 : Assign Values into PayMaster Response Entity
The merchant should call the Bank Listing Response Message Builder to process the response message and assign the values to the PayMaster Response Entity.
Refer to Bank Listing Parameters for the fields supported by the PayMaster Merchant Plug-In (MPI).
Step 8 : Retrieve Values from PayMaster Response Entity
The merchant can retrieve values from the PayMaster Response Entity using the getter(parameter name) function, which accepts only one parameter.
Ensure that the value of TxnStatDetCde is not equal to 5015, as this represents an invalid secure hash value.
Step 1 : Packages
The merchant must set up and include the PayMaster Merchant Plug-In (MPI) Python packages in the merchant application.
Step 2 : Import
For Bank Listing, the merchant should import the following modules into the merchant code:
PropertiesReader– to read the properties files.PayMasterEntity– to assign all the acceptable values for PayMaster Bank Listing.PaymentResponseMessageBuilder– to generate the PayMaster Bank Listing response message.
Step 3 : Source Code
from com.PayMaster.Entities.PayMasterEntity import PayMasterEntity
from com.PayMaster.PropertiesReader.PropertiesReader import PropertiesReader
from com.PayMaster.MessageResponseBuilder.PaymentResponseMessageBuilder import PaymentResponseMessageBuilder
# Declare variable for Payment Master Properties - 1st Parameter = File Path, 2nd Parameter = File Name
propertiesReader = PropertiesReader("PayMasterProperties/", "BankListing.properties")
# Declare variable for Payment Master Entity
paymentResponseEntity = PayMasterEntity()
# Get response message from PayMaster and set it into Payment Master Entity
paymentResponseEntity.setter("ResponseMessage", responseMessage)
paymentResponseEntity.setter("MerchantID", "000010000099939")
# Call Payment Master Payment Response Message Builder to set value
paymentResponseMessageBuilder = PaymentResponseMessageBuilder()
paymentResponseMessageBuilder.buildBankListingResponseMessage(paymentResponseEntity, propertiesReader)
if paymentResponseEntity.getter("TxnStatDetCde") == '0000':
merchRefNo = paymentResponseEntity.getter("MerchRefNo")
txnStatus = paymentResponseEntity.getter("TxnStatus")
queryStatus = paymentResponseEntity.getter("QueryStatus")
txnStatMsg = paymentResponseEntity.getter("TxnStatMsg")
merchantID = paymentResponseEntity.getter("MerchantID")
cardNo = paymentResponseEntity.getter("CardNo")
txnDtTm = paymentResponseEntity.getter("TxnDtTm")
txnAmt = paymentResponseEntity.getter("TxnAmt")
currCode = paymentResponseEntity.getter("CurrCode")
versionNo = paymentResponseEntity.getter("VersionNo")
retrievalRefNo = paymentResponseEntity.getter("RetrievalRefNo")
uppPymtMode = paymentResponseEntity.getter("UppPymtMode")
succRespURL = paymentResponseEntity.getter("SuccRespURL")
txnStatDetCde = paymentResponseEntity.getter("TxnStatDetCde")
preAuthFlag = paymentResponseEntity.getter("PreAuthFlag")
pymtGwRefNo = paymentResponseEntity.getter("PymtGwRefNo")
# To do ...
Step 4 : Indicate PayMaster Properties File Location
The merchant must specify the location of the PayMaster Properties File using the PropertiesReader.
Step 5 : Assign Response Message into Payment Response Entity
The merchant should assign the response message received from PayMaster into the PayMaster Response Entity using the setter("ResponseMessage",<response message returned by PayMaster Gateway>") function.
Step 6 : Assign Values into PayMaster Response Entity
The merchant should call the Bank Listing Response Message Builder to process the response message and assign the values to the PayMaster Response Entity.
Refer to Bank Listing 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 using the getter(parameter name).
Ensure that the value of TxnStatDetCde is not equal to 5015, as this represents an invalid secure hash value.
Step 1 : Library
The merchant shall set up and include the PayMaster Merchant Plug-In (MPI) Node.js library into the merchant application.
Step 2 : Functions
MERCH_BankListingResponse()- This function should be used on the merchant's Bank Listing response page.
- It processes the response parameters returned from the PayMaster Gateway and returns the result required by the merchant.
Step 3 : Source Code
module.exports = function (app) {
app.get('/BankListingResponse', (req, res) => {
delete require.cache[
require.resolve("./js/PayMaster.min.js")
];
const paymaster = require("./js/PayMaster.min.js");
paymaster.PropertiesReader('./properties/', 'BankListing.properties');
paymaster.MERCH_BankListingResponse(req, paymaster.propDetails, function(err, response, result) {
if (err) {
throw err;
}
if (response) {
if (paymaster.getter('TxnStatDetCde') === "0000") {
var MerchRefNo = paymaster.getter('MerchRefNo');
var TxnStatus = paymaster.getter('TxnStatus');
var QueryStatus = paymaster.getter('QueryStatus');
var TxnStatMsg = paymaster.getter('TxnStatMsg');
var MerchantID = paymaster.getter('MerchantID');
var CardNo = paymaster.getter('CardNo');
var TxnDtTm = paymaster.getter('TxnDtTm');
var TxnAmt = paymaster.getter('TxnAmt');
var CurrCode = paymaster.getter('CurrCode');
var VersionNo = paymaster.getter('VersionNo');
var RetrievalRefNo = paymaster.getter('RetrievalRefNo');
var UppPymtMode = paymaster.getter('UppPymtMode');
var SuccRespURL = paymaster.getter('SuccRespURL');
var TxnStatDetCde = paymaster.getter('TxnStatDetCde');
var PreAuthFlag = paymaster.getter('PreAuthFlag');
var PymtGwRefNo = paymaster.getter('PymtGwRefNo');
// To do ...
}
}
});
// More code here...
});
};
Step 4 : Indicate PayMaster Properties File Location
The merchant must specify the location of the PayMaster Properties File using the PropertiesReader.
Step 5 : Retrieve Values from PayMaster Response Entity
The merchant can retrieve values from the PayMaster Response Entity using the getter(parameter name) function, which accepts only one parameter.
Refer to Bank Listing Parameters for the fields supported by the PayMaster Merchant Plug-In (MPI).
Ensure that the value of TxnStatDetCde is not equal to 5015, as this represents an invalid secure hash value.