PHP Classes
elePHPant
Icontem

Estonian e-payments solution: Submit payments to Estonian and Finnish banks

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2011-04-20 (4 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 156 All time: 7,756 This week: 1,122Up
Version License PHP version Categories  
estonian-epayments 1.4GNU Lesser Genera...5.0PHP 5, E-Commerce, Web services
Description Author  
This package is specific mainly for applications used in Estonia Estonia .

This class can be used to submit payments to Estonian and Finnish banks.

It can generate HTML for payment buttons that when clicked lead the user to sites of supported banks on which they can authorize payments of configurable items and amounts.

The class can also validate whether the payments were completed successfully by handling requests to return pages where the user browser is redirected after the user has completed a payment.

Currently it supports payments processed by the banks and Web payment services:

Swedbank (Estonia)
SEB (Estonia)
Sampo (Estonia & Finland)
Nordea (Estonia & Finland)
Estcard (Estonian credit card web service, Mastercard, Visa, etc)

Picture of Kristo Vaher
Name: Kristo Vaher <contact>
Classes: 4 packages by
Country: Estonia Estonia
Age: 31
All time rank: 14586 in Estonia Estonia
Week rank: 1490 Down6 in Estonia Estonia Equal

Details provided by the author  
Estonian e-payments solution for PHP
1.4

Kristo Vaher 2011 http://www.waher.net
Licensed under LGPL http://www.gnu.org/licenses/lgpl-3.0.txt
Published http://waher.net/archives/852

E-payment systems and bank services are everyday and common in Estonia, but both developers and companies, who implement e-payments to websites, tend to ask large sums of money for solutions that should be relatively simple. Having developed e-payment systems for years, I had not put together a single solution for this very common problem until now, when Estonia has adopted Euro as its main currency. This solution is released open source, under LGPL license.

Please note that while this e-payment system is now considered stable and has not run into major problems ever since it was released, some of the connections have been tested more often than others and it is still recommended to test the implementation and make sure it works accordingly before going live.

E-payment systems and Bank e-services that are supported with this solution:

Swedbank (Estonia)
SEB (Estonia)
Sampo (Estonia & Finland)
Nordea (Estonia & Finland)
Estcard (Estonian credit card web service, Mastercard, Visa, etc)

Requirements:

Solution is built with PHP and requires PHP support. The website or service that implements this solution should be modern and utilize UTF-8 for data encoding. This e-payment system assumes that it gets its data as UTF-8 and acts accordingly. This system may not work properly if website is not encoded in UTF-8. OpenSSL support is also required from the web server for some epayment profiles. Multibyte String extension support is required for certain UTF-8 calculations.

Files descriptions:

config.epay.php – Configuration file for each profile. This also includes testing environment access informatin, if that profile has it (read the comments). Whenever setting up a e-payment link, this file should be configured accordingly.

class.epay.php – Main class, this file also calls the configuration file and expects the file to be in the same directory as the class.epayments.php file. This file should not be edited, unless necessary for some reason.

gate.epay.php – This is gateway file that is used to submit data to the bank service or parse the result from the service.

example-submit.php – This is example file, which generates the form that submits order data to gateway and gateway then submits it to the bank.

example-return.php – This is example return page, which receives returned information from bank.

Example:

This package has a working example that is easy and quick to set-up. Package includes SEB bank e-service testing environment. The only thing you have to do, to get the example up and running, is download the package below and upload it to your website under root or subfolder. For example, if you upload the files to:

http://www.example.com/epayment/

Then you have to change only two configuration settings in example-submit.php file, related to order information and return URL. Using the previous example, the lines should be changed accordingly:

line 22. $config['gateway-url']=’http://www.example.com/epayment/gate.epay.php’;
line 23. $config['return-url']=’http://www.example.com/epayment/example-return.php’;

Don’t forget to change the example.com website address to your own website address. Nothing else needs to be changed to test if the class works.

From example to Live implementation:

The example runs on ‘seb-est’ (SEB Estonia) profile. To use another bank, such as Swedbank, you need to assign correct payment-type before generating the form (like in example-submit.php file). Then you also need to assign proper values to config.epay.php to the profile. The settings in configuration file are commented and self-explanatory. It is important to note though that some e-payment services offer no testing environments and other epayment services cannot even be tested without the testing environment being set up by the other side first (such as the case with Estcard solutions).

Other notes:

Please report any bugs or problems you find either here in comments or personally to my e-mail kristo@waher.net
  Files folder image Files  
File Role Description
Plain text file class.epay.php Class Main class, this file also calls the configuration file and expects the file to be in the same directory as the class.epayments.php file. This file should not be edited, unless necessary for some reason.
Accessible without login Plain text file config.epay.php Conf. Configuration file for each profile. This also includes testing environment access informatin, if that profile has it (read the comments). Whenever setting up a e-payment link, this file should be configured accordingly.
Accessible without login Plain text file gate.epay.php Aux. This is gateway file that is used to submit data to the bank service or parse the result from the service.
Accessible without login Plain text file example-submit.php Example This is example file, which generates the form that submits order data to gateway and gateway then submits it to the bank.
Accessible without login Plain text file example-return.php Example This is example return page, which receives returned information from bank.
Accessible without login Plain text file readme.txt Doc. Consult this for further information
Accessible without login Plain text file seb-est-bank-public.pem Data SEB payment test environment key
Accessible without login Plain text file seb-est-client-private.pem Data SEB payment test environment key

 Version Control Unique User Downloads Download Rankings  
 0%Total:156All time:7,756
 This week:0This week:1,122Up