ePay offers a standard payment window, which makes it easy to start receive payments by credit card without technical programming know-how. The payment window has all the payment types which ePay supports and is updated as new payment types becomes available.
Here you can read about how to set up the ePay Payment Window in your internet shop. As you have set-up the ePay Payment Window you have added 3 pages to your internet shop.
A page which opens the ePay Payment Window.
A page which your customers are directed to as the payment is approved ( acceptURL )
A page your customers are directed to as the payment is declined ( declineURL )
(Optional) A page which ePay calls directly as the payment is approved (callbackURL).
Before you start
Before you are able to open the ePay Payment window you must activate the window from within the administration of ePay. In the administration the company logo and company name must be added.
Frame and iframes:
If you open the ePay Payment Window as full screen from a frame or an iframe it is not allowed you use the same window as your internet shop. As demand from PBS the padlock must be visible in the internet browser and in a frame or an iframe it is not.
Another thing is to be attentive that as we direct the customer back to the internet shop your frameset will be broken.
Page 1: Start the ePay Payment Window
To open the ePay Payment Window you must set up a page, which includes following elements.
Javascript-code
In the top of your <head>-tag you must add following line of code, which includes a javascript on your page. It is the most important that you set up so the javascript is retrieved from the ePay server as changes may have to be made due to changes from PBS. The javascript ensures the ePay Standard Payment Window is opened up.
Note: If you are running HTTPS you have to use this instead:
<script type="text/javascript" src="https://ssl.ditonlinebetalingssystem.dk/js/standardwindow.js"></script>
HTML-code
Before the <body> tag you must implement a form. This form must include following parameters, which are send by POST to the ePay Payment Window. In the section input you can see the parameters set up in the form. Most important is that the form is set up as showed in the example below.
Opening the ePay Payment Window
The payment window works on 2 different manners. Either as popup or in the same window as the internet shop. The parameter windowstate controls this behaviour.
If you want to open the Standard Payment Window automatic without the customer clicks a button you must include following HTML code to your <body> tag.
onload="open_ePay_window()"
Even if you have set up the Standard Payment Window to open automatic it is also a great idea that the customer is able to activate the window by use of a button. The problem is that customers who are using Windows XP Service Pack 2 or another ant virus program may have problems by opening the ePay Payment Window as these programs blocks popup windows automatically. To solve this problem you must include a button on the page, by which the customer can activate the Standard Payment Window. Therefore insert the following HTML-code within you <body> tag.
If the ePay Payment Window does not open automatically please click on the button below to open it.
Notice! If you are using a pop-up blocker, you must hold down the CTRL key as you click the button.
<input type="button" value="Open the ePay Payment Window" onClick="open_ePay_window()">
Page 2: AcceptURL
The page in your customers are directed to as the payment is approved is called the accept URL. You define this URL in the parameter acceptURL. In the documentation in the section output acceptURL you can see which parameters ePay sends to the accept page (GET). As you are using the ePay Standard Payment Window you don’t need to use the relay-script.
Page 3: DeclineURL
Is the page in your internet shop, which the customers are directed to if the payment is declined. This is usually the page where the customer chooses which type of payment to pay by. You set this URL in the parameter declineURL. As the acceptURL you don’t need to use the relay script as you are using the ePay Standard Payment Window.
Page 4: CallbackURL
To ensure that your internet shop receives an answer from ePay as the payment is approved you can also use the callbackURL. As the payment is approved ePay calls an URL (server to server) at the same time as the customer is sent to the acceptURL. This feature must be used if it is important that your ordering system is updated as the payment is approved.
Own parameters
See below how to sending parameters along with the ePay Payment Window
Example
<input type="hidden" name="accepturl" value="http://www.yourdomain.com/sti/fil.html?parameter1=things¶meter2=otherthings" />
You can use the parameter ”paymenttype” to control the type of payment you would like to use. Is this parameter not defined the payment will be handled as ordinary credit card to PBS and VISA/MasterCard. Is the payment of type 3D secure you must set the paymenttype to the value of 1, 2 or 3 (read more about this in the documentation).
Maintaining sessions
To maintain your customers sessions on the website of your internet shop you must use the field http_cookie.
The amount in minor units. E.g. DKK 125,75 must be given as 12575 in the amount field.
amount
Integer
Minor units
The amount in minor units. E.g. DKK 125,75 must be given as 12575 in the amount field.
accepturl
String
Max. 255 bytes
The URL the customers are directed to as the payment is approved. In the section Output acceptURL you can see the GET parameters ePay uses.
declineurl
String
Max. 255 bytes
The URL the customers are directed to as the payment is declined. In the section Output declineURL you can see the GET parameters ePay uses.
callbackurl
String
Max. 255 bytes
This URL is used to update your ordering system. As the payment is approved ePay calls this URL as it was an acceptURL (server to server).
Instantcallback
Integer
0 = asynchronous
1 = instant
If you use the callback, you can use this parameter to determine when your callbackURL is called.
0: CallbackURL called asynchronous. The client might be sent to acceptURL before callbackURL is called. 1: CallbackURL is called before the client is returned to acceptURL
Set this field to 1 and the payment is captured instantly. As default this value is 0 and the payment is to be manually captured in the administration of ePay.
ordertext
String
HTML / TEXT
In this field you can define a text for receipt, which is shown to you customer. The text is shown on the first page the ePay Payment Window opens. The field may contain HTML code and ordinary text. If HTML is used please make sure it is set up correct otherwise it may make changes to the general layout of the ePay Payment Window.
group
String
Max. 100 bytes
Which group the payment must be associated.
description
String
Max. 1024 bytes
Description of the payment. This description can be seen in the administration in ePay.
md5key
String
Max. 255 bytes
This field is used to create a MD5 stamp in the internet shop, which is validated by ePay in the auth-script to avoid customers manipulate with the data. The stamp has to be created by following information: MD5(currency + amount + ordreID + "key set-up in ePay").
authsms
String
Max. 8 bytes
If you set a mobile number in the parameter a SMS is sent as the payment is approved. Remind it costs DKK 0,25 for each SMS sent. Works only for production payments
authmail
String
Max. 100 bytes
If you would like to receive an email with information about the payment as it is approved.
cardtype
ARRAY
0
= ALL (default)
1
= DANKORT
2
= VISA_DANKORT
3
= VISA_ELECTRON_FOREIGN
4
= MASTERCARD
5
= MASTERCARD_FOREIGN
6
= VISA_ELECTRON
7
= JCB
8
= DINERS
9
= MAESTRO
10
= AMERICAN_EXPRESS
12
= EDK
13
= DINERS_FOREIGN
14
= AMERICAN_EXPRESS_FOREIGN
15
= MAESTRO_FOREIGN
16
= FORBRUGSFORENINGEN
17
= EWIRE
18
= VISA
19
= IKANO
20
= OTHERS
21
= Nordea e-betaling
22
= Danske Netbetaling
24
= LIC_MASTERCARD
25
= LIC_MASTERCARD_FOREIGN
26
= PayPal
If you want to restrict which payment cards that can be used in the shop, this field must be used.
If you do not specify anything in this field, set it as
default = 0
It is only those cards that are registered in ePay, which will be shown. If you have agreements to a paymenttype that is not being shown in ePay Payment window, then contact ePay to get it added.
Example:
"1,2" = if you want the client only to pay by Dankort or Visa/Dankort.
The payment cards that ends in "_FOREIGN", means it is a foreign-issued debit cards. I.e. those with high fees.
Payment Card 3 (VISA_ELECTRON_FOREIGN) covers both VISA and VISA Electron.
Note!
cardtypes like VISA_ELECTRON and MAESTRO cannot be used for subscriptions!
windowstate
Integer
1 = popup
2 = same window
1 = popup
2 = same window (full screen)
Default = 1
ownreceipt
Integer
0
Receipt in the standard pyment window
1
Own receipt
By default the receipt is shown to the card holder in the ePay Payment window before the card holder is redirected back to the webshop. If you want to skip the receipt page within the ePay Payment Window and display the receipt page in your own webshop you should set this field to the value 1.
NoticeThis setting is only available if you have already set the field named windowstate to the value 2.
Default = 0
HTTP_COOKIE
String
Max. 8000
Session / http cookie. Used to maintain your own sessions.
use3D
Integer
1 =
3D Secure is used
2 =
ONLY 3D Secure is used
3 =
3D Secure is not used
To enable 3D secure this field is used. When activated the user is directed to his/her netbank to logon and pay.
addfee
Integer
0 = No fee added
1 = Fee added
If you would like to add the transaction fee to the amount = 1.
The amount to the card types is set up in the adminstration to ePay.
Default = 0
subscription
Integer
0 = disabled
1 = enabled
To create a subscription (recurrent payments). If this field is set to the value of 1 you will receive a parameter named subscriptionid on the acceptURL as GET parameter. This subscription identifier can be used to do recurrent payments by use of API or the ePay administration.
subscriptionname
String
Max. 100 bytes
Used together with the parameter "subscription".
If subscription = 1 a subscription payment is created, and then you can specify the name / your reference to the subscriber in this field. If this field is not specified, then set up the subscriber order id as name
precardtype
int
1
= Dankort / Visa Dankort
2
= eDankort
3
= Visa
4
= MasterCard
5
= Visa Electron
6
= JCB Cards
8
= Diners Club
9
= American Express
10
= eWire
11
= Forbrugsforeningens kort
12
= Nordea e-betaling
13
= Danske Netbetaling
26
= PayPal
I you want to sent the customer directly to the payment form. Then you can specify the payment card in this field.
If no value value is entered then the customer must choose cardtype.
It is possible to deliver an order over several rounds (if, for example. Consisting of parts which must first be ordered home), by specifying the "split payment" of value 1 Payment will subsequently be increased continuously as the customer receives the various parts of the order.
Note that this function is only supported by selected payment modes (standard PBS forms of payment). Field becomes split payment set to 1 for a card type that does not support function, the payment will be implemented as a regular payment which can not be raised over several times.
googletracker
String
Your Google Analytics ID
This field is used in order to track your orders using Google Analytics.Typically it will be in the form UA-XXXXX-X.
Transaction identifier which the payment is created with in the ePay system. (reference to the payment in ePay).
orderid
String
OrderID associated to the payment in ePay (reference to the payment in your own system)
amount
Integer
Amount authorized on the customer’s credit card. Minor units
cur
Integer
Currency code of the payment.
date
Date
Timestamp of the payment.
time
Integer
Date when the payment is completed. For example, the value "1223" is equal to the time. 12:23
eKey
String
MD5 stamp generated by amount + orderid + tid + secret key. This parameter is only transmitted if you choose the accept MD5 stamp on the accepURL.
fraud
Integer
This parameter is only transmitted if you choose to enable fraudcontrol. If fraudcontrol is enabled this value is 0 if no fraud and 1 if there are any suspicion about fraud for the payment.
transfee
Integer
The transaction fee added to the customer. This parameter is only added if the parameter "addfee" is set to 1.
HTTP_COOKIE
String
The cookie of your internet shop which is used to maintain sessions. You must set the cookie again on your acceptURL.
subscriptionid
Integer
If the parameter "subscription=1" is send the auth-script and the subscription is created the unique identifier for the subscription is transmitted as this parameter.
cardid
Integer
Which paymentcard the payment is completed with.
cardnopostfix
Integer
Postfix is the last 4 digits of card number on the card, the customer has used. Can be used for presentation of the receipt to the customer.
Output declineURL
Data type
Description
Notice
No GET parameters are returned to the declineURL. You have the opportunity to give GET parameters that You want to get returned to the declineURL. They must be specified as GET in the "declineURL".