VibeFox ePay.bg for PrestaShop — Help
Requirements
PrestaShop: 8.0 to 9.x.
PHP: 8.0 or later. The module refuses to install on older PHP versions.
Currency: Bulgarian lev (BGN), euro (EUR) or US dollar (USD). The cart is charged in its own currency with 2 decimals. For carts in other currencies the payment method is hidden at checkout.
ePay.bg account: you need the customer number (MIN) and the secret key from your ePay.bg merchant profile: the live ones from www.epay.bg, the test ones from demo.epay.bg (a test account is registered separately). You also need to enter the notification URL of your shop in the merchant profile.
VibeFox license key: bought on vibefox.net. One key works on one domain.
Installation
1. In the back office go to Modules > Module Manager and click Upload a module. Choose the module ZIP file.
2. When the upload finishes, click Configure, or find VibeFox ePay.bg Gateway in the module list later and click Configure.
3. Paste your VibeFox license key into License key in the license block at the top of the Configure page and click Activate (see License key).
4. Enter the test and/or live MIN and secret key (see Configuration).
5. Copy the URL shown in the section Payment notifications (IPN) into the field URL for receiving notifications of the ePay.bg merchant profile, in both the demo and the live profile. Without it no order is created.
6. Turn on Enable/Disable and click Save. Place a test order in test mode, then turn off Test Mode.
On install the module creates the order status ePay.bg payment on hold. PrestaShop offers a new payment module for all currencies, countries and customer groups. You can limit them in Payment > Preferences.
Configuration
All settings are on the module page: Modules > Module Manager > VibeFox ePay.bg Gateway > Configure. Each Save button saves the whole page. Above the fields the page shows an error when the default currency of the shop is not BGN, EUR or USD, a warning when the gateway is enabled but the MIN or secret key of the selected mode is empty (it is then hidden at checkout, and saving shows the same warning), and Test mode is on: payments go to demo.epay.bg and no real money is charged. while test mode is on.
ePay.bg
Enable/Disable: Enable ePay.bg Payment Gateway turns the payment method on or off. Default: off.
Title: the payment method name customers see at checkout. It is also the payment method name stored in the order. Default: ePay.bg. Required.
Description: the text shown under the payment method at checkout. Default: Pay securely via ePay.bg with a bank card or your ePay.bg account.
ePay.bg account
The customer number (MIN) and the secret key are shown in your merchant profile on www.epay.bg (live) and demo.epay.bg (test account, registered separately).
Test Mode: enables test mode. Customers are sent to the ePay.bg demo environment and the requests are signed with the test credentials. Default: on.
Test Merchant ID (MIN): the customer number (MIN) of your demo.epay.bg merchant account.
Test Secret Key: the secret key of your demo.epay.bg merchant account (64 characters).
Live Merchant ID (MIN): the customer number (MIN) of your www.epay.bg merchant account.
Live Secret Key: the secret key of your www.epay.bg merchant account (64 characters), used for the HMAC-SHA1 signature.
Saved secret keys are never shown again. The field stays empty and shows Saved — leave empty to keep it. Type a new value only to change it. Spaces and line breaks in pasted keys are removed when you save.
Clear saved secret keys: tick a key and click Save to remove it. An empty field keeps the saved value.
Payment notifications (IPN)
The notification tells your shop that a payment request was paid, denied or has expired. The field Notification URL shows the URL to enter as URL for receiving notifications in the ePay.bg merchant profile, live and test. With friendly URLs it looks like https://your-shop/module/wcp_epaybg_gateway/notify, possibly with a language code such as /en/. Copy the URL exactly as the settings show it. Orders are created only by these signed notifications; the customer returning to the shop does not create or pay an order.
ePay.bg reports these results for each invoice:
Notifications without a valid checksum are rejected, and ePay.bg keeps sending them. The checksum is checked with the secret key of each mode that has one, so payments started before you switched between test and live are still confirmed. A payment must arrive in the mode its request was made in; otherwise the order goes to ePay.bg payment on hold. Without the notification URL in the merchant profile, no order is created.
Payment request
Invoice Prefix: digits only (up to 10), put in front of the cart ID to form the ePay.bg invoice number, for example 00001 + 123 = 00001123. Use different prefixes for different shops on one ePay.bg account. Other characters are removed when you save, with a warning. Changing the prefix later is safe: open payment requests are found by the invoice stored for them. Default: 00001.
Expiration Time: the time after which an unpaid payment request expires; ePay.bg then reports it as expired and no order is created. Choose 1, 3, 6, 12, 24, 48 or 72 hours. The time is sent in Bulgarian time, whatever the time zone of your shop. Default: 24 hours.
Language: the language of the ePay.bg payment page, English or Bulgarian. Default: English.
Order Status After Payment: the order status set after a successful payment.
Advanced
Logging: writes payment requests and notifications to logs/epay_bp_debug.log.php in the module folder. The file cannot be opened from the web. Secret keys and card data are not logged. Default: off. Errors are always logged, also while it is off.
Log: shows the size and the latest entries of the log. Click Clear log to empty it.
Delete Data on Uninstall: when on, uninstalling the module removes the gateway settings and the log. The ePay.bg payment records, the order status ePay.bg payment on hold and orders are always kept. Default: off.
Checkout
At the payment step the customer chooses the payment method (by default ePay.bg) and confirms. The customer sees Redirecting to ePay.bg for payment... and is sent to ePay.bg with a signed payment request for the cart total in the cart currency, with the invoice number and the expiration time. The payment shows on ePay.bg as Cart and the cart number. The page also has a Pay via ePay.bg button in case the redirect does not start, and a Cancel button. On ePay.bg the customer pays with a bank card or an ePay.bg account. No order exists yet at this point.
After paying, the customer returns to your shop. The order is created only when the signed ePay.bg notification arrives. If it has already arrived, the customer sees the standard order confirmation page. If not, a Payment confirmation page says Thank you. Your payment is being confirmed by ePay.bg — your order will be created as soon as ePay.bg confirms it, and you will receive an e-mail. with the buttons Check again and Back to checkout.
If the customer cancels on ePay.bg, the customer is back at checkout with The ePay.bg payment was cancelled. You can try again or choose another payment method. If ePay.bg has reported the request as denied or expired, the message is The payment was not completed. You can try again or choose another payment method. The cart is kept. A new attempt for the same cart uses the same invoice number.
If the cart cannot be paid with ePay.bg, the customer stays at checkout with a short message, for example ePay.bg payments are temporarily unavailable. Please choose another payment method. or that ePay.bg does not accept payments in the cart currency.
The notification works while the shop is in maintenance mode and is not blocked by the country restriction of your shop.
The module takes one-time payments on ePay.bg only. It has no refunds from PrestaShop, no saved cards, no subscriptions or recurring payments and no EasyPay or B-Pay cash payment codes.
Orders
Order statuses
No order yet: the customer was sent to ePay.bg and has not paid, the notification has not arrived yet, or ePay.bg reported the request as denied or expired. Only the cart exists.
Payment accepted, Delivered or ePay.bg payment on hold: the payment was confirmed. The status follows Order Status After Payment. The payment is recorded with the STAN as the transaction ID (or the invoice number if there is no STAN), and a note shows the invoice number, the payment date, the STAN and the BORICA code.
ePay.bg payment on hold after payment: the payment arrived, but not for what the cart says now: the cart total or currency was changed after the payment request, or the notification came in the other mode (test or live) than the request. The payment is not recorded as paid. The same happens when the cart already has an unpaid order, for example a cancelled one or one placed with another payment method. The note explains the reason. Check the payment in the ePay.bg merchant panel and fulfil or refund the order manually.
If a payment arrives for an order that is already paid or refunded, the status is not changed, and a note asks you to check for a double payment in the ePay.bg merchant panel. A late denied or expired notice never changes a paid order.
ePay.bg payment block
The order page shows an ePay.bg payment block with the invoice, the requested amount and currency, the notification result, the payment date, the STAN, the BORICA code, a Test mode badge for test payments and the ePay.bg notes of the order.
Refunds
Refunds from PrestaShop are not available, because the ePay.bg WEB API has no refund call. Refund the payment in the ePay.bg merchant panel and update the order in PrestaShop manually.
License key
The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox ePay.bg Gateway is the first block on Modules > Module Manager > VibeFox ePay.bg Gateway > Configure, above the settings. Paste the key into License key and click Activate. After that the block shows the key masked, the status (for example the date the license is active until and your domain) and the buttons Check now to check the status again, Change key to enter another key and Remove key to remove the key from this shop. Below them are the line Product: presta-payment-epaybg and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only employees with the Configure permission for the module can change the key. The texts of the block follow the back office language (English and Russian are included).
If the key is not accepted, the block says why, for example Key not found, This key belongs to another product, Domain limit reached or License expired on a date. After the shop address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the module keeps working on the last known status.
One key works on one domain: the domain of the main shop, also in a multistore setup. Removing the key from the shop does not free its domain slot. Free the slot in your vibefox.net account.
Without an active key, ePay.bg is not shown to customers at checkout. If a payment is started anyway, the customer sees This payment method is not available. Please choose another one. The PrestaShop storefront does not know that you are logged in to the back office, so the payment method is hidden for you too: you can set up the module before you buy a key, but not test it at checkout. A reminder appears in Modules > Module Manager on the Alerts tab. Existing orders are not affected: payments already started are still confirmed.
When a license expires, the module keeps working, but updates and support need a renewal. The status is checked again automatically while you work in the back office: once a day for the first 14 days after the key is entered, then once a week. No cron job is needed. Uninstalling or resetting the module always removes the license key and license status.
Troubleshooting
ePay.bg does not appear at checkout: check that the license is active, Enable/Disable is on, the MIN and secret key of the selected mode are set and the cart currency is BGN, EUR or USD. The settings page shows a warning when the credentials are missing. In Payment > Preferences check that the module is allowed for the cart currency, the customer's country and the customer's group.
The payment went through, but no order was created: the order is created only by the ePay.bg notification. Check that the notification URL is entered in the ePay.bg merchant profile of the mode you use (demo or live), exactly as shown in Notification URL, and that the secret key of that mode is correct. Look at the Log field on the module page; turn on Logging to see every notification.
Notification answers ERR=Not valid CHECKSUM: no saved secret key matches the merchant profile that sent the notification. ePay.bg keeps retrying, so the order is created once the key is correct.
Notification answers ERR=Not configured: no secret key is saved. Enter it.
Notification answers STATUS=NO for an invoice: the invoice was not issued by this shop, for example by another shop on the same ePay.bg account. Give each shop its own Invoice Prefix.
Notification answers STATUS=ERR: a temporary error, for example two notifications for the same cart at the same moment, or the order could not be created (for example, the module is disabled). ePay.bg sends the notification again. The reason is in the log.
The notification URL shows ERR=Method not allowed in the browser: this is normal. The URL accepts only requests from ePay.bg.
Order is ePay.bg payment on hold after payment: read the notes in the ePay.bg payment block (see Order statuses), check the payment in the ePay.bg merchant panel, then fulfil the order or refund the payment there.
The invoice prefix was changed when saving: the prefix may contain only digits, up to 10. Other characters are removed.
For developers, the readme mentions the hook actionEpayBpFormFields (the epay_bp_form_fields filter of the WooCommerce version), for example to use the direct card page (PAGE=credit_paydirect).
Uninstall
Go to Modules > Module Manager, open the menu next to VibeFox ePay.bg Gateway and choose Uninstall. The license key and license status of this module are always removed. If Delete Data on Uninstall is on, the gateway settings and the log are removed. If it is off, all settings are kept for a later re-install. The ePay.bg payment records and the order status ePay.bg payment on hold are always kept, so a payment started before a re-install is still confirmed. Existing orders keep their payment notes and transaction IDs.
ePay.bg is a trademark of its respective owner. This module is not affiliated with or endorsed by ePay.bg.
