ARB Payment Gateway REST API Integration Doc_V1.26
ARB Payment Gateway REST API Integration Doc_V1.26
Version 1.26
API Guide
Version History
Version Created or
Created or Updated By Reason for Change
No. Updated on
1.23 AlRajhi Bank 3DS 2.0 Parameters 13 October, 2021
URPAY Wallet as Payment
1.24 AlRajhi Bank 16 June, 2022
Option
Card Number Masking, Expiry
1.25 AlRajhi Bank 02 August, 2022
Date
Processing – Manual Refund
1.26 AlRajhi Bank 10 Nov, 2023
Result Code
Table of Contents
INDEX 287
Chapter 1 INTRODUCTION
This chapter provides the purpose of this document and its details.
The Payment Gateway follows industry standards and norms as prescribed by Master-Card and
Visa International as well in conformity with Payment Card Industry – Data Security Standards
commonly referred to as PCI – DSS.
In order that the AL Rajhi Bank merchants are integrated in a secure and mandated manner, this
reference document is being shared. The expectation being that the merchant’s system integrator
or auditor can refer to a document while performing integration as well as post integration. It
contains the technical integration details including message formats to be used in communicating
to the Payment Gateway irrespective of the merchant platform being used. The document also
shares the best practices and recommendations the merchant should follow during the integration
with Payment Gateway.
Target Audience
This document is intended for Partner integration teams, project managers, developers, and
testers.
This chapter contains detailed instructions of building merchant application with ARB Payment
Gateway.
Alrajhi Payment Gateway offers a secure, PCI-DSS compliant approach to save Debit card, Credit
card, Net-Banking, UPI and Wallet payments from the merchants.
1. Once the Merchant on-boarded on ARB payment gateway, merchant would be provided with
Payment gateway application URL and login credentials.
Notes: Generate your staging account credentials. These are required to explore
ARB Payment Gateway integration solutions.
2. Merchant to logs in to ARB payment gateway merchant portal and download the following:
Tranportal ID & Tranportal password
- Tranportal ID and Tranportal password are unique values provided by ARB
Payment Gateway via registered mail as well.
- The details are required for integration with ARB payment gateway.
Resource Key
- Resource key is a unique secret key used for secure encryption and decryption of
every request.
- This should not be shared with anyone.
The ARB payment gateway’s merchant application is a well secured interface that captures
payment related data between the merchant and the customer:
1. A user adds goods & services in cart and clicks the Alrajhi Payment Gateway button
in your application (the merchant’s application).
2. A checkout form is shown where the user fills in the payment details and authorizes
the payment.
There are two ways of processing the payment with ARB payment gateway with API
integration:
Bank Hosted setup
Merchant Hosted setup
https://digitalpayments.alrajhibank.com.sa/mrchptl/merchant.htm
6. Receive payments collected from customers in your bank account on the next business
day.
Integration Guidelines
Test Instruments
ARB PG APIs are complete RESTFUL API’s; Merchants can test the API’s on sandbox setup before
testing on Live environment.
This chapter illustrates various transaction flows of payment gateway integrate on merchants’
application.
This section illustrates how you can integrate the bank hosted flow on your website application.
Note: If merchant notification is disabled, then ARB Payment gateway will provide the final
response in URL redirection.
4. User enters the payment details and authorizes the transaction on the ARB PG bank’s
page.
5. The ARB PG application process the transaction and returns the transaction response to
the merchant site.
6. Merchant server calls the transaction status API to verify the transaction response.
7. Finally, the merchant application displays the transaction status to user.
currencyC
5 M Numeric 3-digit currency code of KSA. Ex:682
ode
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata> ”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata:
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource Key.
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”12345656789”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"langid":"ar",
}]
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”12345656789”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"langid":"ar",
}]
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
{"bankIdCode":"12345d6f","iBanNum": "567896743281926354276254",
"serviceAmount":"200.00","valueDate":"20201231" },
{"bankIdCode":"1234ret3","iBanNum": "987656743281926354276254",
"benificiaryName":"DIGITAL CO",
"serviceAmount":"300.00","valueDate":"20201231" }] ,
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"POSTP
AID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
},
Airline
}]
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response in case of successful validation, if failure then error code and
description will be provided. The below response will be in plain format and there is no
encryption for the below. Merchant can directly parse the response-based status and result
fields as mentioned below.
Success:
[{
"status": "1",
"result":"100201931620827468:https://securepayments.alrajhibank.com.sa/pg/p
aymentpage.htm", //Payment ID:Paymentpage URL
“error”: null,
“errorText”: null }]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
After Initial Response from ARB PG, merchant needs to frame the payment page URL like the
below sample.
https://securepayments.alrajhibank.com.sa/pg/paymentpage.htm?PaymentID=1002019316208
27468
If Merchant notification is disabled, then ARB Payment gateway will provide the final response
in URL redirection. Below is the sample response from ARB PG to merchant
[{
//Redirection Parameters
“paymentId”:”100201935166676976”,
“trandata”:”<encrypted trandata>”,
“error”:””,
“errorText”:””
}]
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”: ”CAPTURED”,
”transId”:201935166561122,
”ref”:”935110000001”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
"cardType":"Visa",
“actionCode”:”1”,
"card":"506968XXXXXX1063",
}]
This section illustrates how you can integrate the bank hosted (Faster checkout) flow on your
website application. Faster Checkout functionality is supported for the merchants only when
Faster Checkout flag is enabled at the terminal level.
Note: If merchant notification is disabled, then ARB Payment gateway will provide the
final response in URL redirection.
4. Select the payment details already stored in the bank’s database. (Faster checkout)
Or
User enters the payment details and authorizes the transaction on the ARB PG bank’s
page. (Standard checkout)
5. The ARB PG application process the transaction and returns the transaction response
to the merchant site.
6. Merchant server calls the transaction status API to verify the transaction response.
7. Finally, the merchant application displays the transaction status to user.
currencyC
5 M Numeric 3-digit currency code of KSA. Ex:682
ode
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata> ”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata:
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource Key.
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”12345656789”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"langid":"ar",
"custid":"201936122890007",
"cust_cardHolderName":"Test",
"cust_mobile_number":"7788667755",
"cust_emailId":”[email protected]”
}]
Payout Future
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
Airline
}]
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response in case of successful validation, if failure then error code and
description will be provided. The below response will be in plain format and there is no
encryption for the below. Merchant can directly parse the response-based status and result
fields as mentioned below.
Success:
[{
"status": "1",
"result":"100201931620827468:https://securepayments.alrajhibank.com.sa/pg/pa
ymentpage.htm", //Payment ID:Paymentpage URL
“error”: null,
“errorText”: null }]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
After Initial Response from ARB PG, merchant needs to frame the payment page URL like the
below sample.
https://securepayments.alrajhibank.com.sa/pg/paymentpage.htm?PaymentID=1002019316
20827468
If Merchant notification is disabled, then ARB Payment gateway will provide the final
response in URL redirection. Below is the sample response from ARB PG to merchant
[{
//Redirection Parameters
“paymentId”:”100201935166676976”,
“trandata”:”<encrypted trandata>”,
“error”:””,
“errorText”:””
}]
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”:”CAPTURED”,
”transId”:”201935166561122”,
"fcCustId":"201936122890007",
”ref”:”935110000001”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
“actionCode”:”1” ,
"card":"506968XXXXXX1063",
"expMonth":"06",
}]
Payment gateway shall support Iframe integration to enable merchants to accept online
payments on their own checkout page without having to be a PCI compliant. Instead of
being redirected to ARB Payment page, customers will remain on merchant website to make
payments. However, at the back end, ARB PG will securely collect the payment information
and get it authorized.
Note: If merchant notification is disabled, then ARB Payment gateway will provide the
final response in URL redirection.
4. Select the payment details already stored in the bank’s database. (For faster checkout)
Or
User enters the payment details and authorizes the transaction on the ARB PG bank’s
page.
5. The ARB PG application process the transaction and returns the transaction response
to the merchant site.
6. Merchant server calls the transaction status API to verify the transaction response.
7. Finally, the merchant application displays the transaction status to user.
currencyC
5 M Numeric 3-digit currency code of KSA. Ex:682
ode
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata> ”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata:
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource Key.
[{
//Mandatory Parameters
“amt”:”12.00”,
”action”:”1”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”12345656789”,
”udf3”:”iframe”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”: ”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"langid":"ar",
}]
Payout Future
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
Airline
}]
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response in case of successful validation, if failure then error code and
description will be provided. The below response will be in plain format and there is no
encryption for the below. Merchant can directly parse the response-based status and result
fields as mentioned below.
Success:
[{
"status": "1",
"result":"100201931620827468:https://securepayments.alrajhibank.com.sa/pg/pa
ymentpage.htm", //Payment ID:Paymentpage URL
“error”: null,
“errorText”: null }]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
After Initial Response from ARB PG, merchant needs to frame the payment page URL like the
below sample.
https://securepayments.alrajhibank.com.sa/pg/paymentpage.htm?PaymentID=1002019316
20827468
Merchant needs to add the following code snippet to load the payment page in an iframe
window:
Code Snippet
if("iframe".equals(pipe.getUdf3()))
%>
<script>
if(window.parent.document.getElementById("iframe")!=null)
var division=document.createElement("div");
division.setAttribute("id", "payframe");
document.body.appendChild(division);
else
var division=document.createElement("div");
division.setAttribute("id", "payframe");
document.body.appendChild(division);
</script>
else
response.sendRedirect(pipe.getWebAddress());
If Merchant notification is disabled, then ARB Payment gateway will provide the final
response in URL redirection. Below is the sample response from ARB PG to merchant
[{
//Redirection Parameters
“paymentId”:”100201935166676976”,
“trandata”:”<encrypted trandata>”,
“error”:””,
“errorText”:””
}]
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”:”CAPTURED”,
”transId”:”201935166561122”,
"fcCustId":"201936122890007",
”ref”:”935110000001”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
“actionCode”:”1”,
"card":"506968XXXXXX1063",
}]
The merchant will collect the customer’s card details on their own website hence, the customer
will not be redirected to the ARB payment gateway payment page, as the payment option and
card details are already received by merchant. The card details are later posted to ARB
payment gateway.
This section illustrates how you can integrate the merchant hosted flow on your website
application.
The flow takes the user to the login ACS page of the bank, where the user needs to
complete the transaction by using the OTP sent by the bank to the registered mobile
number. PG then process for authorization with the respective schemes. Once payment
response received from respective scheme, then ARB Payment gateway returns the
response to merchant. This is URL redirection.
6. After authorization, the ARB PG application process the transaction and returns the
transaction response to the merchant site. The ARB Payment gateway will provide the
final response in URL redirection.
7. Merchant server calls the transaction status API to verify the transaction response.
8. Finally, the merchant application displays the transaction status to user.
Values Accepted :
1 = 1 bit
4 = 4 bits
8 = 8 bits
15 = 15 bits
16 = 16 bits
24 = 24 bits
32 = 32 bits
48 = 48 bits
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata:
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource key.
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”expYear”:”2022”,
”expMonth”:”12”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardNo”,”5453********5539”,
”cardType”:”C”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
"browserJavaEnabled":"true",
"browserLanguage":"en",
"browserColorDepth":"48",
"browserScreenHeight":"400",
"browserScreenWidth":"600",
"browserTZ":"0",
"jsEnabled":"true",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
}]
"udf6":"12345",
"udf7":"C",
Payout Future
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
Airline
}]
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response in case of successful validation, if failure then error code and
description will be provided.
Success:
[{
"status": "1",
"result":"700212030953264091:https://securepayments.alrajhibank.com.sa/p
g/TranportalVbv.htm?paymentId=700212030953264091&id=r9Ht8R4U6g9dYtY",
//Payment ID:Payment URL
“error”:null,
“errorText”: null
}]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
After Initial Response from ARB PG, merchant needs to frame the payment page URL like the
below sample.
https://securepayments.alrajhibank.com.sa/pg/TranportalVbv.htm?paymentId=700112030
953264091&id=r9Ht8R4U6g9dYtYg
The flow takes the user to the login ACS page of the bank, where the user needs to
complete the transaction by using the OTP sent by the bank to the registered mobile
number. PG then process for authorization with the respective schemes. Once payment
response received from respective scheme, then ARB Payment gateway returns the
response to merchant. This is URL redirection.
If Merchant notification is disabled, then ARB Payment gateway will provide the final
response in URL redirection. Below is the sample response from ARB PG to merchant
[{
“paymentId”:”100201935044735860”,
“Error”:””,
“ErrorText”:””
}]
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”: ”CAPTURED”,
”transId”:201935166561122,
”ref”:”935110000001”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
"cardType":"Visa",
“actionCode”:”1”,
"card":"506968XXXXXX1063",
}]
This section illustrates how you can integrate the merchant hosted flow (Non 3D Secure) on
your website application.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
Plain Trandata:
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”expYear”:”2022”,
”expMonth”:”12”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardNo”,”5453********5539”,
”cardType”:”C",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
}]
Payout Future
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
Airline
}]
The ARB payment gateway verifies the transaction and returns the response to the same
request.
The ARB payment gateway verifies the transaction and returns the response to the same
request.
[{
“tranid”: “201931951332346”,
“error”:null,
“errorText”: null
}]
Plain Trandata:
[{
“paymentId”:-1,
”result”:”CAPTURED”,
”amt”:”10.55”,
”date”:”1221”,
”ref”:”935110000001”,
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
”trackId”,”3423423”,
”transId”:”1242345345234”,
“authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
“actionCode”:”1”
}]
The flow takes the user to the login ACS page of the bank, where the user needs to
complete the transaction by using the OTP sent by the bank to the registered mobile
number. PG then process for authorization with the respective schemes. Once payment
response received from respective scheme, then ARB Payment gateway returns the
response to merchant. This is URL redirection.
7. After authorization, the ARB PG application process the transaction and returns the
transaction response to the merchant site. The ARB Payment gateway will provide the
final response in URL redirection.
8. Merchant server calls the transaction status API to verify the transaction response.
9. Finally, the merchant application displays the transaction status to user.
When the merchant hosted transaction is in progress, the sensitive card information entered
by the customer is saved as token in the PCI compliant merchant’s database as well the
information is later posted to PG. The next time the customer makes any transactions, the
customer can pay directly by entering the CVV of the card and OTP received.
7 udf1 O Alphanum The user (merchant) defines these fields. The field data
passed along with a transaction request and then
returned in the transaction response. Merchant should
ensure that field left blank when no data needs to be
passed.
8 udf2 O Alphanum The user (merchant) defines these fields. The field data
passed along with a transaction request and then
returned in the transaction response. Merchant should
ensure that field left blank when no data needs to be
passed.
9 udf3 O Alphanum The user (merchant) defines these fields. The field data
passed along with a transaction request and then
returned in the transaction response. Merchant should
ensure that field left blank when no data needs to be
passed.
10 udf5 O Alphanum The user (merchant) defines these fields. The field data
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.
11 responseURL M Alphanum The merchant success URL where Payment Gateway
send the notification request.
12 errorURL M Alphanum The merchant error URL where Payment Gateway send
the response in case any error while Processing the
transaction.
13 expYear M Numeric Expiry year of card
Values Accepted :
1 = 1 bit
4 = 4 bits
8 = 8 bits
15 = 15 bits
16 = 16 bits
24 = 24 bits
32 = 32 bits
48 = 48 bits
23 browserScree M Alphanu Total height of the Cardholder’s screen in pixels. Value
nHeight m is returned from the screen.height property. Length 1 to
6 characters.
24 browserScree M Alphanu Total width of the cardholder’s screen in pixels. Value is
nWidth m returned from the screen.width property. Length 1 to 6
characters.
25 browserJavaE M Alphanu Value is returned from the navigator.javaEnabled
nabled m property. Boolean value.
26 browserTZ M Alphanu Time difference between UTC time and the Cardholder
m browser local time, in minutes. Value is returned from
the getTimezoneOffset() method. Length 1 to 5
characters.
27 jsEnabled M Alphanu Value whether the java script is enabled in browser or
m not.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource key.
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”expYear”:”2022”,
”expMonth”:”12”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardNo”,”5453********5539”,
”cardType”:”C”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
"cardOnFileAction":"transaction",
"browserJavaEnabled":"true",
"browserLanguage":"en",
"browserColorDepth":"48",
"browserScreenHeight":"400",
"browserScreenWidth":"600",
"browserTZ":"0",
"jsEnabled":"true",
"cardOnFileToken":"201936122890007",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”
}]
7 udf1 O Alphanum The user (merchant) defines these fields. The field data
passed along with a transaction request and then
returned in the transaction response. Merchant should
ensure that field left blank when no data needs to be
passed.
8 udf2 O Alphanum The user (merchant) defines these fields. The field data
passed along with a transaction request and then
returned in the transaction response. Merchant should
ensure that field left blank when no data needs to be
passed.
9 udf3 O Alphanum The user (merchant) defines these fields. The field data
passed along with a transaction request and then
returned in the transaction response. Merchant should
ensure that field left blank when no data needs to be
passed.
10 udf5 O Alphanum The user (merchant) defines these fields. The field data
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.
11 responseURL M Alphanum The merchant success URL where Payment Gateway
send the notification request.
12 errorURL M Alphanum The merchant error URL where Payment Gateway send
the response in case any error while Processing the
transaction.
13 member M Alphanum Card holder name
Values Accepted :
1 = 1 bit
4 = 4 bits
8 = 8 bits
15 = 15 bits
16 = 16 bits
24 = 24 bits
32 = 32 bits
48 = 48 bits
24 browserTZ M Alphanu Time difference between UTC time and the Cardholder
m browser local time, in minutes. Value is returned from
the getTimezoneOffset() method. Length 1 to 5
characters.
25 jsEnabled M Alphanu Value whether the java script is enabled in browser or
m not.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource key.
[{ //Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardType”:”C”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
"cardOnFileAction":"transaction",
"cardOnFileToken":"201936122890007",
"maskedCardNo":"545301******5539",
"browserJavaEnabled":"true",
"browserLanguage":"en",
"browserColorDepth":"48",
"browserScreenHeight":"400",
"browserScreenWidth":"600",
"browserTZ":"0",
"jsEnabled":"true",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”
}]
1 status M Numeric If the request validation success, then status will be ‘1’.
If the validation failed, then status will be ‘2’
2 result C Alphanu It contains payment ID and Payment URL if the
m validation success else this will be null
3 error C Alphanu If validation failed, then Payment gateway will provide
m the respective error code
4 errorText C Alphanu If validation failed, then Payment gateway will provide
m the respective error description
Plain Response:
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response if the validation success. If failure then, Error code and
description will be provided.
Success:
[{
"status": "1",
"result":"700212030953264091:https://securepayments.alrajhibank.com.sa/pg/
TranportalVbv.htm?paymentId=700212030953264091&id=r9Ht8R4U6g9dYtY",
//Payment ID:Payment URL
“error”:null,
“errorText”: null
}]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
https://securepayments.alrajhibank.com.sa/pg/TranportalVbv.htm?paymentId=700112030
953264091&id=r9Ht8R4U6g9dYtYg
Customer browser will redirect to ACS page and will complete the authentication. PG then process for
authorization with the respective schemes. Once payment response received from respective scheme,
then ARB Payment gateway returns the response to merchant. This is URL redirection. Below is sample
response from ARB PG to merchant,
authRespCod
12 M Numeric Auth response code provided by PG
e
Redirection Parameters
[{
“paymentId”:”100201935044735860”,
“Error”:””,
“ErrorText”:””
}]
Plain Trandata
[{“paymentId”:”100201935044735860”,
”result”: ”CAPTURED”,
”amt”:”10.55”,
”date”:1221,
”ref”:”935110000001”,
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
”trackId”,”3423423”,
”transId”:”1242345345234",
“authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
"cardOnFileToken":"201936122890007",
"maskedCardNo":"545301******5539"
“actionCode”:”1”,
"card":"506968XXXXXX1063",
}]
When the merchant hosted transaction is in progress, the sensitive card information entered
by the customer is saved as token in the PCI compliant merchant’s database as well the
information is later posted to PG. The next time the customer makes any transactions, the
customer can pay directly by entering the CVV of the card.
7 udf1 O Alphanu The user (merchant) defines these fields. The field data
m 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.
8 udf2 O Alphanu The user (merchant) defines these fields. The field data
m 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.
9 udf3 O Alphanu The user (merchant) defines these fields. The field data
m 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.
10 udf5 O Alphanu The user (merchant) defines these fields. The field data
m 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.
11 expYear M Numeric Expiry year of card
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
[{
//Mandatory Parameters
“amt”:”12.00”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”expYear”:”2022”,
”expMonth”:”12”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardNo”,”5453********5539”,
”cardType”:”C",
"cardOnFileAction":"transaction",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”
}]
7 udf1 O Alphanu The user (merchant) defines these fields. The field data
m 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.
8 udf2 O Alphanu The user (merchant) defines these fields. The field data
m 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.
9 udf3 O Alphanu The user (merchant) defines these fields. The field data
m 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.
10 udf5 O Alphanu The user (merchant) defines these fields. The field data
m 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.
11 member M Alphanu Card holder name
m
12 cvv2 M Numeric CVV of the card
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardType”:”C",
"cardOnFileAction":"transaction",
"cardOnFileToken":"201936122890007",
"maskedCardNo":"545301******5539",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”
}]
Once ARB payment gateway verifies the transaction and returns the response to the same request.
authRespCod
12 M Numeric Auth response code provided by PG
e
[{
“tranid”: “201931951332346”,
“error”:null,
“errorText”: null
}]
[{
“paymentId”:-1,
”result”:”CAPTURED”,
”amt”:”10.55”,
”date”:”1221”,
”ref”:”935110000001”,
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
”trackId”,”3423423”,
”transId”:”1242345345234”,
“authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
"cardOnFileToken":"201936122890007",
"maskedCardNo":"545301******5539"
“actionCode”:”1”
}]
1. User visits the merchant application and click card registration option.
2. Merchant application backend server calls Card Registration Token Generation API
to get the token and to register the card details in Alrajhi Payment gateway
3. After authorization, the ARB PG application saves the card details and returns the
transaction response to the merchant site. The ARB Payment gateway will provide the
final response in URL redirection.
4. Finally, the merchant application displays the transaction status to user.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
[{
//Mandatory Parameters
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”expYear”:”2022”,
”expMonth”:”12”,
”cardNo”,”5453********5539”,
"cardOnFileAction":"registration",
"cardOnFileToken":"201936122890007"
}]
1 trandata C Alphanu All the below response parameters encrypted and send
m the encrypted value in trandata
2 error C Numeric If any error, PG will provide the error code
3 errorText C Alphanu PG will provide the error description if registration fails.
m
4 status M Numeric 1 for registration success case, 2 for failure case
“error”:””,
“errorText”:””
}]
[{
"cardOnFileToken":"201936122890007",
"maskedCardNo":"545301******5539"
}]
1. User visits the merchant application and click card deregistration option.
2. Merchant application backend server calls Card Deregistration Token Generation
API to get the token and to deregister the card details in Alrajhi Payment gateway
3. After authorization, the ARB PG application deletes the card details and returns the
transaction response to the merchant site. The ARB Payment gateway will provide the
final response in URL redirection.
4. Finally, the merchant application displays the transaction status to user.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
[{
//Mandatory Parameters
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
"cardOnFileAction":"deregistration",
"cardOnFileToken":"201936122890007",
"maskedCardNo":"545301******5539"
}]
[{
“error”:””,
“errorText”:””
}]
Inquiry Transactions: As an added security measure ARB Payment Gateway allows merchants to
do an inquiry of already completed transaction by passing certain details of the payment message,
ARB Payment Gateway provides response to this request with appropriate fields in the response;
the merchant is expected to verify the relevant fields like Transaction amount, transaction status
and other transaction fields.
Refund Transactions: Merchant collects the cancellation request and initiate the transaction using
Refund API. Merchant may initiate refund for full amount or partial amount; Payment Gateway will
allow amount until it reached to original transaction amount.
Authorization Extension Transactions (MADA): As per the current functionality, only MADA is
supporting Authorization Extension. Authorization Extension is nothing but extending the
Authorization period not the Authorized amount.
Request
[{
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
[{
"amt":"70.00",
"action":"<action code>",
"password":"q@a68O$27@JLkcK",
"id":"IPAYlCR6qZF7q6w",
"currencyCode":"682",
"trackId":"696921377",
"udf5":"TRANID",
"transId":"201931951332346",
}]
[{
"amt":"70.00",
"action":"<action code>",
"password":"q@a68O$27@JLkcK",
"id":"IPAYlCR6qZF7q6w",
"currencyCode":"682",
"trackId":"696921377",
"udf5":"PaymentID",
"transId":"100201931948635783",
}]
[{
"amt":"70.00",
"action":"<action code>",
"password":"q@a68O$27@JLkcK",
"id":"IPAYlCR6qZF7q6w",
"currencyCode":"682",
"trackId":"696921377",
"udf5":"TrackID",
"transId":"696921377",
}]
Response
1 trandat M AlphaNu All the below response parameters will be provided in trandata
a m field
2 error C Alphanu If any error during processing, PG will provide the error code
m
3 errorTe C Alphanu If any error during processing, PG will provide the error
xt m description
4 Status M Alphanu If transaction success 1.
m If transaction failure 2.
[{
“tranid”: “201931951332346”,
“error”: null,
“errorText”: null
}]
[{
“paymentId”:100201934525118923,
”result”:”success”,
”date”:”1221”,
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”PaymentID”,
”trackId”,”3423423”,
”transId”:”201931951332346”,
”ref”:”935110000001”,
”authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
"card":"506968XXXXXX1063",
}]
This section illustrates how you can integrate the bank hosted flow on your website
application.
Note: If merchant notification is disabled, then ARB Payment gateway will provide the
final response in URL redirection.
4. User click the Apple Pay button and selects the required card details from apple wallet
and performs apple authorization.
5. The ARB PG application process the transaction and returns the transaction response
to the merchant site.
6. Merchant server calls the transaction status API to verify the transaction response.
7. Finally, the merchant application displays the transaction status to user.
currencyC
5 M Numeric 3-digit currency code of KSA. Ex:682
ode
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata> ”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource Key.
Plain Trandata:
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”12345656789”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"langid":"ar",
}]
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”12345656789”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"langid":"ar",
}]
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
{"bankIdCode":"12345d6f","iBanNum": "567896743281926354276254",
"serviceAmount":"200.00","valueDate":"20201231" },
{"bankIdCode":"1234ret3","iBanNum": "987656743281926354276254",
"benificiaryName":"DIGITAL CO",
"serviceAmount":"300.00","valueDate":"20201231" }] ,
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
},
Airline
}]
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response in case of successful validation, if failure then error code and
description will be provided. The below response will be in plain format and there is no
encryption for the below. Merchant can directly parse the response-based status and result
fields as mentioned below.
Success:
[{
"status": "1",
"result":"100201931620827468:https://securepayments.alrajhibank.com.sa/pg/pa
ymentpage.htm", //Payment ID:Paymentpage URL
“error”: null,
“errorText”: null }]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
After Initial Response from ARB PG, merchant needs to frame the payment page URL like the
below sample.
https://securepayments.alrajhibank.com.sa/pg/paymentpage.htm?PaymentID=1002019316
20827468
If Merchant notification is disabled, then ARB Payment gateway will provide the final
response in URL redirection. Below is the sample response from ARB PG to merchant
[{
//Redirection Parameters
“paymentId”:”100201935166676976”,
“trandata”:”<encrypted trandata>”,
“error”:””,
“errorText”:””
}]
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”: ”CAPTURED”,
”transId”:201935166561122,
”ref”:”935110000001”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
"cardType":"Visa",
“actionCode”:”1”
}]
This section illustrates how you can integrate the merchant hosted flow (Apple Pay) on your
website application.
3. Merchant application backend server calls Payment Token Generation API to get
the transaction token and to process payment via Alrajhi Payment gateway
4. After authorization, the ARB PG application process the transaction and returns the
transaction response to the merchant site. The ARB Payment gateway will provide the
final response in URL redirection.
5. Merchant server calls the transaction status API to verify the transaction response.
6. Finally, the merchant application displays the transaction status to user.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
Plain Trandata:
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”expYear”:”2022”,
”expMonth”:”12”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardNo”,”5453********5539”,
”cardType”:”C",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
}]
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
},
The ARB payment gateway verifies the transaction and returns the response to the same
request.
The ARB payment gateway verifies the transaction and returns the response to the same
request.
[{
“tranid”: “201931951332346”,
“error”:null,
“errorText”: null
}]
Plain Trandata:
[{
“paymentId”:-1,
”result”:”CAPTURED”,
”amt”:”10.55”,
”date”:”1221”,
”ref”:”935110000001”,
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
”trackId”,”3423423”,
”transId”:”1242345345234”,
“authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
“actionCode”:”1”,
"card":"506968XXXXXX1063",
}]
Request
7 udf1 O Alphanu The user (merchant) defines these fields. The field data
m 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.
8 udf2 O Alphanu The user (merchant) defines these fields. The field data
m 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.
9 udf3 O Alphanu The user (merchant) defines these fields. The field data
m 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.
10 udf5 O Alphanu The user (merchant) defines these fields. The field data
m 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.
11 expYear M Numeric Expiry year of card
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
[{
//Mandatory Parameters
“amt”:”12.00”,
”action”:”1”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”expYear”:”2022”,
”expMonth”:”12”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardNo”,”5453********5539”,
”cardType”:”C",
"eci":"7",
"ucaf":"1",
"cavv":"JcboZXndOg40CBECC2BGbheAAAA=",
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"udf6":"12345",
"udf7":"C",
Payout Future
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
Response
Once ARB payment gateway verifies the transaction and returns the response to the same request.
authRespCod
12 M Numeric Auth response code provided by PG
e
[{
“tranid”: “201931951332346”,
“error”:null,
“errorText”: null
}]
[{
“paymentId”:-1,
”result”:”CAPTURED”,
”amt”:”10.55”,
”date”:”1221”,
”ref”:”935110000001”,
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
”trackId”,”3423423”,
”transId”:”1242345345234”,
“authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
“actionCode”:”1”,
"card":"506968XXXXXX1063",
}]
1. Customer visits the merchant site and selects the merchandise and confirms to pay using the
payment gateway.
2. Merchant redirects the customer with the Invoice transaction data to the payment gateway.
3. Payment Gateway verifies the invoice transaction request from the merchant and generates the
invoice Payment URL based on the invoice type.
4. Payment gateway will provide the response to merchant with invoice Payment URL.
5. Merchant to redirect the Payment URL to Payment Gateway.
There are two types of invoice transactions namely Dedicated and Open invoice.
a) If the initiated transaction type is dedicated, Merchant need to send the buyer details in the
request.
PG presents the hosted payment page with buyer details to customer and prompts the
customer to enter the card credentials.
b) If the initiated transaction type is open then merchant no need to send buyer details.
6. Payment gateway will get the buyer detail and process the transaction with the respective schemes.
7. Once the transaction complete, PG will send the response to merchant and customer via mail &
SMS.
currencyCo
3 M Numeric 3-digit currency code of KSA. Ex:682
de
Alphanu
4 invoiceId M 50-digit unique Id.
m
5 Alphanu
itemDesc M 500-digit Item Description.
m
Alphabe
6 buyerName M 50-digit Buyer Name.
tic
alphanu
8 email M Buyer mail Id.
m
currencyCo
3 M Numeric 3-digit currency code of KSA. Ex: “682”
de
Alphanu
4 invoiceId M 50-digit unique Id.
m
5 Alphanu
itemDesc M 500-digit Item Description
m
ARB Payment gateway internally validates the request and gives invoice payment page URL in the
response in case of successful validation, if failure then error code and description will be provided. The
below response will be in plain format and there is no encryption for the below. Merchant can directly
parse the response-based on the status and result fields as mentioned below.
1 status M Numeric If the request validation success, then status will be ‘1’. If the
validation failed, then status will be ‘2’
2 result C Alphanu It contains invoice Payment URL if the validation success
m
3 error C Alphanu If validation failed, then Payment gateway will provide the
m respective error code
4 errorT C Alphanu If validation failed, then Payment gateway will provide the
ext m respective error description
Success:
[{
"status": "1",
"result":"https://securepayments.alrajhibank.com.sa/mrchptl/iP.htm?Id=Y3FT9"
//Invoice Payment Page URL}]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
}]
- If success, Merchant needs to redirect the invoice payment page URL like the below
sample
https://securepayments.alrajhibank.com.sa/mrchptl/iP.htm?Id=Y3FT9
- Once merchant redirects the link, ARB Payment Gateway shows the invoice Payment
Page to customer based on the invoice type.
Final Response
After validating the customer card details then ARB Payment gateway will provide the final
response to merchant and customer via mail & SMS.
For Webhook transactions, ARB PG will send risk based, authentication based or transaction/payment
based notification request to merchant as below :
Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
8 udf3 O Alpphanum[255] User Defined Field 3
- Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
-Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
-Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
-Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
-Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
-Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
-Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
-Same udf value that merchant has sent in the initial transaction
request to Payment Gateway
PAYMENT
"transId":202110527755152,"trackId":"04d26d6c-ca9f-4ac3-b65d-
6c5bff7af1a6", "udf5":"Select",
"udf10":"null","amt":10,"udf3":"null","udf4":"null","udf1":"null","udf2
":"null","ref":"110533003557","udf9":"null","udf8":"null","paymentTimes
tamp":"2021-04-15T02:58:30.448Z",”actionCode”:”1”,
"card":"401200XXXXXX1112","expMonth":"6","expYear":"24"}],
"type":"PAYMENT"}]
PAYMENT FAILURE
[{"result":[{"errorText":"00","error":"IPAY00001","status":"NOT
CAPTURED"}], "responseURL" :
"http://172.22.0.121:9207/MerchDemoREST/NotifyResponse.htm", "payLoad":
[{"date":"0414","ref":"110423000769","authRespCode":"00","authCode":"54
4377","paymentId":"700202110427042639","transId":202110472940732,"track
Id":"e061c0ec-b32e-456b-9ac2-
8196fb8f16ec","amt":100,"paymentTimestamp":"2021-04-
13T22:48:21.082Z",”actionCode”:”1”,"card":"401200XXXXXX1112","expMonth"
:"6","expYear":"24"}],"type":"PAYMENT FAILURE"}]
Purchase HOST TIME OUT Webhook notification request (Action code will be
Change in payload for each segments as per document.)
[{"result":[{"status":"HOST
TIMEOUT"}],"responseURL":"https://partner.se.com.sa/RESTAdapter/AlRajhi
/PayNotification","payLoad":[{"date":"0527","authRespCode":"000","authC
ode":"163025","trackId":"ec4e181a-16e9-406e-a132-
bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardType":"Ma
da","udf6":"10018496416","udf10":"","amt":"5.0","udf3":"null","udf4":"n
ull","udf1":"null","udf2":"null","ref":"214721008795","udf9":"null",pay
mentId":700202214780010325,"udf7":"","udf8":"null","actionCode":"1","pa
ymentTimestamp":"2022-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"6","expYear":"2
4"}],"type":"PAYMENT"}]
RISK FAILURE
[{"result":"[{"errorText":"X","error":"IPAY00002","status":"IPAY0100045
- DENIED BY RISK"}]", "responseURL":
"http://172.22.0.121:9207/MerchDemoREST/NotfiyRsponse.htm" ,"payLoad":
"[{"authRespCode":"X","trackId":"605965227",
"transId":202101752650620,
"udf5":"UDF5","cardType":"Visa","udf6":"UDF6","udf10":"UDF10","amt":35.
0,"udf3":"UDF3","udf4":"UDF4","udf1":"UDF1","udf2":"UDF2","result":"IPA
Y0100045 - DENIED BY
RISK","udf9":"UDF9","paymentId":”600202101747330225”,
"udf7":"UDF7","udf8":"UDF8",”actionCode”:”1”,
"card":"401200XXXXXX1112","expMonth":"6","expYear":"24"}]", "type":"RISK
FAILURE"}]
[{"result":[{"status":"CAPTURED"}],"responseURL":"https://partner.se.co
m.sa/RESTAdapter/AlRajhi/PayNotification","payLoad":[{"date":"0527","au
thRespCode":"000","authCode":"163025","trackId":"ec4e181a-16e9-406e-
a132-
bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardType":"Ma
da","udf6":"10018496416","udf10":"FINALCAPTURE","amt":"5.0","udf3":"nul
l","udf4":"null","udf1":"null","udf2":"null","ref":"214721008795","udf9
":"null","origTransactionID":"202214779988486","paymentId":700202214780
010325,"udf7":"","udf8":"null","actionCode":"2","paymentTimestamp":"202
2-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"12","expYear":"
36"}],"type":"PAYMENT"}]
[{"result":[{"status":"NOT
PROCESSED"}],"responseURL":"https://partner.se.co
m.sa/RESTAdapter/AlRajhi/PayNotification","payLoad":[{"date":"0527","au
thRespCode":"124","authCode":"163025","trackId":"ec4e181a-16e9-
406ea132bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardT
ype":"Ma da","udf6":"10018496416","udf10":"","amt":"5.0","udf3":"nul
l","udf4":"null","udf1":"null","udf2":"null","ref":"214721008795","udf9
":"null","origTransactionID":"202214779988486","paymentId":700202214780
010325,"udf7":"","udf8":"null","actionCode":"2","paymentTimestamp":"202
2-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"12","expYear":"
36"}],"type":"PAYMENT"}]
[{"result":[{"status":"VOIDED"}],"responseURL":"https://partner.se.com.
sa/RESTAdapter/AlRajhi/PayNotification","payLoad":[{"date":"0527","auth
RespCode":"000","authCode":"163025","trackId":"ec4e181a-16e9-406e-a132-
bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardType":"Ma
da","udf6":"10018496416","udf10":"","amt":"5.0","udf3":"null","udf4":"n
ull","udf1":"null","udf2":"null","ref":"214721008795","udf9":"null","or
igTransactionID":"202214779988486",paymentId":700202214780010325,"udf7"
:"","udf8":"null","actionCode":"3","paymentTimestamp":"2022-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"6","expYear":"2
4"}],"type":"PAYMENT"}]
[{"result":[{"status":"NOT
VOIDED"}],"responseURL":"https://partner.se.com.sa/RESTAdapter/AlRajhi/
PayNotification","payLoad":[{"date":"0527","authRespCode":"000","authCo
de":"163025","trackId":"ec4e181a-16e9-406e-a132-
bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardType":"Ma
da","udf6":"10018496416","udf10":"","amt":"5.0","udf3":"null","udf4":"n
ull","udf1":"null","udf2":"null","ref":"214721008795","udf9":"null","or
igTransactionID":"202214779988486",paymentId":700202214780010325,"udf7"
:"","udf8":"null","actionCode":"3","paymentTimestamp":"2022-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"6","expYear":"2
4"}],"type":"PAYMENT"}]
[{"result":[{"status":"APPROVED"}],"responseURL":"https://partner.se.co
m.sa/RESTAdapter/AlRajhi/PayNotification","payLoad":[{"date":"0527","au
thRespCode":"000","authCode":"163025","trackId":"ec4e181a-16e9-406e-
a132-
bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardType":"Ma
da","udf6":"10018496416","udf10":"FINALCAPTURE","amt":"5.0","udf3":"nul
l","udf4":"null","udf1":"null","udf2":"null","ref":"214721008795","udf9
":"null","paymentId":700202214780010325,"udf7":"","udf8":"null","action
Code":"4","paymentTimestamp":"2022-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"6","expYear":"2
4"}],"type":"PAYMENT"}]
[{"result":[{"status":"NOT
APPROVED"}],"responseURL":"https://partner.se.com.sa/RESTAdapter/AlRajh
i/PayNotification","payLoad":[{"date":"0527","authRespCode":"000","auth
Code":"163025","trackId":"ec4e181a-16e9-406e-a132-
bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardType":"Ma
da","udf6":"10018496416","udf10":"FINALCAPTURE","amt":"5.0","udf3":"nul
l","udf4":"null","udf1":"null","udf2":"null","ref":"214721008795","udf9
":"null","paymentId":700202214780010325,"udf7":"","udf8":"null","action
Code":"4","paymentTimestamp":"2022-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"6","expYear":"2
4"}],"type":"PAYMENT"}]
[{"result":[{"status":"APPROVED"}],"responseURL":"https://partner.se.co
m.sa/RESTAdapter/AlRajhi/PayNotification","payLoad":[{"date":"0527","au
thRespCode":"000","authCode":"163025","trackId":"ec4e181a-16e9-406e-
a132-
bdfda42e4e91","transId":202214720027040,"udf5":"TrackID","cardType":"Ma
da","udf6":"10018496416","udf10":"FINALCAPTURE","amt":"5.0","udf3":"nul
l","udf4":"null","udf1":"null","udf2":"null","ref":"214721008795","udf9
":"null","origTransactionID":"202214779988486","paymentId":700202214780
010325,"udf7":"","udf8":"null","actionCode":"5","paymentTimestamp":"202
2-05-
27T08:27:34.155Z","card":"401200XXXXXX1112","expMonth":"6","expYear":"2
4"}],"type":"PAYMENT"}]
[{
"status": "1"
}]
If PG doesn't receive any acknowledgement from merchant , PG will keep sending the
notification request till the acknowledgement is received .
1. Payment gateway will initiate REST call to send the transaction status notification request to
merchant and wait for the acknowledgement.
2. If PG receives the acknowledgment from merchant, then Payment Gateway logs the response
and provides the transaction update to Cortex system for processing the settlement and
Payment Gateway sends the final response to merchant. The final response will be URL
redirection.
3. Merchant displays transaction result to customer.
4. In case, if PG does not receive the acknowledgment from merchant, then PG will initiate the
VOID transaction to respective scheme to reverse the transaction and there is no payment
advise initiated to Cortex.
1. Payment Gateway logs the response and provides the transaction update to Cortex system for
processing the settlement and Payment Gateway sends final response to merchant and this will
be URL redirection.
2. Merchant displays transaction result to customer.
authResp
12 M Numeric Auth response code provided by PG
Code
[{
“paymentId”:100201935044735860,
“trandata”:”<encrypted trandata>”
}]
Plain Trandata:
[{“paymentId”:100201935166676976,
”result”:”CAPTURED”,
”ref”:”935110000001”,
”transId”:”201935166561122”,
“date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
“actionCode”:”1”,
"card":"401200XXXXXX1112",
"expMonth":"12", // 1 - 2 digits
"expYear":"2036" // 2 - 4 digits
}]
Response - Acknowledgement
[{
"status": "1",
"result":”https://merchant.com/finalresultURL”
}]
If ARB payment gateway receives the acknowledgement from merchant, PG logs the
response and provide the response back to merchant. This will be URL redirection.
[{
“paymentId”:”100201935166676976”,
“trandata”:”<encrypted trandata>”,
“Error”:””,
“ErrorText”:””
}]
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”:”CAPTURED”,
”ref”:”935110000001”,
”transId”:”201935166561122”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0”,
”authRespCode”,”00”,
"authCode":"000000",
“actionCode”:”1”,
"card":"401200XXXXXX1112",
"expMonth":"12", // 1 - 2 digits
"expYear":"2036" // 2 - 4 digits
}]
Response – No Acknowledgement
[{
“paymentId”:”100201935166676976”,
”Result”:”Voided”,
”error”:”IPAY0200025”,
”trackId”:”123456”,
”amt”:”12.0”
}]
Perform a BIN lookup using this API call. Merchant can send card bin number to PG and PG
will respond with card issuer country details.
1 Bin M Numeric Card Bin First six digits of the card Number
"bin":"515735",
"id":"IPAYAq03cVHHs2q",
"password":"1$Q$VP73S2gycg@"
1 Bin C Numeric Card Bin First six digits of the card Number
2 Bank C Alphanu Bank name for the card bin issuer
m
3 Country C Alphanu Country name for the card bin
m
4 Countryco C Alphanu Country Code for the card bin
de m
5 Card C Alphanu Card Type . Ex : MasterCard /Visa
m
6 errorText C Alphanu If validation failed, then payment gateway will provide the
m with respective error description
special
chars
7 Error C Alphanu If validation failed, then Payment gateway will provide the
m respective error code
8 Status M Numeric If the request validation is success, then status will be ‘1’.
If the validation failed, then status will be ‘2’
"country":"SAUDI ARABIA",
"bin":"446404",
"countrycode":"SAU",
"card":"MADA",
"status":"1"
"error":"IPAY0100380",
"status":"2"
Recurring Billing API methods enable merchant user (via payment gateway) to manage
regular subscription payments.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata> ”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata:
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource Key
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”12345656789”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"langid":"ar",
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
{"bankIdCode":"12345d6f","iBanNum": "567896743281926354276254",
"serviceAmount":"200.00","valueDate":"20201231" },
{"bankIdCode":"1234ret3","iBanNum": "987656743281926354276254",
"benificiaryName":"DIGITAL CO",
"serviceAmount":"300.00","valueDate":"20201231" }] ,
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
},
1 status M Numeric If the request validation success, then status will be ‘1’.
If the validation failed, then status will be ‘2’
2 result C Alphanum It contains payment ID and Payment URL if the
validation success else this will be null
3 error C Alphanum If validation failed, then Payment gateway will provide
the respective error code
4 errorText C Alphanum If validation failed, then Payment gateway will provide
the respective error description
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response in case of successful validation, if failure then error code and
description will be provided. The below response will be in plain format and there is no
encryption for the below. Merchant can directly parse the response-based status and result
fields as mentioned below.
Success:
[{
"status": "1",
"result":"100201931620827468:https://securepayments.alrajhibank.com.sa/pg/pa
ymentpage.htm", //Payment ID:Paymentpage URL
“error”: null,
“errorText”: null }]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
If success, Merchant needs to frame the payment page URL like the below sample
https://securepayments.alrajhibank.com.sa/pg/paymentpage.htm?PaymentID=10020193
1620827468
If Merchant notification is disabled, then ARB Payment gateway will provide the final response in
URL redirection. Below is the sample response from ARB PG to merchant
7 udf1 O Alphanu The user (merchant) defines these fields. The field data is
m 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.
8 udf2 O Alphanu The user (merchant) defines these fields. The field data is
m 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.
9 udf3 O Alphanu The user (merchant) defines these fields. The field data is
m 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.
10 udf5 O Alphanu The user (merchant) defines these fields. The field data is
m 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.
11 amt M Numeric Transaction amount
//Redirection Parameters
“paymentId”:”100201935166676976”,
“trandata”:”<encrypted trandata>”,
“error”:””,
“errorText”:””
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”: ”CAPTURED”,
”transId”:201935166561122,
”ref”:”935110000001”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
"cardType":"Visa",
“custid”:”202014785236784”,
“actionCode”:”1”,
"card":"506968XXXXXX1063",
}]
Recurring Billing API methods enable merchant user to manage regular subscription
payments.
M/C
S.No Fields Field Type Description
/O
7 udf1 O Alphanum The user (merchant) defines these fields. The field
data passed along with a transaction request and
then returned in the transaction response.
M/C
S.No Fields Field Type Description
/O
Values Accepted :
M/C
S.No Fields Field Type Description
/O
1 = 1 bit
4 = 4 bits
8 = 8 bits
15 = 15 bits
16 = 16 bits
24 = 24 bits
32 = 32 bits
48 = 48 bits
21 browserScreenHei M Alphanu Total height of the Cardholder’s screen in pixels.
ght m Value is returned from the screen.height property.
Length 1 to 6 characters.
22 browserScreenWid M Alphanu Total width of the cardholder’s screen in pixels.
th m Value is returned from the screen.width property.
Length 1 to 6 characters.
23 browserJavaEnabl M Alphanu Value is returned from the navigator.javaEnabled
ed m property. Boolean value.
24 browserTZ M Alphanu Time difference between UTC time and the
m Cardholder browser local time, in minutes. Value is
returned from the getTimezoneOffset() method.
Length 1 to 5 characters.
25 jsEnabled M Alphanu Value whether the java script is enabled in browser
m or not.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”,
"responseURL":"https://merchantpage/PaymentResult.jsp",
"errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata
Trandata will contain below parameters encrypted with AES algorithm with CBC Mode,
PKCS5Padding with initialization vector value PGKEYENCDECIVSPC under Resource key.
[{
//Mandatory Parameters
“amt”:”12.00”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”expYear”:”2022”,
”expMonth”:”12”,
”member”:”cardholdername”,
”cvv2”:”212”,
”cardNo”,”5453********5539”,
”cardType”:”C”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
"browserJavaEnabled":"true",
"browserLanguage":"en",
"browserColorDepth":"48",
"browserScreenHeight":"400",
"browserScreenWidth":"600",
"browserTZ":"0",
"jsEnabled":"true",
//Optional Parameters
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"udf6":"12345",
"udf7":"C",
Payout Future
IBAN Number
Alphanu
3 iBanNum C Min - 24
m
Max - 35
serviceAmoun
5 C Numeric Service Amount
t
"accountDetails":[
SADAD
"billingDetails" :
{"IDType":"01","IDNumber":"1072587916","billNumber":"00100100018","billType":"P
OSTPAID","billerID":"169","billAmount":5,"transactionType":"ADVANCE"
ARB Payment gateway internally validates the request and gives payment ID and payment
page URL in the response if the validation success. If failure then, Error code and description
will be provided.
Plain Response:
Success:
[{
"status": "1",
"result":"700212030953264091:https://securepayments.alrajhibank.com.sa/pg/
TranportalVbv.htm?paymentId=700212030953264091&id=r9Ht8R4U6g9dYtY",
//Payment ID:Payment URL
“error”:null,
“errorText”: null
}]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
Merchant needs to frame the payment page URL like the below sample
https://securepayments.alrajhibank.com.sa/pg/TranportalVbv.htm?paymentId=700112030
953264091&id=r9Ht8R4U6g9dYtYg
Customer browser will redirect to ACS page and will complete the authentication. PG then process for
authorization with the respective schemes. Once payment response received from respective scheme,
then ARB Payment gateway returns the response to merchant. This is URL redirection. Below is sample
response from ARB PG to merchant,
4”:”FC”,”udf5”:”Tidal5”,”amt”:”70.0,”authResp
Code”,”00”}]
3 Error C Numeric If any error, PG will provide the error code
4 ErrorText C Alphanu PG will provide the error description if any
m transaction declined.
authRespCod
12 M Numeric Auth response code provided by PG
e
14-Authorization Extension(MADA)
Redirection Parameters
“paymentId”:”100201935044735860”,
“Error”:””,
“ErrorText”:””
Plain Trandata
[{“paymentId”:”100201935044735860”,
”result”: ”CAPTURED”,
”amt”:”10.55”,
”date”:1221,
”ref”:”935110000001”,-
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
”trackId”,”3423423”,
”transId”:”1242345345234",
“authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
“custid”:”202014785236784”,
“actionCode”:”1”
}]
Merchant forwards the API request to ARB Payment gateway, below is sample request.
Request
7 udf1 O Alphanu The user (merchant) defines these fields. The field data
m 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.
8 udf2 O Alphanu The user (merchant) defines these fields. The field data
m 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.
9 udf3 O Alphanu The user (merchant) defines these fields. The field data
m 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.
10 udf5 O Alphanu The user (merchant) defines these fields. The field data
m 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.
11 cardType M Alphanu Card type Ex : Credit card – C, Debit Card – D
m
12 browserLangu M Alphanu Value representing the browser language Returned from
age m "navigator.language" property. Length 1 to 8 characters.
13 browserColor M Alphanu Value representing the bit depth of the colour palette for
Depth m displaying images, in bits per pixel. Obtained from
Cardholder browser using the "screen.colorDepth"
property. Length 1 to 2 characters.
Values Accepted :
1 = 1 bit
4 = 4 bits
8 = 8 bits
15 = 15 bits
16 = 16 bits
24 = 24 bits
32 = 32 bits
48 = 48 bits
14 browserScree M Alphanu Total height of the Cardholder’s screen in pixels. Value is
nHeight m returned from the screen.height property. Length 1 to 6
characters.
15 browserScree M Alphanu Total width of the cardholder’s screen in pixels. Value is
nWidth m returned from the screen.width property. Length 1 to 6
characters.
16 browserJavaE M Alphanu Value is returned from the navigator.javaEnabled
nabled m property. Boolean value.
17 browserTZ M Alphanu Time difference between UTC time and the Cardholder
m browser local time, in minutes. Value is returned from the
getTimezoneOffset() method. Length 1 to 5 characters.
18 jsEnabled M Alphanu Value whether the java script is enabled in browser or
m not.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
“trandata”:”<encrypted trandata>”
}]
[{
//Mandatory Parameters
“amt”:”12.00”,
”action”:”1”,
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”cardType”:”C",
"browserJavaEnabled":"true",
"browserLanguage":"en",
"browserColorDepth":"48",
"browserScreenHeight":"400",
"browserScreenWidth":"600",
"browserTZ":"0",
"jsEnabled":"true",
//Optional Parameters
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
"udf6":"12345",
"udf7":"C",
Response
Once ARB payment gateway verifies the transaction and returns the response to the same
request.
authRespCod
12 M Numeric Auth response code provided by PG
e
[{
“tranid”: “201931951332346”,
“error”:null,
“errorText”: null
}]
[{
“paymentId”:-1,
”result”:”CAPTURED”,
”amt”:”10.55”,
”date”:”1221”,
”ref”:”935110000001”,
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
”trackId”,”3423423”,
”transId”:”1242345345234”,
“authRespCode”:”00”,
"authCode":"000000",
"cardType":"Visa",
“actionCode”:”1” ”,
"card":"506968XXXXXX1063",
}]
JS WIDGET Integration
Integration Process
1. Merchant should login to certification environment with the user credential shared by
the Acquirer Bank .
2. Ex. https://www.securepayments.alrajhibank.com.sa/mrchptl/merchant.htm
3. Merchant should copy the js plug-in url and domain url from the menu “Merchant
Process -> Plug-in Download ->Js Plugin Url” inorder to connect Payment gateway
and Key will be shared by bank prime team for Encryption and Decryption purpose.
4. Integrate the Js plug-in and plug-in resource details with merchant web page.
6. Process the response message receiving the response from Payment Gateway.
JS Plug-in URL
1. Merchant should import the js plug-in url which is copied from Plugin download menu.
Ex.<script src="https://securepayments.alrajhibank.com.sa/mrchptl/arb-widget/arb-
widget.js"></script>
2. Merchant should add the below mentioned code in their webpage.payment page will
get loaded in this div component.
</div>
//Set Values
3. Merchant should set payment values and customization values in merchant webpage
as below mentioned format.
Sample request
<script>
const reqBody={
"shipToAddress":"",
"udf15":"fifteen",
"udf14":"fourteen",
"udf13":"thirteen",
"udf12":"twelve",
"udf11":"eleven",
"udf10":"ten",
"language":"USA",
"shipToPhnNum":"7548758433",
"tranportalId":"200123",
"udf9":"nine",
"shipToCountryCd":"356",
"udf7":"seven",
"udf8":"eight",
"customerId":"",
"action":"1", //1–Purchase
"shipToLastName":"name",
"amount":"36.00",
"shipToFirstName":"tesdt",
"udf5":"6a8b21f7d9f9a4c5be6297d0f6a9b51e7461ce5b31a12861c655fc9ae300176
a",
"shipToPostalcd":"4758845",
"udf6":"816",
"udf3":"9159277647",
"udf4":"",
"udf1":"",
"udf2":"",
"merchantResponseURL":"http://www.demomerchant.com/result.jsp",
"merchantErrorURL":"http://www.demomerchant.com/error.jsp"
"contextPath":"https://products.arb.co.in/iPayRMP",
"payorIDType" : "C700",
"PayorIDNumber" : "9486576749",
"billDetails" :
"[{"issuerAgencyId":"123456789987654312","billingAccountId":"123456789"
,"billingCycle":"789456132","dueAmount":"150","paidAmount":"18","billRe
ferenceInfo":"bxcbcbhgcfgcgffg","agencyCode":"qwer"},{"issuerAgencyId":
"123456789987654311","billingAccountId":"1234567890","billingCycle":"78
9465466","dueAmount":"100","paidAmount":"18","billReferenceInfo":"xbdxc
bvcgvfgh","agencyCode":"qwty"}]"
styleReqBody = {
</script>
Domain url value which is copied from ‘resource file download’ menu should be set to
reqBody.contextPath
{"tranportalId":"IPAYef5RJ0IA5fr","trandata":"7A3694942E88633E572744674
7FF72F659364BD1A587001B5501722CF2D0EA303E7D2919C37AB4D7CA1908856CD05E11
4CFA0121DD7FFD576E7057D7EC2880EE7133077D692A20206DCEC14877CFDCE8733B982
CD731E0DB57DB0FD3B8A40534D7BCD488EE6979F05A1E7E922A81D047D62140179BAB82
D2DF17FED69F156124D3556436627BBA8C62C76DAEAFF9A0A043CA5C71E24D67758DB8A
B481F37C620452D5982D580F8B978DC0206C6AB4F4A2FD77CFD71BFED233A0C5F7B33A9
C6989908466CD90DAC61BE9890F066BF6DFFEAEB6D00DDFFFA8CED414242F5F4DD141F8
0AE4081C03B25CE08B4B62FFD04AF9C2F432E6617A56DFF610BB14D21BB23B49B410287
80183BB82B4E3E098F1303345E5830048AC51A2D8CA28F81A498ACFEA89B7984FCBAB03
6247D0E17B93A7F7BA0401D1E7FE81B3B19D2CE806E46F9393E61F68EA3ECA0FAEF66A3
09EF6F7FE1973B4145085C917CD8D72A02B86D200D913AEE2646FD3F2AF91E923C55E2C
8C29FB1C6A56829C4A95970578BA5437128E5D3C372DEE9A164FDA4CB63609D1655B47A
496565872238726271BC6D5AB70365F6D383FC38B08A7AF55070EF876D1B5B6C551E146
C25932294F472A1DCF46ABF89C16C10CFE2C968B1983CC906C5728942B2F9C115DFAEFE
2DB38844B4B23E88C0530412BE1094F65F3FD4F2C78F3CECAF0C436BCFD971B6A9CD6DD
DA30E36A9557120948C3915C45413AAEAC124CEC33CA273E4158661B49966A1108DFC2E
11718CB8CD5A545DBB25CDF7BBDE54A3E277D594235FADA6FDE03D0FB86E685C42AAA17
5E0666F0FC6E519119858E41D2F98344628B95AEDF8B43FCCF2B91BE61F8B0A8E7DAE53
118CAF81AA5B61A31E19D71E38200F422ADCAECAA43C1148746710FCB65CE9152951B9C
067488549FA538A0962AD5A318A24A93B1F3CAC60B1A6E814D3C58E931C9D884F318D68
A0A29F74E884DD8603ABB79B5F72F0CF55FCC45F2977605084E10D695AD0E0CB4F1EDF1
6E797F686F881D63E104553CB7FC49E126FD5E964234A393A22A0057A55338D16CA07CB
07219A11351EAF2088DD686A64B00CCDB3DA30392A8AFC0956E711CB26171DD662E069B
4DBFACEFBE0DE69C9B2C21F6019CD5B638A4883404C83C585404EFE6402FBF95F2FB1FE
0C674E8B4E9C4154896999CB3D80CEE8C70C635EC375E5D55F1F6EAB9F4C8236D306EBB
984EA37C99E57022481254804EDB07C7A3B7502C248254E945F34BCA6544B88FF91D369
DF13D535C0B3780ED0E42DED693880A4BCDD7BCECAD39AFF850B33A9A1127CC9C313D97
8BCE65D07C719EA69AD553252EA520A91FD17336D5A7F0BEE577F45BCA507541402B20C
08F0EA454A4B04A1DCC360FF09774C730C55143F33354EB4BAB236AE6C760513BCB7A04
7A9D3561DD191C3E0622AC8EE8E7368F538C91543DA232BA429F97CA67EF58620E502DE
E33ADB67723B0F026D4E5787E2D378860CEC452D2B6D55B408B72A3DBED3BFBE4062F0C
20863ABD10947D0273C01C67CE11A1ADE96E21942BFBAF1905678D4930C375CD1B52EC4
4E48DBC299B74B4511061FFC500FE39064F2FE426867EAD929783EE8EC34F2DEC1FFB0C
B76CC071E317B28B0FD984AF38315DDE5927ED570EC3C018EC1A94F38BC9D9F429DBE8D
1DDFA2BAFDCBFFD80DF8A56211EC4ED037E2FFA0D7EA614AB5E60FF5FBCAF88E9FA4296
05605D813826D43E8234B3D4F57F9BD8951E23CB7BF80B4D14A5C48191F724F9BC27E9B
95B075205CB94A65B34235F4F5E911B805DBCE83271D81ED08B1305AF98A520611729E8
C3EC1AD53ED8145286473BC52511B158725994F4F4B054CA4F96AC48FDAC2E87C3AFA01
F9212A5614A3F0EEA0A1A5ECA0DC602BD7B57304C28C19C84AC52232CDB454C4BB58ACF
4D66665548AE2963C9F06448379920BF18658582BD174B192569B0BC1064105E35D453F
D2161B9C277F50385C628E3B491BB790A7D4AC1DC911CA052F72E633D097B485044E598
36FF72B2D6C7A8CE86F1298C5EDE7ED73F7AB87D707D15B09FDB6CF823E707B2738698E
423AD9FB0786423DAB6427A1D5D8F92F67C7C1DB0491B489F6377A759190ED784E69224
9DF690C5A71E8559B0F402E5805EFC3855EA41EBFCD3FF163F348340EBC539C6B3BBB5A
5E77E3F60FE279F4AEF90D9BEF2A2894E694DA5166EB172CFFED1B3857E0C997F5CE834
8C74716F983B5EA744E81AC61CB2667F9550012C062542F01ADD971D91483BDB2D8CC46
025AC37C4750B4F8094E5E69BA37901DD61511C315F39FF3D337A21448C788F343E4796
CE70AEF9A9ECCABBB3353A616A9D7DDDC5F0CE9A73F8C8B51471F97A25BCE00E3DE9B77
98CFB400585A0F186C66C243A9557DDA28B8E206F54B30C1F739F640B8419655B5B995C
C3E7F36461653BFBE628C3B0424A6F1667BDDE9C91FE21A5017E6DD7ED3A75430D5DCA5
278DC004F79FFAE868B0A40B7CD519AE1A301D699EBC3BAF5470DBBD263BC6F54E285E8
51F4F31CC9ED56DDE4C35E48A261D2F0DC4CE00D8778A60D34C9D5019722BA69D3808A3
6EE9C5474900AB152328B0C0D8C10435E371709D80C209DA77D9AE6D3AE011421ADB5A0
996E63351A64A88F467D636BD339B4BD4786F509F681194282B59F6767DDA7DC9BA00A0
867DCE7D9D3A28F963967F659C74ED89F88B4A5B13129FE47D21A0A469D674A1233B60A
35F8DB233E9484CEE86DE99DED51CECE9A022B7010075B9525C62A0DCA46E3A7176297C
74E088BC3DEC4F092EF6EB18A808888D86765D4EF9FE7AC6B556D56BA5004E1176AF25B
14DEC0F429A2EFA4A26415BF4FC39358803E9A6713BD36E83511BD5D73D8F31","conte
xtPath":"http://10.44.11.71:8085/iPayARBNET","merchantResponseURL":"htt
p://10.44.11.71:8085/widgetdemo/jsp/arb/HostedPaymentResult.jsp","merch
antErrorURL":"http://10.44.11.71:8085/widgetdemo/jsp/arb/HostedPaymentR
esult.jsp"}
$("#pay").click(function(){
$("#pay").hide();
makePayment();
});
Final Response
12. authRespCode Alphanumeric This is Response Code i.e. the reason code for
the transaction. Merchant can use this code for
additional validation of the transaction and can
also use this response code field along with the
reason code description list.
(ex:00)
{"trandata":"2B1E3C6E62299D5DC43D59BC864C7003577DE32CF9EBB5ED30C7CC86DA8BA324F
1D88AFE9821E2378DDCEA5F46206837B928A1BFF528C95DDBC8F06A24A7287BE1FE1726AB0D598
70A8BC4DFB7BA6FD98F432051D2EDE899E42EEC157163B48DC2D217BD02DAC2542F25C3D0D042D
387B4E53DA8C2BE66C56D292C58CF22709563A0FF7B1078147E4632D2E2BFC4C723905BE57106C
4B4A4F4F4B8D010E2AD05331E8E051EBE61972B3DA02C3A1A712ACF9428A4E83D9D524BD4EF78A
C286B64FFF32DD29086690E44666ADB13E4097B6DC706D09C7FE9689511C4B70A58544AE3D40D3
808F451AFE15D2323C09CC42C5CBDB611F880EC46CF83CC146A0C314397A86835C3A383BBA5164
3D805533D3F332A46D14CE67E79B479A23F67882A1C889670BE5793A535EB2613D4948BFF5826A
40B4B4FD9F7AE92FA1DA1DF945143661E1781D917F52796CE58278AE5CDB21C9AB843F515670B1
7BB7D654FB5846C2426A19C37B009464A505A22FE76C447B69F6CD6949D06AB1437D3820787863
CA4278A1A0529DCA254017FFF315FB0D819D1B71495A37388CDF0992D5FECFD572EE7BC26D2C49
D3003ACAFAAC365F0CDB6FCCD05F61CD79B24A4CEF7B7466F8E989B7EE3EFF2BFC5E0B4CDDA626
D593A61AF4427A4683462302B2099063B50C634789E75EE7D3AC86444E7B998175596994026239
BA00E27AEEB2FC64236E0F29FA638FF83424F45F53FBF59DCB78ACF2FB2A2E09E1825B6507062E
C954C3D92B30EF3EAA86C911E636308DA1F115BD75830678E4391DA5F9977737BDDBC60D0A0F92
3C381C0B0044942FEA7BA703545071E04FCC42589B2C93FA5D155BF9C055F31125A5178B08EEAD
9A8B424B7EB1EDF0B507EFB79F77E2FB465D2CDB98B4C59251A13530483CCDFA6128E8E18F20E6
F942D303A317FF716105C5A77355275EAEAE8D347BA605CAE3A7F97444A09537238232763732D9
36CB414B77DC0B4C77DAC7C049BB4830FD6A3D531015F9E340E165A2B3A0084C218BECE6667C11
18D122A5200110B94AEBFE8D91222925D2A80CC5BAA7EEB201241F8BD3750870AD04BAEFB79431
00A974EE4639FE9A4E2C50DAAC8331692DF283B7A81CF807665E6FBFBF6C80E3766EEDB50A310E
25699471B5EE4378FA4AD26732CD486722E9378FF0E65FABF6037E295FBD966EAFED826684DA88
C65044F376A6A8F44218AA5EB9D3EECE28AA3A577640712D5CBCA1D15BB58E91DE48FFD7A50F77
620AA118D65BC32BC60220EE97E466ECB0B78F8AD78C32E0E0BDE7EEB8894F198EEB58984A0B55
522FA27D8453DDC333A70147CE3D9E4FA36F36A465E3BA60B8A60A012E337E2CF1B3FDA28D69D1
4838364B1C003891972FA6EA7B73A124715DA4208C91D9D27F65DB6AC718AFC923655D4BA11369
1FB227EA1BA2432920635329E10C6B16F26CF4BFD5C1675AAD73C884CC0170B34BB3FB21BC621E
27406ACA2265E59728AAA3CD71B3EF0A647C6AE71EAFE2C0CB3EFB6918EC4475F7007372657186
9C6A511DE715A5EE4E3855AC359011EB424F7B02AA4CBD15A65DA01E9C794A57092D309712B433
AC83A3F76E7C727509399BE9765D4842A9E956AB4C2C81A43CC144273367002689079DD8F8F7F2
F6BD725A108FA6F57B3156439EEF477B9EAAE2177B65DB6B783672ACADC217F52AFEBA920D1381
DEF2FC195DC96193ACABC6EABD56CDFD5B407F5AA42E85840BB7E6B266C8047538B3307FD97FAC
4B5D900226884CAA1793EC93D56F77CDCC3C3593A362C29BD25BC2B137C0A735CD4B305A8C8D31
F89C0EC433B913C37375451A75F577E77147B2A3B0D6873E82773762871E381DD05BEE88CAAFBF
0C457E201EE862A47","currCD":"356","paymentId":"100202128054842905","trackid":"
2138298712","tranAmt":36,"custid":202128045180741,"merchantResponseURL":"http:
//10.44.11.71:8085/widgetdemo/jsp/arb/HostedPaymentResult.jsp"}
After receiving the above response merchant need to decrypt the above trandata from
response with the help of decryption code.
udf6
udf7
udf8
udf9
udf10
udf11
udf12
udf13
udf14
udf15
paymentid PG PaymentID
amt Transaction amount
custid Contains Customer ID for SI
registration transaction.
If Merchant notification is disabled, then ARB Payment gateway will provide the final
response in URL redirection. Below is the sample response from ARB PG to merchant
[{
//Redirection Parameters
“paymentId”:”100201935166676976”,
“trandata”:”<encrypted trandata>”,
“error”:””,
“errorText”:””
}]
Plain Trandata:
[{
“paymentId”:”100201935166676976”,
”result”: ”CAPTURED”,
”transId”:201935166561122,
”ref”:”935110000001”,
”date”:”1217”,
”trackId”:”1003383844”,
”udf1”:””,
”udf2”:””,
”udf3”:”8870091137”,
”udf4”:”FC”,
”udf5”:”Tidal5”,
”amt”:”70.0,
”authRespCode”,”00”,
"authCode":"000000",
"cardType":"Visa"
}]
[{"date":"1007","authRespCode":"00","authCode":"000000","agencyDetails":[{"bil
lReferenceInfo":"bxcbcbhgcfgcgffg","dueAmount":"150","billingCycle":"789456132
","issuerAgencyId":"123456789987654312","billingAccountId":"123456789","agency
Code":"qwer","paidAmount":"18"},{"billReferenceInfo":"xbdxcbvcgvfgh","dueAmoun
t":"100","billingCycle":"789465466","issuerAgencyId":"123456789987654311","bil
lingAccountId":"1234567890","agencyCode":"qwty","paidAmount":"18"}],"transId":
"202128045169265","trackId":"2138298712","udf5":"c3af040d7ce24256064aa421d5b2b
39898325614eafc2f79a3dfd82059906cf5","cardType":"Visa","udf6":"816","udf10":"t
en","amt":"36.0","udf3":"","udf4":"","udf1":"1","udf2":"SI","result":"CAPTURED
","ref":"128010000008","udf9":"nine","paymentId":"100202128054842905","udf7":"
seven","udf8":"eight","fcCustId":"0","paymentTimestamp":"2021-10-
07T07:06:01.554Z"}]
When the Customer log on to the Merchant website, Merchant will show the plans page
for online shopping.
If the customer clicks “Enroll in course”, then the Order summary confirmation will be
shown.
Once the customer clicks “Confirm and Pay”, this page is shown by widget in merchant
webpage. Here the customers have to give their card credentials.
After processing transaction, Payment Gateway shall send response to the Merchant.
Best Practices:
customer or even internal audit purposes. These logs should ideally include
the customer IP address as well apart from the other transaction details.
- If Merchant opted for private and public key future. ARBPG provide two keys for
encrypting and decrypting the request and response respectively.
- Purchase Transaction: Key 1 should be used for encrypting the Request. Key 2 should
be used for decrypting the response from payment gateway.
- Supporting transaction: Inquiry, Refund and Reversal transactions should be done by
key 2 only i.e Key 2 should be used for encrypting and decrypting the request and
response respectively from Payment Gateway._Toc31220960
Overview
All pages that include Apple Pay must be served over HTTPS.
Your server must support the Transport Layer Security (TLS) 1.2 protocol and
one of
the cipher suites listed in the below.
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
To enable merchant validation and receive a session object, your server must
allow access over HTTPS (TCP over port 443) to the Apple Pay IP addresses
and domains provided below
17.141.128.199 apple-pay-gateway-pr-pod4.apple.com
17.141.129.12 apple-pay-gateway-pr-pod5.apple.com
17.171.78.9 apple-pay-gateway-nc-pod1-dr.apple.com
17.171.78.73 apple-pay-gateway-nc-pod2-dr.apple.com
17.171.78.137 apple-pay-gateway-nc-pod3-dr.apple.com
17.171.78.201 apple-pay-gateway-nc-pod4-dr.apple.com
17.171.79.13 apple-pay-gateway-nc-pod5-dr.apple.com
17.141.128.9 apple-pay-gateway-pr-pod1-dr.apple.com
17.141.128.73 apple-pay-gateway-pr-pod2-dr.apple.com
17.141.128.137 apple-pay-gateway-pr-pod3-dr.apple.com
17.141.128.201 apple-pay-gateway-pr-pod4-dr.apple.com
17.141.129.13 apple-pay-gateway-pr-pod5-dr.apple.com
101.230.204.232 cn-apple-pay-gateway-sh-pod1.apple.com
101.230.204.233 cn-apple-pay-gateway-sh-pod1-dr.apple.com
101.230.204.242 cn-apple-pay-gateway-sh-pod2.apple.com
101.230.204.243 cn-apple-pay-gateway-sh-pod2-dr.apple.com
101.230.204.240 cn-apple-pay-gateway-sh-pod3.apple.com
101.230.204.241 cn-apple-pay-gateway-sh-pod3-dr.apple.com
60.29.205.104 cn-apple-pay-gateway-tj-pod1.apple.com
60.29.205.105 cn-apple-pay-gateway-tj-pod1-dr.apple.com
60.29.205.106 cn-apple-pay-gateway-tj-pod2.apple.com
60.29.205.107 cn-apple-pay-gateway-tj-pod2-dr.apple.com
60.29.205.108 cn-apple-pay-gateway-tj-pod3.apple.com
60.29.205.109 cn-apple-pay-gateway-tj-pod3-dr.apple.com
Apple uses the following IP addresses when you register or verify your
merchant domain. If your domain is protected from public access and you
wish to complete domain verification, you should whitelist the following IP
address ranges.
17.32.139.128/27
17.32.139.160/27
17.140.126.0/27
17.140.126.32/27
17.179.144.128/27
17.179.144.160/27
17.179.144.192/27
17.179.144.224/27
17.253.0.0/16
In Certificates, Identifiers & Profiles, select Identifiers from the sidebar, then
click the Add button (+) in the upper-left corner.
Enter the merchant description and identifier name, then click Continue.
Under Identifiers, select Merchant IDs using the filter in the top-right.
Click Continue.
Click Download.
Convert the downloaded .cer file to jks file and save to the .bin file for
payment token decryption process.
Under Identifiers, select Merchant IDs using the filter in the top-right.
Place the downloaded file in the virtual directory of the server to complete
domain validation method using virtual directory.
Apple will initiate the request in below format to check the file is present or
not.
https://www.yourdomain.com/.well-known/apple-developer-merchantid-
domain-association.txt
In Certificates, Identifiers & Profiles, select Identifiers from the sidebar, then
select Merchant IDs from the pop-up menu on the top right.
Click Continue.
Click Download.
Convert the downloaded .cer file to jks file and save to the trustore
and keystore files to perform 2-way TLS handshake.
Convert .p12 file to jks file and save into trustore and keystore file.
a) Command-line tools
(i) Keytool
keytool -importkeystore -srckeystore Certificates.p12 -srcstoretype
pkcs12 -destkeystore applepaytrustore.bin -deststoretype jks
Convert .p12 file to jks file and save into .bin file.
a) Command-line tools
(i) Keytool
keytool -importkeystore -srckeystore Certificates.p12 -srcstoretype
pkcs12 -destkeystore applepaytrustore.bin -deststoretype jks
Merchant forwards the API request to ARB Payment gateway, below is sample request.
Field
S. No Fields M/C/O Description
Type
Tranportal ID. Merchant can download the Tranportal id
1 id M Alphanum
from Merchant portal
All the below request parameters encrypted and pass the
2 trandata M Alphanum
encrypted value in trandata.
The merchant success URL where Payment Gateway send
3 responseURL M Alphanum
the notification request.
[{
//Mandatory Parameters
"id":"IPAYlCR6qZF7q6w",
"responseURL":"https://merchantpage/PaymentResult.jsp
", "errorURL":"https://merchantpage/PaymentResult.jsp"
}]
Plain Trandata:
[{
//Mandatory Parameters
amt”:”12.00”,
”action”:”1”, // 1 - Purchase
”password”:”q@a68O$27@JLkcK”,
”id”:”IPAYlCR6qZF7q6w”,
”currencyCode”:”682”,
”trackId”:”123456”,
”mobileNumber”:”980765432”,
”responseURL”:”https://merchantpage/PaymentResult.jsp”,
”errorURL”:”https://merchantpage/PaymentResult.jsp”,
//Optional Parameters
”udf1”:”udf1text”,
”udf2”:”udf2text”,
”udf3”:”udf3text”,
”udf4”:”udf4text”,
”udf5”:”udf5text”,
}]
If the request validation success, then status will be ‘1’. If the validation
1 status M Numeric failed, then status will be ‘2’
It contains payment ID and Payment URL if the validation success else this
2 result C Alphanum will be null
Plain Response:
ARB Payment gateway internally validates the request and gives payment ID and payment page URL
in the response if the validation success. If failure then, Error code and description will be provided.
Success:
[{
"status": "1",
"result":"700212030953264091:https://securepayments.alrajhibank.com.sa/pg/
“error”:null,
“errorText”: null
}]
Failure:
[{
"status": "2",
"error":" IPAY0100124”,
“result”: null
}]
https://securepayments.alrajhibank.com.sa/pg/URPaypage.htm?paymentId=700112030953264091
The ARB payment gateway verifies the transaction and returns the response to the same
request.
S. Fields
M/C/O Field Type Description
No
All the below response parameters will be
1 trandata M AlphaNum
provided in trandata field
If any error during processing, PG will
2 error C Alphanum
provide the error code
If any error during processing, PG will
3 errorText C Alphanum
provide the error
If transaction success 1.
4 status M Alphanum
If transaction failure 2.
Ans. 1. Tranportal ID
2. Tranportal Password
3. Resource Key
Q2.Where to get tranportal ID , Password , Resource key and end point Url's?
Ans. Tranportal Id , Password , Resource Key and end point URL's will be shared to the merchant
via mail to their registered E-mail Id.
Ans. Resource key is unique for a terminal . It is required for encryption of request parameters
and decryption of response paramters while connecting to ARB Payment Gateway. Bank
user will share the resource key in a secured manner.
Ans. ARB Payment Gateway allows merchants to do an inquiry of already completed transaction
by passing certain details of the payment message, ARB Payment Gateway provides
response to this request with appropriate fields in the response; merchant is expected to
verify the relevant fields like Transaction amount, transaction status and other transaction
fields.
Q5. What are the action codes for inquiry ,refunds and Void transactions?
Action Codes
Purchase 1
Authorization 4
Refund 2
Inquiry 8
Void 3
Capture 5
Auth Extension 14
Void Auth 9
Q6. Based on what parameters can transactions be inquired?
Ans. Transactions can be inquired based on transaction ID , Payment ID and Track ID of original
transaction.
Ans. After the integration testing, transactions can be verified on merchant Portal
To verify if a transaction has been settled or not merchant can always refer the transaction
detail report in merchant Portal . Navigation to transaction detail report in merchant
portal is as below :
Ans.
Result Description
Byte [] encryptedText=null;
IvParameterSpec ivspec=null;
SecretKeySpec skeySpec=null;
Cipher cipher=null;
Byte [] text=null;
String s=null;
try {
cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec,ivspec);
text = encryptString.getBytes("UTF-8");
encryptedText = cipher.doFinal(text);
s = byteArrayToHexString(encryptedText);
} catch (Exception e) {
e.printStackTrace();
finally
encryptedText=null;
ivspec=null;
skeySpec=null;
cipher=null;
text=null;
return s.toUpperCase();
Note: Before encrypting encryptString value. merchant needs to encode the value with URL
Encoder.
public static String decryptAES(String key,String encryptedString) throws
Exception{
SecretKeySpec skeySpec=null;
IvParameterSpec ivspec=null;
Byte [] textDecrypted=null;
Try {
Byte [] b = hexStringToByteArray(encryptedString);
cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, skeySpec,ivspec);
textDecrypted = cipher.doFinal(b);
} catch (Exception e) {
e.printStackTrace();
finally
skeySpec=null;
ivspec=null;
cipher =null;
return(new String(textDecrypted));
Note: After decrypting encryptedString value. Merchant needs to decode the textDecrypted value
with URL Decoder.
function aesEncrypt(trandata,key)
var iv = "PGKEYENCDECIVSPC";
return encryptedHex;
Note: Before encrypting trandata value. merchant needs to encode the value with
URL Encoder.
function AESdecryption(encryptedHex,key)
var iv = "PGKEYENCDECIVSPC";
return decryptedText;
Note: After decrypting encryptedHex value. Merchant needs to decode the decryptedText value
with URL Decoder.
Encryption:
function encryptAES($str,$key)
$str = $this->pkcs5_pad($str);
$ivlen = openssl_cipher_iv_length($cipher="aes-256-cbc");
$iv="PGKEYENCDECIVSPC";
$encrypted = base64_decode($encrypted);
$encrypted=$this->byteArray2Hex($encrypted);
$encrypted = urlencode($encrypted);
return $encrypted;
Note: Before encrypting transaction data, data needs to be encoded using URL-Encoder
Decryption:
$code = $this->hex2ByteArray(trim($code));
$code=$this->byteArray2String($code);
$iv = "PGKEYENCDECIVSPC";
$code = base64_encode($code);
return $this->pkcs5_unpad($decrypted);
Chapter 4 TROUBLESHOOTING
The following table contains the known error codes and their descriptions:
By decrypting “trandata” Merchant can able to get the JSON Response. JSON response
contains all the required success transaction data.
Step1:
From payment Gateway Response, Merchant needs to check the “trandata” first.
If the “trandata” not null.
By decrypting the trandata Merchant can able to get the failure transaction description by
extracting the key “result”.
If “result” is null then merchant needs to use the key “errorText” inside “trandata” to
get failure description.
Step 2:
If “trandata” is null or empty, then merchant needs to do follow below steps.
Step 3:
To get Error Description: Use Parameter Key name “ErrorText”.
Step 4:
To get Error Code: Use parameter key name "Error”.
Step 5:
To get Transaction Id: Use parameter key “tranid" this value can be null or empty.
Step 6:
To get Payment Id: Use parameter key "paymentid" this value can be null or empty.
INDEX
A
J
API................................................. 184, 209
Attributes17, 26, 34, 41, 49, 56, 66, 74, 82, JAVA...................................................... 245
121, 133, 142, 150
K
B
Known Error Codes .................................. 252
Bank Hosted setup .................................... 12
M
C
Merchant Hosted setup ..............................12
Callback ................................................... 12
checkout .................................................. 12 P