Welcome and congratulations on your choice to use eBG.bg as your e-payments platform. This page will guide you through the process of integration with eBG.bg. Here you will find a detailed description of payment processing through eBG, together with examples of Php, Python, Java and .Net applications implementing the merchant interface and all necessary resources.
For more information, please read the payment process description.
For more information about the integration please contact us.
For more information about integrating utility bill paymens, please look here.
Get an eBG.bg logo from here.
The Php application is available in the following bundles:
- Php 5 module in bulgarian
- Php 5 module in english
- Php 4 module in bulgarian (tested with Php 4.3 and Php 4.4)
The following additional software is required:
- openssl -- for generating PKCS#7 structures containing the merchant's signature of the message
- curl -- for HTTP POST requests to eBG.bg (optional, if allow_url_fopen is "On")
- simplexml -- xml parser - for parsing the responses from eBG.bg - already included in PHP 5 (for PHP 4 use simplexml44).
From here you can download eBG.bg payment modules for:
PHP with a passphrase
Php application that uses a passphrase (HMAC-SHA1) - in case the standard integration with X.509 certificate is not possible or convenient:
- module with HTTP(S) POST integration - initiate payment via the client's browser; option for online notification for completed or rejected payments
- module with XML/HTTP(S) integration - initiate payment via direct communication between merchant's server and eBG.bg; option for online notification for payment status change; option for online check of payment status, initiated by the merchant's server
The Python module requires Python 2.4+ and has been tested on Python 2.5. It requires:
- M2Crypto -- for generating PKCS#7 structures containing the merchant's signature of the message
tested with 0.17 - working, with 0.18 - problems when running inside Apache web server
An example Django application is also available.
The Java application requires Servlet 2.3 or Servlet 2.4 web server. It requires:
- Bouncy Castle crypto provider -- for generating PKCS#7 structures containing the signature of the message
- Commons Http client -- for HTTP POST requests to eBG.bg
The .Net library requires Microsoft .NET Framework 1.1 or Microsoft .NET Framework 2.0. Also the following module is required:
You can generate a self-signed X.509 certificate using openssl:
openssl req -outform PEM -out merchant_ebg.cer -keyform PEM -keyout merchant_ebg.key -newkey rsa:1024 -sha1 -new -x509 -days 3650 -set_serial 10
The data entered for subject name can be anything, eBG.bg uses only the public key data from the certificate:
Country Name (2 letter code) [AU]:BG
State or Province Name (full name) [Some-State]:Bulgaria
Locality Name (eg, city) :Sofia
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Sample merchant
Organizational Unit Name (eg, section) :IT
Common Name (eg, YOUR name) :78654321
Email Address :
You can save the certificate and the private key in pkcs12 (pfx) format if necessary:
openssl pkcs12 -export -inkey merchant_ebg.key -in merchant_ebg.cer -out merchant_ebg.pfx