Integration Details Between Merchant and WLPG SDK

This section provides detailed integration instructions for integrating the WLPG SDK with merchant mobile applications.

5.1 Integration of WLPG SDK to Merchant Application

5.1.1 Copy .aar File

The merchant must place the pgsdk.aar file in the merchant mobile application library directory:

app/libs/pgsdk.aar

5.1.2 Mapping .aar File to Gradle

In the merchant application's build.gradle (app module) file, add the following configuration:

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    implementation(name: 'pgsdk', ext: 'aar')
}

After updating the build.gradle file, Gradle must be synchronized to apply the changes.

5.1.3 Permissions

The merchant application must declare the following permission in AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />

5.1.4 Initialize Transaction/Payments

The merchant application must invoke the SDK's initiatePayment API to initiate transactions with WLPG. The API requires the following parameters:

Required Parameters:

  1. terminalId
  2. terminalPassword
  3. jwtUsername
  4. jwtPassword
  5. action
  6. currencyCode
  7. ipAddress
  8. amount
  9. trackId
  10. firstName
  11. lastName
  12. countryCode
  13. postalCode
  14. administrativeArea
  15. email
  16. address1
  17. locality
  18. cardType
  19. phoneNumber

Implementation Code:

val paymentData = PaymentData(
    terminalId,
    terminalPassword,
    jwtUsername,
    jwtPassword,
    action,
    currencyCode,
    ipAddress,
    amount,
    trackId,
    firstName,
    lastName,
    countryCode,
    postalCode,
    administrativeArea,
    email,
    address1,
    locality,
    cardType,
    phoneNumber
)

PGService().initiatePayment(
    this@CurrentActivity,
    paymentData,
    object : PGInterface {
        override fun onPGResult(result: PaymentResult) {
            // Handle payment result
        }
    }
)

Parameter Details:

Field NameField DescriptionMandatoryField TypeMin/Max LengthSample
TerminalIDTerminal ID provided in Merchant integration KITMAlphanumericMin 2 - Max 16ipay12345abcdef
TerminalPasswordTerminal Password provided in Merchant integration KITMAlphanumericMax 3000T@3093099
JWTUserNameJWT User Name provided in Merchant integration KITMAlphanumeric-PINEUSER123
JWTPasswordJWT Password provided in Merchant integration KITMAlphanumeric-PINEPASS123
ActionType of TransactionMNumeric-1
CurrencyCodeCurrency Code of TransactionMNumeric-784
IPAddressIP Address of the MerchantMNumeric with dot-10.44.6.66
AmountTransaction amountMNumeric with dot-70.00
TrackIDUnique ID of the transactionMAlphanumeric-123456789012
FirstNameCustomer First nameMAlphabetic-TestFirstName
LastNameCustomer Last nameMAlphabetic-TestLastName
CountryCodeCountry codeMAlphabetic-India
PostalCodePostal CodeMAlphanumeric-India
AdminAreaAdministrative AreaMAlphanumeric-ewet
EmailEmail address of the customerMAlphanumeric-[email protected]
Address1Address of the customerMAlphanumeric-Abc
LocalityLocality of the customerMAlphabetic-Xyz
CardTypeCard Type of the transactionMAlphabetic-C
PhoneNumberPhone number of the customerMNumeric-1234567890

5.1.5 Handle Payment Response

The SDK provides callback results through the onPGResult callback function. The payment result contains the following fields:

override fun onPGResult(result: PaymentResult) {
    // Process payment result
    val paymentId = result.paymentId
    val transactionResult = result.result
    val authCode = result.auth
    // Additional processing based on result
}

Payment Result Response Fields:

Field NameField DescriptionMandatoryField TypeMin/Max LengthSample
paymentIdUnique ID generated by Payment Gateway. This is the same ID that Payment Gateway had provided along with the Payment Page URL for the initial request in case merchant has used Bank Hosted environment for processing purchase request.MAlphanumericMax 100202421594762867
resultTransaction response. Merchant to evaluate the transaction result and take further action accordingly.MAlphanumericMax 100CAPTURED
authThe resulting authorization number of the transaction from the issuing bank. This number or series of letters is used for referential purposes by some acquiring/issuing bank/institutions and should be stored properly.MAlphanumericMax 6000000
avrAVR status of the transaction.MAlphabeticMax 1N
refThe resulting reference number of the transaction. This number or series of letters is used for referential purposes by some acquiring/issuing bank/institutions and should be stored properly.MAlphanumericMax 12935110000001
tranIdUnique Transaction ID generated by Payment Gateway.MNumericMax 19201931951332346
postDateTransaction Date in the format of the authorization system. Post Date is business logic date of respective issuing bank and may not be same as the actual date.MNumericMax 41217
trackIdA unique tracking ID issued by the merchant's system which is stored with the transaction.MAlphanumericMax 25k1rmMwTSUPiH7V5Ya8di
udf1A unique tracking ID issued by the merchant's system which is stored with the transaction.OAlphanumericMax 2551003383844
udf2Same udf2 value that merchant has sent in the initial transaction request to Payment Gateway.OAlphanumericMax 255Address 1
udf3Same udf3 value that merchant has sent in the initial transaction request to Payment Gateway.OAlphanumericMax 255Address 2
udf4Same udf4 value that merchant has sent in the initial transaction request to Payment Gateway.OAlphanumericMax 255City
udf5Same udf5 value that merchant has sent in the initial transaction request to Payment Gateway.M (Supporting Transactions only)AlphanumericMax 2551003383844
udf6The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf7The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf8The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf9The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf10The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf11The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf12The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf13The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf14The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf15The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf16The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf17The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf18The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf19The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
udf20The user (merchant) defines these fields. The field data is passed along with a transaction request and then returned in the transaction response. Merchant should ensure that field is left blank when no data needs to be passed.OAlphanumericMax 255[email protected]
amtTransaction Amount as sent by merchant in the request.MNumericMax 1011.25
errorError code of the transaction. This will have data in case transaction decline.M (Failure status only)AlphanumericMax 100IPAY0100215
errorTextError description of the transaction. This will have data in case transaction decline.M (Failure status only)AlphanumericMax 255!ERROR!-IPAY0100215 - Invalid tranportal i