UMAPI .Net Integration Manual v2.8 PDF
UMAPI .Net Integration Manual v2.8 PDF
Net
Integration Manual
Version 2.8
Contents
1 INTRODUCTION........................................................................................................5
1.1 Purpose and Objective ....................................................................................5
1.2 Audience ...........................................................................................................5
1.3 Assumptions / Exclusions ..................................................................................5
1.4 Terminology / Conventions .............................................................................5
1.5 Contact Point ....................................................................................................6
1.6 Pre-requisites for UMAPI Integration ...............................................................6
2 TECHNICAL OVERVIEW...........................................................................................9
2.1 High-level Features and Functionality ...........................................................9
2.2 Transaction Flows ............................................................................................10
2.2.1 Credit Transaction using UMAPI Browser Submission ......................11
2.2.2 Credit Transaction using UMAPI Server Submission ........................14
2.2.3 UMAPI Debit Transaction Engine .......................................................18
2.3 URL Redirection (Success and Failure) ........................................................21
2.4 Message Format .............................................................................................21
2.4.1 Credit Payment Request (From Merchant to eNETS) .....................22
2.4.2 Credit Payment Notification (From eNETS to Merchant) ...............29
2.4.3 Credit Payment Acknowledgement (From Merchant to eNETS).31
2.4.4 Credit Payment Response (From eNETS to merchant) ..................32
2.4.5 Debit Payment Request (From Merchant to eNETS) ......................35
2.4.6 Debit Payment Notification (From eNETS to merchant) ................37
2.4.6 Debit Payment Acknowledgement (From Merchant to eNETS) ..39
2.4.7 Debit Payment Response (From eNETS to merchant)....................40
2.4.8 UMID Payment Request (From Merchant to eNETS) ......................42
2.4.9 Supplementary Message ....................................................................49
3 ARCHITECTURE.......................................................................................................50
3.1 Package Structure ..........................................................................................50
3.2 Main Components ..........................................................................................51
3.3 Functions ..........................................................................................................51
3.4 Supporting files ................................................................................................52
4 API INSTALLATION AND SETUP .............................................................................53
1 Introduction
1.1 Purpose and Objective
The main purpose of the UMAPI Merchant Implementation guide is to provide merchants with
the necessary technical information when integrating their applications with eNETS II, using the
Unified Merchant API (UMAPI).
This manual contains a technical overview of the UMAPI, the payment transaction flows as well
as the message formats required between eNETS II and the merchant system. This manual also
contains step-by-step setup instructions and sample scripts or java programmes which
merchants will find useful in their integration efforts with eNETS II.
1.2 Audience
The UMAPI Merchant Implementation Guide is intended as a technical guide for merchant
developers and system integrators who are responsible for designing or programming the
necessary online applications to integrate with eNETS II.
Merchant developers and system integrators are expected to have working knowledge of the
Java 1.4 SDK platform, and Web / Application server technology. In addition, a basic
understanding of the purpose / types of digital certificates is also essential.
Term Description
Customer A buyer using the internet to make a payment
Merchant An entity that offer goods or services for sale on the internet
UMAPI Unified Merchant Application Programming Interface
URL Uniform Resource Locator. Specifies the "address" of a resource in the internet
DSA Secure Hash Algorithm
Keystore A special file that stores public and private keys used in Public Key Infrastructure
(PKI). A keystore file can be generated using a Java tool called "keytool"
Signing This certificate can be obtained from any Certificate Authority. It is used to
cert digitally sign a message
SSL Secure Socket Layer
OpenPGP Non-proprietary protocol for encrypting data using public key cryptography. The
OpenPGP protocol defines the standard formats for encrypted messages,
signatures and certificates for exchanging public keys
UMID Universal Merchant ID
5
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
1.5 Contact Point
Please feel free to address any comments or feedback that you may have on the UMAPI
Integration manual by:
Email: [email protected]
Hotline: (65) 6274 1212
The UMAPI .Net can run on any system that satisfies the following requirements:
1. Hardware
The Merchant API can run on any operating system that supports Microsoft .NET Framework
1.1 and above.
2. Operating System
Merchant must have an operating system that supports Windows 2000 or above.
3. Browsers
The recommended browsers that customers should use when making payment with eNETS
over the internet is Microsoft Internet Explorer 5.0 and above; Mozilla Firefox 2.0 with
support for javascript and cookies.
4. IP Static Address* :
The IP address of the merchant’s server to server redirection URLs (for notification, POST or
Transaction End messages) should be static as eNETS does not support dynamic IPs.
eNETS will refresh the IP caching on a scheduled weekly basis to support merchant’s change
of IP address by 1 Apr 2016
eNETS will not be able to refresh the system on emergency basis as the refresh exercise
will affect the whole gateway.
For change of your IP address, merchant should inform eNETS at least 2 weeks in
advance before implementing any IP changes at merchants end. Upon receiving the
request from the merchant, eNETS will inform the merchant on the next scheduled
refresh date of eNETS system to register the new IP address of merchant.
6
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
5. Merchant SSL Certificates* (Applicable if the merchant uses HTTPS protocol)
Merchant should provide the following information to eNETS at least 3 weeks in advance
before implementing the changes at merchant’s end:
a) UAT Certificates
i) CA Root Certificates
ii) Intermediate Certificates /Chain Certificates (if any)
b) Production Certificates
i) CA Root Certificates
ii) Intermediate Certificates /Chain Certificates (if any)
Pre-production
The CA Root/Intermediate UAT Certificates will be loaded onto the eNETS UAT
environment. Merchants are required to perform at least one round of testing to
ensure that end-to-end transaction flows are normal with the new certificates.
eNETS reserves the rights to reject loading the certificates without getting prior
approval from merchants if the CA Root Certificates are suspected or found to be
causing abnormalities to the eNETS system. In such scenarios. eNETS will inform the
merchant before or after removal, depending on the situation.
Post Production
eNETS reserves the rights to remove the Merchant’s CA Root Certificates at any
point of time without getting prior approval if the CA Root Certificates are
suspected or found to be causing abnormalities to the eNETS system. In such
scenarios, eNETS will inform the merchant before or after removal, depending on
the situation.
All the points mentioned above are also applicable for the subsequent change or
renewal of Merchant’s SSL certificates after the integration.
* Points 6 & 7 are applicable for merchants who are using any of the eNETS features and
services listed below & its associated impact :
eNETS Notifications feature
Services to consumers will be disrupted as merchants will not receive the Server to
Server notifications and responses.
8
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2 Technical Overview
This chapter contains the following sections:
Merchants are offered multiple online payment services from the eNETS Payment Gateway,
such as Credit Card Payment, and Direct Debit Payment. All these services can be accessed
through a single interface, the Unified Merchant Interface, which listens to https requests at
www.enets.sg/enets2/PaymentListener.do.
Depending on the merchant type, merchants can send transaction requests to eNETS in one of
the following ways:
UMAPI gives merchants the flexibility of implementing their payment modules using one of
these submission modes:
a. Browser Submission
The merchant supplies UMAPI with payment information, and gets a ready-to-send
message from UMAPI. They perform their own http post, usually through a customer’s
browser redirection to eNETS.
b. Server Submission
Merchant supplies UMAPI with payment information, and UMAPI will form the
message and establish a server-to-server connection to eNETS to send the message
and receive the payment response.
All information exchanged between the merchant storefront and the eNETS Payment gateway
is in XML format. Please refer to Section 2.4 Message Format for more details.
The link from the merchant to eNETS is secured through the use of the OpenPGP protocol. The
data is encrypted using eNETS Gateway public key, and merchants have to digitally sign the
messages with their private certificate for non-repudiation.
9
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.2 Transaction Flows
]
Credit Transaction using UMAPI Browser Submission
Credit Transaction using UMAPI Server Submission
UMAPI Debit Transaction Engine
10
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.2.1 Credit Transaction using UMAPI Browser Submission
If a customer uses the internet to make payment using the Credit Card gateway and the merchant uses the Browser Submission mode, the
flow described below will apply.
Note: In browser submission mode, the 3D Secure processes happen "transparently" between eNETS II and the customer’s browser.
Merchant
Server
Internet
1
Internet/Leased Line
10b 11
NETS
2
3
10a 4
5
6
7 eNets
Customer
8
9
12 If customer chooses to cancel the transaction at Step 8, he will be redirected by eNETS Credit to the merchant’s cancel URL. There is no
post or notify message sent to the merchant for cancelling of transaction.
Non 3D Flow
3D Flow
If a customer uses the internet to make payment using the Credit Card gateway and the merchant uses the Server Submission mode, the flow
described below will apply:
Merchant
Server
Internet
1
Internet/Leased Line
1
3 2
5
NETS
eNets
Customer
Figure 2. Transaction Flow for Credit Transaction (Server Submission – Non 3D Flow)
1.1.Consumer
Customer sends
sendsPayment
Payment
Request
RequesttotoMerchant
Merchant
Internet
` 2. UMAPI passes
Internet 3. eNETS2 returns 3D Parameters information to eNETS2
7. eNET2 sends txn status to
Customer to UMAPI
Consumer Merchant via UMAPI
5. Customer redirects to
ACS for authentication eNETS2
5. Consumer redirects to
ACS for authentication
The UMAPI for Debit System is an internet-based direct-debit payment system that allows users to make payment over the World Wide Web. The
Merchant server is most likely a Web Server machine that communicates with the UMAPI Servers which in turn communicates with the Bank.
The web flow (and the message flow) of this application is shown in the following diagram.
Each of the steps is thereafter described in greater detail.
Merchant Web Internet Payment
Bank Server
Server Gateway
1. Merchant Services
Consumer selects to pay by
Direct Debit, starting the
transaction process
6a. Notification
Bank Reference Code, IPG Transaction Code,
6b. Notification Bank ID, Bank signature
Full Bank Notification Message, Stage 000002
Merchant Reference Code, IPG signature
Stage 000006
7a. Acknowledge
Merchant Reference Code, Status,
Merchant signature
Stage 000007
7b. Acknowledge
Full Merchant Acknowledge message,
IPG Transaction Code, IPG signature
Stage 000003
Note: i) Merchant’s notification URL (6b) to receive full bank notification message on step 6b.
ii) Merchant’sTxnEnd2 (9b) URL to receive updated transaction status. [server-to-server]
iii) Merchant’s TxnEnd (9d) URL to receive bank TxnEnd message.
20
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.3 URL Redirection (Success and Failure)
Merchants need to develop their own success and failure pages and update the URLs to the
eNETS Administration and Report Portal or in credit transactions only, specify URLs during
payment request to eNETS.
Upon the completion of a transaction, the browser will automatically redirect to the merchant’s
success or failure page according to the transaction status. For detailed information, refer to
section 2.4 Message Format.
All messages exchanged between the merchant and eNETS are XML messages. They are
signed and encrypted using openPGP, then posted to the eNETS II payment gateway as a
parameter ‘message’. Message formats are specified in XML schema. Refer to Appendix A for
message schema and examples.
In the tables that follow, the Payment Mode and Inclusion columns include the values in the
following table:
Field Meaning
Payment Mode Indicates which payment mode the field is applicable.
C – Common to all payment modes
CC – Credit Card Payment
DD – Direct Debit Payment
Inclusion R – Required
C – Conditional
O – Optional
N – Not applicable
Message Formats:
Credit:
Credit Payment Request (From Merchant to eNETS)
Credit Payment Notification (From eNETS to Merchant)
Credit Payment Acknowledgement (From Merchant to eNETS)
Credit Payment Response (From eNETS to merchant)
Debit:
Debit Payment Request (From Merchant to eNETS)
Debit Payment Notification (From eNETS to merchant)
Debit Payment Acknowledgement (From Merchant to eNETS)
Debit Payment Response (From eNETS to merchant)
UMID:
UMID Payment Request (From Merchant to eNETS)
21
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.1 Credit Payment Request (From Merchant to eNETS)
The Payment Request message is sent by the merchant to eNETS to initiate internet credit card
payment transactions.
Note: For Credit Card Authorisation transactions, there is a need to perform capture of the
transactions to complete the transaction. Authorisation reserves the credit limit for a
particular credit card while capture deducts the actual amount from the credit card.
Authorised transactions that are not captured are automatically released after a period
of time depending on the issuing bank. (The issuing bank of the credit card decides the
period.) Partial capture is allowed. (e.g. Authorisation amount is $800 but only captured
$600.) Only a single capture is allowed for a single authorisation. (e.g. when authorisation
amount is $800, if $600 had been captured, another capture of $200 is not allowed.)
Capture Reversal is not allowed in eNETS gateway.
Optional supplementary message may be submitted together with the Credit Payment Request
to eNETS for additional processing. Refer to section 2.4.9 (Supplementary Message) for details.
23
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
10 PaymentType Payment mode of credit 5 CC R R
card txn
AUTH – Authorisation
CAPT – Capture
AUTH and CAPT is where the money
is first reserved from the
cardholder’s credit account upon
successful Authorisation. The money
is only deducted when the
Merchant captures the Auth
transaction. If the Auth transaction
is not captured within a stipulated
time (determined by bank), the
reserved credit will be restored.
SALE – Sale
This is where the money is deducted
from the cardholder’s credit
account immediately.
CRED – Credit
Is where the deducted money will
be refunded back to the
cardholder's credit account?
RAUTH – Reverse
Authorisation
RSALE – Reverse Sale
RCREDIT – Reverse Credit
11 Pan Credit Card Number 19 CC O R
24
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
16 SuccessUrlPara Query String to be 255 C O N
ms appended to the Merchant
Success URL, which displays
the success page to
shopper.
E.g.
session_id=1111&member_id
=23
17 FailureUrl eNETS will redirect to this 80 C O N
page when errors are
encountered during
payment.
25
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
23 CancelUrl URL to redirect to when 80 CC O O
shopper clicks cancel during
the payment process.
Fields 26 – 29 are applicable for 3D Secure transactions. Merchants who connect to a third-
party MPI for credit card number authentication may send the authentication results to
eNETS.
26
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
28 Status Indicates whether a 1 CC R R
transaction qualifies as an
authenticated transaction.
Y = Authentication
Successful.
Customer was successfully
authenticated. All data
needed for clearing,
including the Cardholder
Authentication Verification
Value, is included in the
message.
N = Authentication Failed.
Customer failed
authentication. Transaction
denied.
U = Authentication Could
Not Be Performed.
Authentication could not be
completed, due to
technical or other problems.
A = Attempts Processing
Performed.
Authentication could not be
completed, but a proof of
authentication attempt
(CAVV) was generated.
29 ECI Electronic Commerce 2 CC C C
Indicator
30 Param1 Reserved 100 CC N O
Valid values:
- "RPP" (Using UMAPI for RPP
Transaction)
- "IAP" (see section 8 Using
UMAPI for IAP Transaction)
Note:
- Strings in uppercase
- "RPP" for specific
merchants only
- "IAP" for merchants
subscribed to
International Airline
Program.
27
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
31 Param2 Reserved (for RPP 550 CC N O
28
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.2 Credit Payment Notification (From eNETS to Merchant)
29
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
7 MerchantTxnRef Unique reference code 20 C R R
assigned by merchant for this
transaction.
Note: MerchantTxnStatus of 0000 or any other value means the merchant accepted the result
of the transaction.
31
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.4 Credit Payment Response (From eNETS to merchant)
eNETS redirects the customer to the merchant’s success or failure URL depending on the
transaction status. As part of this redirection, the Payment Response message will be posted.
In a server-to-server credit card transaction, the Payment Response is returned in the server
response.
33
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Payment Inclusion
Length Mode
Credit Credit
Browser Server
12 Pareq PAreq value which is forwarded - CC R R
to the Access Control Server as
part of the customer redirection.
13 TermUrl termurl value (contains eNETS url 20 CC R R
which the customer gets
redirected to by the Access
Control Server after 3D
authentication).
14 md md value which is used by the 20 CC R R
MPI to track / reference a
particular transaction.
15 acsUrl acsurl field value (contains 20 CC R R
customer’s Access Control Server
url).
16 errorCode errorcode value thrown by the 20 CC R R
MPI
(If any) which will be forwarded
to the Access Control Server.
Note: The values for S/N 12 – 16 are returned to and to be passed by the merchant if the credit
card is 3D secure enrolled.
34
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.5 Debit Payment Request (From Merchant to eNETS)
36
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.6 Debit Payment Notification (From eNETS to merchant)
37
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Payment Inclusion
Length Mode
13 GW_Value_date Date on which transaction will be 10 C R
valued by Gateway.
Format is DD/MM/YYYY
14 Bank_ID Uniquely identifies each Bank. 4 C R
15 Bank_Ref_Code BANK reference code for this 20 C R
Transaction.
16 Bank_Status Status of the transaction. 5 C R
17 Bank_Time_Zone Time Zone (relative to GMT) of the 6 C R
transaction.
18 Bank_Txn_Date Date on which total amount is 10 C R
debited
from the Customer account.
Format: DD/MM/YYYY
19 Bank_Txn_Time Time at which total amount is 8 C R
debited from the Customer
account.
20 Bank_Remarks Free form text by BANK to be used 30 C R
for display or logging purpose.
Note : Merchant may choose to read only the necessary parameters to reference back to the
transaction.
38
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.6 Debit Payment Acknowledgement (From Merchant to eNETS)
39
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.7 Debit Payment Response (From eNETS to merchant)
40
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max
Length
16 GW_Txn_Time Time of transaction as recorded by Gateway. Format: 8
hh:mm:ss
Note : Merchant may choose to read only the necessary parameters to reference back to the
transaction.
41
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.8 UMID Payment Request (From Merchant to eNETS)
The UMID Payment Request should contain both Credit Payment Request and Debit Payment
Request.
Note: For UMID transaction, the customer can opt for Credit or Debit service
for payment. Thus it is required for merchant to send credit & debit
payment requests in order to process UMID transaction.
42
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
7 MerchantTxnRe Unique reference code 20 C R R
f assigned by the merchant
for this transaction.
43
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
15 SuccessUrl eNETS will redirect to the 80 C O N
merchant Success URL upon
successful purchase
E.g.
session_id=1111&member_id
=23
17 FailureUrl eNETS will redirect to this 80 C O N
page when errors are
encountered during
payment.
44
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
21 PostUrl eNETS will post the 80 CC O O
transaction information to
the Merchant POST URL for
logging and inventory
update. This URL is not visible
to the shopper.
45
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
28 Status Indicates whether a 1 CC R R
transaction qualifies as an
authenticated transaction.
Y = Authentication
Successful.
Customer was successfully
authenticated. All data
needed for clearing,
including the Cardholder
Authentication Verification
Value, is included in the
message.
N = Authentication Failed.
Customer failed
authentication. Transaction
denied.
U = Authentication Could
Not Be Performed.
Authentication could not be
completed, due to technical
or other problems.
A = Attempts Processing
Performed.
Authentication could not be
completed, but a proof of
authentication attempt
(CAVV) was generated.
29 ECI Electronic Commerce 2 CC C C
Indicator
30 Param1 Reserved 100 CC N O
Valid values:
- "RPP" (see section Error!
Reference source not found.
Error! Reference source not
found.)
- "RECURRING" (see section 5
Using UMAPI for Recurring
Transaction)
Note:
- Strings in uppercase
- "RPP" for specific
merchants only
- "RECURRING" for
merchants subscribed to
generic recurring
payment service.
46
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
S/N Field Name Remark Max Paymen Inclusion
Length t Mode Credit Credit
Browser Server
31 Param2 Reserved (for RPP, see 550 CC N O
section Error! Reference
source not found. Error!
Reference source not found.)
Param3 Reserved 100 CC N O
32
Param4 Reserved 100 CC N O
33
Param5 Reserved 100 CC N O
34
ClientType Indicates what kind of 1 C O N
35
device the customer used
for the transaction.
W – From computer browsers
M – From mobile device or
tablet browsers/applications.
48
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
2.4.9 Supplementary Message
Supplementary message is optional. If required, it shall be submitted together with the Credit
Payment Request.
If the eNETS Gateway receives a “CCPrefix” string in the APC field, it shall assume that the Data
field contains the first few digit of a credit card number up to a maximum of 8 digits. The eNETS
Gateway shall populates the Data field’s value onto the eNETS Creditcard Payment Page
Credit Card Number field, and subsequently presents it on the browser. The Data field’s value
populated on the eNETS Creditcard Payment Page Credit Card Number field is NOT editable.
49
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
3 Architecture
Package Structure
Main Components
Functions
Supporting files
The UMAPI is provided as a dynamic link library (dll), umapi.dll. The package structure is as
follows:
com.wiz.enets2.transaction.umapi
|
|__ Merchant
|__ CreditMerchant
|__ DebitMerchant
|__ NetsConfig
|__ data
|
|__ TxnReq
|__ CreditTxnReq
|__ DebitTxnReq
|__ TxnNotify
|__ CreditNotify
|__ DebitNotify
|__ TxnAck
|__ CreditAck
|__ DebitAck
|__ TxnRes
|__ CreditTxnRes
|__ DebitTxnRes
|__ exceptions
|
|__ TransactionError
|__ TransactionException
|__ logging
|
|__ logger
|__ util
|
|__ PGPHelper
|
|__ util
|
|__ Encryptor
|__ HttpClient
|__ PGPGeneratorApp
|__ PGPImpl
|__ PGPKeyGenerator
|__ XMLUtil
50
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
3.2 Main Components
3.3 Functions
The unified merchant API enables merchants to perform transactions via credit card or direct
debit. It facilitates merchants with the functions described in Table 1 below.
Function Description
formPayReq Form a payment request message based on eNETS II message specifications.
The result is an encrypted string ready to be sent to eNETS II payment
gateway.
formAck Form an acknowledgement message based on eNETS II message
specifications. The result is an encrypted string ready to be sent to eNETS II
payment gateway.
doPayment Send out a payment request message to eNETS II payment gateway.
unpackNotificatio Unpack notification message from eNETS II payment gateway. It also decrypts
n and verifies the message.
51
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
unpackResponse Unpack payment response message from eNETS II payment gateway. It also
decrypts and verifies the message.
queryTxnStatus Query transaction status at eNETS II payment gateway.
The eNETS payment gateway listens to HTTP request from merchants. The Unified Merchant API
gives merchants the flexibility of posting the message via API, or forming the message via API
but posting it in their preferred way. The two methods are further elaborated as follows:
Use the ‘doPayment’ functions. Merchants only need to supply UMAPI with payment
information; UMAPI will form the message and send out to eNETS II payment gateway.
Merchants can also specify proxy server if necessary. This method takes care of the HTTP
post for merchants. It is simple and easy to implement.
Use the ‘formPayReq’ / ‘formAck’ functions. Merchants supply UMAPI with payment
information and get a ready-to-send message from UMAPI; they then do their own HTTP
post to eNETS II. This method gives merchants the freedom of implementing their own
business logic, e.g. re-try mechanism after time-out, and using more advanced
technology, e.g. proxy authentication. It is more complicated and suitable for more
advanced merchants. Internally, ‘doPayment’ actually makes use of the ‘formPayReq’
function.
log4net.dll-1.2.10
SecureBlackbox.dll – 6.0.0.137
SecureBlackbox.PGP.dll – 6.0.0.137
52
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
API installation and setup
This chapter contains the following sections:
Pre-requisites for deploying UMAPI.
Merchant Information Package
Hosting of Domain Name / Internet Connectivity
Server Setup
Installation of UMAPI
Generation of Public/Private key pair
Encryption of Private key password
Configuration of eNETS Merchant Admin
Review of UMAPI Sample scripts
Customisation of scripts by merchant
Configuration of UMAPI Config files
The merchant should meet, or have the necessary software / hardware as well as technical
support to meet all the pre-requisites stated in section 1.6 Pre-requisites for UMAPI Integration,
before progressing to further steps.
The NETS Merchant Technical Support team will provide the following information to the
merchant upon completion of registration formalities:
Merchants need to have a valid domain name (e.g. www.abc.com) and public IP address, as
well as connectivity with the internet (typical implementation is subscription via a leased line
with an Internet Service Provider) for eNETS to communicate with them.
For internet transaction payments, merchants need to install a web server, develop a web site
with a payment checkout page (contains payment details, e.g. payment amount, goods /
services customer is paying for etc.), and ensure the web site has internet connectivity.
The use of an application server for internet transaction payments is optional. Security
requirements may require merchants to separate the web and application tiers into two
physical servers. 53
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Merchants can perform the mandated actions above either by following the installation
instructions available in the accompanying technical guides or by engaging a vendor (system
integrator) to perform the job.
The merchant needs to install an operation system (OS) capable of supporting .NET Framework
1.1 or above.
The UMAPI comes in the form of a Winzip file (UMAPI.zip). Merchants need to extract the files to
a temporary directory, and copy the contents to the appropriate directories.
54
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
The UMAPI contains the following files:
Note:
The "etc" is defined in the following sample files:
a. Credit Browser: cc_browser_request02.aspx
b. Credit Server: cc_server_response.aspx
c. Debit: dd_browser_request02.aspx
A toolkit is provided to the merchant to generate the PGP Keys. Launch the PGP KeyGenerator
application by executing the executable file PGPGeneratorApp.exe in the bin directory.
Field Description
Selected directory Output directory for the generated key pair. The public key will be saved
as ddMMyyyyHHmmss-pub.pgp.asc and the private key as
ddMMyyyyHHmmss-priv.pgp.asc. It is advisable to rename the newly
generated files.
User Id Primary user id bound to the certificate.
Key Pass Passphrase for the private key.
Retype Key Pass Retype passphrase for the private key.
Expiry Date Format is dd/mm/yyyy.
After successfully generating the key pair, the following message will be displayed:
56
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
57
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
3.11 Encryption of Private key password
The private PGP key generated in the previous step is protected by a key password. The key
password is stored in the merchKeyPass property in UMAPI configuration file NETSConfig.xml.
Merchants have the option of storing the password as clear text or in encrypted format.
A utility class is provided to the merchant encrypt to their key password using Triple DES
symmetric encryption.
When this utility is run for the first time, it will generate a new secret key and save it to a file
called umapikey.dat.
The secret key can be copied to a directory of your choice. Subsequent usage of the utility for
encryption/decryption will make use of the generated secret key hence the location of the key
file needs to be specified in the configPath property in NETSConfig.xml.
Copy the encrypted text to the merchKeyPass property in NETSConfig.xml, and set the
encryption flag to true.
For UMID, merchants should login with the login of individual MID (grouped under UMID) and
follow the same procedure as they perform for Credit/Debit MIDs. Also note that merchants
need to send a request to the eNETS Support Team to grant them access to the UMID Cert
Upload functions for UMID.
Note: If the menu items indicated on the left-hand side of the screen shot below does not
appear, merchants should contact eNETS personnel (see section 1.5 Contact Point) to
update their access rights.
Go to Merchant Admin -> Public Key -> View Public Key to check the current Public Keys.
59
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Go to Merchant Admin -> Public Key Upload-> Request Public Key Upload, Click Submit
60
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Go to Merchant Admin -> Public Key Upload-> Upload Public Key, enter password from
email, Click Submit. Click Choose File, select the Public Key file you generated for this MID,
click Submit.
Go to Merchant Admin -> Public Key -> View Public Key to check the current Public Keys.
Record the "Cert ID" of the new Public Key uploaded. You will use the Cert ID in your code.
If the merchant is using server-side submission and the merchant’s server is behind a proxy
server/firewall, the merchant needs to specify the proxy settings in NETSConfig.xml. Please refer
to section 3.14 Configuration of UMAPI Config files for the properties to set.
If the proxy server requires authentication, and merchant wants to store the proxy Password in
encrypted format, refer to section 3.14 Configuration of UMAPI Config files or instructions on
generating the encrypted password.
61
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
3.14 Configuration of UMAPI Config files
Configurations for UMAPI are stored in the file NetsConfig.xml, which contains the following
values:
Field Description
merchPrivKey Location of merchant private OpenPGP certificate
merchKeyPass Password for merchant’s private OpenPGP certificate
netsPubKey Location of eNETS public OpenPGP certificate
payURL eNETS server URL. Only applicable for server submission.
queryURL eNETS URL to query the transaction status
usePGP Must be set to true.
useProxy Applicable for server submission. If the merchant’s server is behind a proxy
server, set this flag to true.
proxyHost Proxy server IP
proxyPort Proxy server Port
proxyUsername Username for authentication to proxy server (if required)
proxyPassword Password for authentication to proxy server (if required)
encryption Flag to indicate whether the merchKeyPass and proxyPassword fields are in
clear text or encrypted format. Set to true to indicate that encryption is
turned on.
configPath If password encryption is turned on, this field specifies the folder containing
the secret key file. E.g. c:/umapiconfig/
TimeOut Connection expiry time.
logLevel Type of logging level to be set E.g. debug, info, error
logFile Path of log file (umapi.log) to be written on server.
protocol Protocol to be used E.g: "https"
In order to use relative path, merchant need to add one more parameter when instantiate a
Merchant object, where the parameter will be the starting path for the relative path.
Sample of instantiate merchant using relative path, where the NETSConfig.xml stored in folder
D:\work\umapi.net\etc\config.
Please note that if the merchant is using relative path but does not instantiate merchant object
with above new method, the starting folder will be vary based on the merchant application.
62 always be “%windir%\system32\inetsrv”.
For application host in IIS, the starting folder will
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Below is the sample of use this information with the Assembly.Load method
Assembly.Load(“umapi, Version=1.1.3.0,Culture=neutral,PublicKeyToken=28b77be8188e5cb8”)
Merchant can print the hexadecimal format of public key token for a specific assembly using
the following Strong Name tool (Sn.exe, which can be found in .NET SDk folder) command:
sn —Tp umapi.dll
63
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
4 Develop Scripts
The merchant should look through the UMAPI sample scripts provided by eNETS, and
understand how the scripts work together to form a payment process with eNETS.
The merchant should customise the sample UMAPI scripts provided by eNETS according to their
business and technical requirements.
Additional checks and database updates prior to composing the payment request message or
responding to a notification message may be added where appropriate.
To send a Recurring transaction payment request, the merchant needs to embed the Recurring
parameter in the credit payment request message formatted through UMAPI before sending to
eNETS payment collection page. The additional field in the message which represents the
Recurring transaction is the field Param1.
The following ASP .NET code fragment illustrates the additional requirements on formatting the
credit payment request message.
64
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
To send an IAP transaction payment request, the merchant needs to embed the IAP
parameters in the credit payment request message formatted through UMAPI before sending
to eNETS payment collection page. The additional fields in the message which represents the
IAP transaction are fields Param1 and Param2.
Merchants who wish to use the Airline program should pass in param1 as “IAP” and param2
with Airline Ticket Number in UMAPI message.
…
myTxnReq.setCreditTxnReq(myCreditTxnReq) ;
myTxnRes = myCreditMerchant.doPayment(myTxnReq) ;
…
%>
65
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
The following ASP .NET code fragment, illustrates the sending of suppliementary message
togother with the associated credit payment request message.
myCreditMerchant =
(CreditMerchant)Merchant.getInstance(Merchant.MERCHANT_TYPE_CREDIT,"c:\\umapi\\etc\\");
myTxnReq.setCreditTxnReq(myCreditTxnReq);
messageS = myCreditMerchant.formPayReq(myTxnReq);
supMsgS = "CCPrefix:42681234";
%>
66
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
8 Response codes
eNETS Gateway will return the response code for the transaction in field netsTxnRespCode of
the Payment Response Message.
For Credit transactions, the response code can either be a two-digit number returned from the
merchant’s acquiring host or a four-digit number which indicates an error response from eNETS
Gateway.
For the online transaction status query feature, the response returned to the merchant is in the
format of <stage>_<responsecode>.
The following table shows the different values that will be returned by the Acquirer Host in field
39 of the host response message.
Note: Response Code returned by different acquirer bank may have different meaning.
72
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Code Error Description Reasons Action
20008 Session Errors Time out due to customer Customer will not be
inactivity. allowed to proceed and will
be informed that his/her
session has expired. They will
then be redirected back to
the Merchant site.
20009 Bank API configuration Inform Banks to reconfigure
error API.
20010 Failed to receive Check Gateway.
acknowledgement
from Gateway
20011 No match for Gateway Double check Gateway
public certificate. public certificates.
76
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Code Error Description Reasons Action
1011 User cancelled Nil
transaction before
completion.
1035 Invalid UMID
77
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Appendix B Change History
.NETS Version
1 5 Amended samples codes for credit and debit txns. 20 Dec 2006
78
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Version No. Revision No. Description Approval
Date
1 13 Updated Section 2.2.2.2 – Updated descriptions for 06 Jul 2007
step 3 and 4.
Updated Section 2.3.4 – Added 5 as a new status for
netsTxnStatus field.
Updated Section 2.3.1 – Updated description for field
TxnAmount
Updated Section 2.3.2 – Updated description for field
TxnAmount
Updated Section 2.3.4 – Updated description for field
netsAmountDeducted
Updated Section 2.3.5 – Updated description for field
TxnAmount
Updated Section 2.3.6 – Updated description for field
TxnAmount
Added in Section 6 – Added response code 1234
1 14 Amended error codes in Section 6.
Added in Section 6 – Added response code 1302
1 15 Add the merchant-date-time, merchant code for May 2008
debit pay request
Add Note to identify notify and TxnEnd URL to be
implemented in Debit Flow.
Update 3-D transaction flow.
Add the cancel status for the cancelling of
transaction.
1 16 Added the .NET version of UMAPI
79
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Version No. Revision No. Description Approval
Date
1 19 To add on the sample code on debit 12 September
notification/acknowledge process to read the 2008
notification message parameter from eNETS. (Section
4.2.1.3.3)
1 20 Section 2.3.8 Update the length of netsresponse 23 September
code.
Section 2.3.4
Update the comment on netsTxnRespCode.
1 22 Section 2.3.1 14 October
To add the field length for CAVV, purchaseXID, status,
ECI
Section 2.3.4
Update the comment on netsTxnRespCode.
Added a new column to show the inclusion for
browser-to-server and server-to-server transactions.
Section 4.2.1.1.1
To add the sample code to set MerchantTxnDtm for
Credit Payment Request
Section 4.2.1.1.2
To add the sample code to get PaymentMode for
Credit Payment Response
Section 4.2.1.1.3
To add sample code for to get payment mode,
submission-mode, txn-Amount, merchantTxnDtm,
netsTxnDtm and netsTxnStatus.
Section 6.1
Grouped the table per category of response codes.
1 23 Section 2.3.6 Debit Payment Notification 23 Nov 2008
Remove PaymentMode, SubmissionMode,
netsTxnDtm.
Add Dest_exchg_Rate, GW_Txn_Date, GW_Txn_Time,
Bank_ID, Bank_Ref_Code, Bank_Status,
Bank_Time_Zone, Bank_Txn_Date, Bank_Txn_Time,
Bank_Remarks, Retry, version and reserved
parameters.
80
Section 2.3.8 Debit Payment Response
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Version No. Revision No. Description Approval
Date
Rename netsTxnDate to GW_Txn_Date.
Rename netsTxnTime to GW_Txn_time.
Add Bank_time Zone, GW_Time_zone,
Dest_Exchg_Rate, Dest_Curr_Code, Src_Txn_Amt,
Src_Exchg_Rate, Src_Curr_Code, Retry, version and
reserved parameters
Section 4.2.1.3.2
To add sample code
Section 4.2.1.3.3
To add sample code
1 24 Section 2.3.7
To remove the netsCertID from acknowledge
message
Section 4.2.1.3.3
To remove the setting of netsCertID from sample
code
To add the code to set the merchantCertID
1 25 Updated and changed manuals style and formatting
Updated information on different areas
Update credit acquirer response code “79”
Updated date and time format
1 26 Update the format of merchant transaction date in
section 2.3.5
1 27 Updated sections 2.3.6 (Field 21)and 2.3.8 (Fields 7 21 Dec 2010
and 10) remarks for informational fields.
1 28 Amended contact details in section 1.5. 04 Mar 2011
o Address from Motorway Building to Central Plaza.
o Email address from
[email protected] to
[email protected]
o Added hotline number 65) 6274 1212 and
operating hours.
1 29 - Updated section 2.3.6, remark column of field 12: 11 Apr 2011
Notification.netTxnStatus is an intermediate status
and SHALL NOT be used by merchant for
processing.
- Updated section 2.3.8, remark column of field 5:
Field contains the final transaction status.
1 30 - Updated section 2.3.4, “Max Length” of “Pareq” 20 May 2011
field set to “-“
- Updated section 4.1.8 Installation of policy JARs 08 June 2011
for JDK 1.5 & 1.6
1 31 - Updated Table of content, section 8 is included. 07 Sept 2011
- Updated section 2.3.1, added new fields to table
related to RPP & RECURRING
- Updated section 6, new eNETS credit response
code 1117 is added.
- Added new section 8, Using UMAPI for Recurring
transaction, note that section numbers of
following this section are changed.
81
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Version No. Revision No. Description Approval
Date
1 32 - Updated section 4.1.17, added 3 new fields 27 Oct 2011
TimeOut, logLevel, logFile, protocol which are to
be added to configuration file “NetsConfig.xml”
82
eNETS .NET Merchant Integration Guide
GENERAL
UMAPI .NET Merchant Integration Manual
Version No. Revision No. Description Approval
Date
2 7 - Updated section 1.6(Pre-requisites for UMAPI 1st March 2016
Integration) with the following items :
4. Static IP Address
5. Merchant SSL Certificates
- Updated section 2.4.1 on supplementary
message.
- Added section 2.4.9 (Supplementary Message).
- Added new section 8 (Using Credit Payment
Request with Supplementary Message.
- Update Appendix A.3 Credit Response Codes to
add new Response Code 2005
- Added section 6 – UMAPI for Recurring
Transaction
- Rename section 6 to 7
- Rename section 7 to 9
2 8 - Updated the table in section 2.2.1 on Notification 8th Sep 2016
and Notification Acknowledgement messages
- Updated section 2.4.3. Remove Transaction
Rejection Code & Merchant Internal Error, Invalid
messages
83
eNETS .NET Merchant Integration Guide
GENERAL