EPG REST Integration v.1.3.1
EPG REST Integration v.1.3.1
Integration Guide
Ecommerce Payment
REST
Version: 1.2.4
Prepared by: Merchant Integration Team
Email: [email protected]
Updated: July 2019
Revision History
Date Version Description Author
Jan 2018 1.0 First Draft Noor Mohamed
April 2018 1.1 Recurrence Payments Mohamed Akram
May 2018 1.2 Central Bank Payments Mohamed Akram
May 2018 1.2.1 User Name & Password Authentication Mohamed Akram
May 2018 1.2.2 Types of Recurring Payments Noor Mohamed
June 2018 1.2.3 Authorization Mohamed Akram
June 2018 1.2.4 Payment Page Customization Mohamed Akram
August 2018 1.2.4 Refund Mohamed Akram
2. Transaction Flow
Please find the below transaction flow for Ecommerce transaction.
1. The registration call should be triggered to payment gateway in which the ReturnPath property
with Transaction details like amount , currency , OrderID ect should be mentioned.
2. Redirect to Payment Portal URL, returned in Register call with TransactionID as hidden field.
<form action=<Payment Portal URL> method="post">
<input type='Hidden' name='TransactionID' value=<TransactionID value>/>
<input type="submit" value="Submit">
3. Payer will proceed with 3D Secure Authentication process.
4. After 3D Authentication, control will returned back to Merchant’s ReturnPath property URL
received in registration call.
5. Merchant sends Finalization call to complete transaction.
{
"Registration”: {
"Currency": "AED",
"ReturnPath": "https://partner.ctdev.comtrust.ae/banktestnbad/Authorization.aspx?capture=true",
"TransactionHint": "CPT:Y;VCC:Y;",
"OrderID": "7210055701315195",
"Store": "Mobile",
"Terminal": "Recharge",
"Channel": "Web",
"Amount": "2.00",
"Customer": "Demo Merchant",
"OrderName": "Paybill",
"UserName":"Demo_fY9c",
"Password":"Comtrust@20182018"
}
}
4. Finalization
4.1. Finalization Call Properties
Required to provide the below properties while calling Finalization to complete payment.
Property Usage Comments
Request Properties
Customer Customer ID. Please refer to Appendix A MANDATORY
for Customer details.
{
"Finalization": {
"TransactionID": "755580466468",
"Customer": "Demo Merchant",
"UserName":"Demo_fY9c",
"Password":"Comtrust@20182018"
}
}
{
"Transaction":{
"ResponseCode":"0",
"ResponseClass":"0",
"ResponseDescription":"Request processed successfully",
"ResponseClassDescription":"Success",
"Language":"en",
"ApprovalCode":"421218",
"Account":"NBAD mCommerce",
"Balance":{
"Value":"0"
},
"OrderID":"123456789",
"Amount":{
"Value":"1.120"
},
"Fees":{
"Value":"0"
},
"CardNumber":"411111******1111",
Response Properties
ResponseCode This field returns the exact response code.
Success is always indicated with 0
ResponseDescription User-friendly description of the error in
ResponseCode.
Note: This field can only be used to display
the error description and
should not be used to check if transaction
was successful, to check if
Transaction was successful please use
ResponseCode field.
ApprovalCode ApprovalCode, as sent by the issuer bank.
TransactionID Reference number for ongoing transaction
OrderID It’s returned if it’s set to be auto generated
Amount Amount charged for the transaction
Balance Balance amount for the transaction that
has not yet been captured
CardNumber Masked card number
CardToken Tokenized value for the card/Account used
CardBrand Provides the details about which brand
been used for the payment.
{
"Authorization": {
"Customer": "Demo Merchant",
"Language": "en",
{
"Transaction": {
"ResponseCode": "0",
"ResponseClass": "0",
"ResponseDescription": "Request Processed Successfully",
"ResponseClassDescription": "Success",
"Language": "en",
"TransactionID": "202414738801",
"ApprovalCode": "861586",
"Account": "NBAD",
"Balance": {
"Value": "0",
"Printable": "Dhs.0.00"
},
"OrderID": "990000227113719",
"Amount": {
"Value": "100",
"Printable": "Dhs. 100.00"
},
"Fees": {
"Value": "0",
"Printable": "Dhs.0.00"
},
"CardNumber": "411111******1111",
6. Capture
When the payment is not set with Auto-Capture, then the payment has to be captured by a
separate call. Partial and Full capture ca be performed on a payment transaction. In Full
capture, the total outstanding amount will be captured and in partial capture, only a portion of
outstanding amount will be captured.
6.1. Capture call Properties
{
"Capture": {
"Amount": "1",
"Currency": "AED",
"TransactionID": "816483840525",
"Customer": "Demo Merchant",
"UserName":"Demo_fY9c",
"Password":"Comtrust@20182018"
}
}
{
"Transaction": {
"ResponseCode": "0",
"ResponseClass": "0",
"ResponseDescription": "Request Processed Successfully",
"ResponseClassDescription": "Success",
"Balance": {
"Value": "18.000",
"Printable": "Dhs. 18.00"
},
"Amount": {
"Value": "0"
},
"Fees": {
"Value": "0"
},
"Payer": null,
"UniqueID": "94ca48ec-e046-4453-a121-9bd8996aeb8a"
}
}
{
"Reversal": {
"Amount": "1",
"Currency": "AED",
"TransactionID": "816483840525",
"Customer": "Demo Merchant",
"UserName":"Demo_fY9c",
"Password":"Comtrust@20182018"
}
}
{
"Transaction": {
"ResponseCode": "0",
"ResponseClass": "0",
"ResponseDescription": "Request Processed Successfully",
"ResponseClassDescription": "Success",
"Balance": {
"Value": "17.000",
"Printable": "Dhs. 17.00"
},
"Amount": {
"Value": "0"
},
"Fees": {
"Value": "0"
},
"Payer": null,
"UniqueID": "41819851-04a9-4d71-97eb-59e0a9c6a5b9"
}
}
{
"Refund": {
"Amount": "1",
"Currency": "AED",
"TransactionID": "816483840525",
"Customer": "Demo Merchant",
"UserName":"Demo_fY9c",
"Password":"Comtrust@20182018"
}
}
"Transaction": {
"ResponseCode": "0",
"ResponseClass": "0",
"ResponseDescription": "Request Processed Successfully",
"ResponseClassDescription": "Success",
"Language": "en",
"ApprovalCode": "730274",
"Balance": {
"Value": "0"
},
"Amount": {
"Value": "0"
},
9. Recurrence Payments
Recurring Payments is a solution where a Merchant wants to save Credit Card information
(sensitive data) and payer gives him permission to make future transactions on his behalf or
may be on just one click by payer (payer does not need to provide same Credit Card
information again and again) for his future transactions.
As per PCI standards, only PCI compliant companies are allowed to store any Credit Card
sensitive data like card number. Every merchant who wants to implement Recurring Payments
kind of functionality cannot afford to be PCI compliance.
So EPG is providing “Recurring Payments” feature where merchants will redirect the payers to
EPG where they’ll provide their Credit Card details, EPG will authenticate provided data and
return a reference for saved Card details for future Recurring Payment call from same Merchant
for that specific Credit Card.
In this model, when the customer makes payment for the first time, he/she will be redirected
to payment page where he will provide his credit card number and complete the payment.
When this payment is marked as recurrence payment, EPG will store this credit number against
the TransactionID of this payment. This transaction is called Master Transaction and all the
subsequent transactions must use this master transaction id to indicate EPG to use the stored
credit card number.
To register for recurrence transaction, the below parameter to be added in the Registration call
and EPG will consider as a recurrence payment and will store the credit card number.
And in the response of registration call will have TransactionID as like normal payment call. This
ID is recurrence id and to be stored and used in all subsequent transaction. Other than this
minor change, everything else (Redirection, Finalization call) is similar to the normal payment.
1) Payer Present Scenario: In this case payer will initiate payment, once redirecting to
payment gateway credit card will be auto populated so payer need to enter only CVV
value followed by 3D authentication.
2) Payer not Present Scenario: In this method Merchant can initiate payment through
batch process without the intervention of Payer.
When merchant initiate the subsequent payment transaction, the master transaction id to be
used in the registration call. Below is the extra parameter to be added in the Registration call
request.
In the response to the subsequent registration calls, the unique TransactionID will be generated
and sent by EPG as this will be unique identifier for current payment and the same to be used
for redirection and finalization calls.
Master transaction id should not be used anywhere except in the “RecurrenceID” to indicate
EPG to use the stored credit card number. Each and every transaction will have unique
transaction id and this unique id to be used for redirection and
finalization/capture/reversal/refund calls.
In this process merchant can initiate payment without the intervention of payer. In this way transaction
will not be 3D Secure. RecurrenceID saved while registering recurrence transaction should be send as
TransactionID in below Authorization request.
Sample request:
{
"Authorization" : {
"Currency": "AED",
"TransactionHint": "CPT:Y;VCC:Y;",
"OrderID": "3333333344444",
"Channel": "R",
"Amount": "2.00",
"Customer": "Demo Merchant",
"TransactionID" :"806382547836",
"OrderName": "Paybill"
}
}
Sample response:
{
"Transaction": {
"ResponseCode": "0",
"ResponseClass": "0",
"ResponseDescription": "Request Processed Successfully",
"ResponseClassDescription": "Success",
"Language": "en",
"TransactionID": "805087587162",
"ApprovalCode": "789038",
Payment Flow:
1. Portal/Web Site initiates Registration call to EPG.
2. On successful response from EPG, Portal redirects to EPG Payment Portal.
3. Once the payment is done, EPG returns the control to ReturnPath URL set in
Registration call.
4. Portal will initiate Finalization call to EPG. This call will have following types of
responses.
Response Code Status Comments
0 Success Its online payment. No further action required.
210 Pending Its Offline payment and the required actions are described below.
Any other codes Failed Payment Failed
a) TransactionID
b) ResponseCode
c) ResponseMessage
Response Code Status of Payment Action Required by Merchant
000 OR 200 Success Initiate Finalization Call to complete the payment.
210 Still Pending Payment is still pending and wait for next notification.
095 Rejected Transaction is rejected by Bank.
LabelFont Font name for almost all other text shown on Payment Page
LabelColor Font color for almost all other text shown on Payment Page
ShowLogo Show merchant logo beside his name under Payment Detail section. Logo
to be shared separately with Etisalat for configuration.
Property Description
Customer This property maps to Customer ID as mentioned in Work Order, for
testing on staging Demo Merchant should be used as Customer ID.
Channel Payment Channel to be used for the transaction Acceptable
Values:
• Web (default)
• Terminal
• POS
• Recurring
• Phone
• Mail
• USSD
• MEC
Store The name of the store (this property is optional unless the merchant
requested support for more than one store or the default store has not
been provisioned in Payment Gateway, Merchant Integration Support
team advises the merchant on its usage upon request)
Terminal The name of the terminal (this property is optional unless the merchant
requested support for more than one terminal or the default terminal has
not been provisioned in Payment Gateway, Merchant Integration Support
team advises the merchant on its usage upon request)
Property Description
Merchant can also use this property to select one of scenarios which has
been configured on Payment Gateway – SCN:<scenario letter> e.g.
SCN:X – ‘X’ is the Scenario ID as configured and communicated by EPG
team for a particular type of transaction scenario
For controlling whenever and for which brands Payment Portal should
require payer to enter Verification Code (i.e. CVV2, CVC2, CID). VCC tag
will control verification codes for all brands, while CVV, CVC, CID will
control it for specific brand only e.g.
VCC:Y –ask verification code for all brands (Default behavior)
VCC:N – don’t ask verification code for any brand
Property Description
AccountNumber Credit or Debit Card number
ExpiryDate Specify ExpiryDate as yyyy-mm (given format is recommended, but yy-mm
mm/yyyy, mm/yyare also accepted);
These response properties can be retrieved in response to a particular call. For code
sample/syntax refer to Section 5.3.8.2 Late Bound Properties.
Property Description
ResponseCode This field returns the exact response code. Success is always
indicated with 0, and any code using WEB SERVICE component
should verify this status.
Note: The exact meaning of this value may be different depend on
the buyer’s card issuer, merchant’s account bank or the step at
which authentication failed, which means that we are unable to
provide a list of all possible descriptions, in order to receive user-
friendly description of the event please use ResponseDescription
field.
Please refer to FAQ Document for Troubleshooting guide on EPG
errors.
ResponseDescription User-friendly description of the error in ResponseCode.
Note: This field can only be used to display the error description and
should not be used to check if transaction was successful, to check if
transaction was successful please use ResponseCode field.
PaymentPortal Link to Common Payment Page where payer will be asked to input
Credit Card information for secure transaction (Returned only in
response for Registration call)
ApprovalCode This is the response coming from respective bank for Authorization
(Returned only in response forAuthorization & Finalizationcalls)
OrderID OrderID as provided by Customer or if Customer chose automated
OrderID generation in Registration or Authorization call then the
generated value (Returned only in response forAuthorization &
Finalization calls)
Balance This is the response coming from respective bank for Authorization
(Returned only in response for Capture & Reversal calls)
AccountExpiry Expiry date of Credit Card. This value will be send only while registering a
Credit Card for Recurring Payments. It will be send in DateTime format
Details/Type Below are the list of Operation name.
Name Value
Registration V
PaymentPage Query V
Payment Data Update V
Authentication Update V
CC Fraud F
CC Authorization A
CC Reversal R
CC Capture S
CB Authorization A
CB Capture S
CB Reversal R
Details/Status Below are the list of Status which can be associated for any operation
mentioned above.
Connectivity with EPG should be done using TLSv1.2, Also note that Store and Terminal must be
configurable for all above call, based on production set up We may or may not provide store and
terminal values.
Please contact Merchant Integration Support [email protected] to provision and share
below configuration.
a) Customer
b) Store
c) Terminal