Back

VibeFox ePay.bg for OpenCart — Help

Requirements

OpenCart: 3.0.x (tested on 3.0.5.0) or 4.0.2 and later (tested on 4.1.0.3).

PHP: 8.0 or later.

Currency: Bulgarian lev (BGN), euro (EUR) or US dollar (USD). The order is charged in its own currency with 2 decimals. When the customer checks out in another currency, the payment method is hidden.

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 store in the merchant profile.

VibeFox license key: bought on vibefox.net. One key works on one domain.

Installation

The download is one zip file with the packages for both OpenCart versions. Unpack it on your computer. It contains README.txt, the OpenCart 3 package wcp_epaybg_gateway-oc3-(version).ocmod.zip and the OpenCart 4 package wcp_epaybg_gateway.ocmod.zip. Install only the package for your OpenCart version. The license key is the same for both versions.

OpenCart 3

1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_epaybg_gateway-oc3-(version).ocmod.zip. The extension has no OCMOD modifications, so Extensions > Modifications does not need a refresh. Instead of the installer you can copy the contents of the upload folder of this package into the root folder of your store.

2. Go to Extensions > Extensions and choose the type Payments. Find VibeFox ePay.bg Gateway and click Install (the green + button). Your admin user needs the right to modify the payment extensions list.

3. Click Edit (the pencil button) to open the settings page. Paste your VibeFox license key into License key in the license block at the top of the 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 gets a status.

6. Turn on Enable/Disable and click Save. Place a test order in test mode, then turn off Test Mode.

OpenCart 4

1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_epaybg_gateway.ocmod.zip. Do not rename the file: OpenCart 4 takes the extension code from the file name, and a renamed package does not work.

2. The package appears in the list of installed extensions on the same page. Click Install (the green + button) next to it.

3. Go to Extensions > Extensions and choose the type Payments. Find VibeFox ePay.bg Gateway, click Install (the green + button), then Edit (the pencil button).

4. Enter the license key, the ePay.bg credentials and the notification URL as in steps 3 to 6 for OpenCart 3. The settings page and its fields are the same in both versions. Only the notification URL is different (see Payment notifications (IPN)).

A new install starts with the payment method turned off and test mode on.

Configuration

All settings are on the extension page: Extensions > Extensions > Payments > VibeFox ePay.bg Gateway > Edit. The sections are listed on the left; the Save button under the list saves the whole page. Above the settings the page shows an error when the default currency of the store is not BGN, EUR or USD, a warning when the payment method 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. Without the right to modify the extension the page shows the settings but cannot save them.

When you save, Title must not be empty (up to 128 characters), Sort Order must be a whole number and Total a number of 0 or more; if any field is wrong, nothing is saved.

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 to the customer at the Confirm Order step. Default: Pay securely via ePay.bg with a bank card or your ePay.bg account.

Sort Order: the position of ePay.bg among the payment methods at checkout. Leave it empty or enter a whole number.

Geo Zone: offer ePay.bg only for payment addresses in the selected geo zone. Default: All zones. Geo zones are set up in System > Localisation > Geo Zones.

Total: the checkout total, in the default currency of the store, that an order must reach before ePay.bg is offered. Leave it empty to offer ePay.bg for any total.

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. While it is on, customers see Test mode (demo.epay.bg): no real payment is taken. at the Confirm Order step.

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. To remove a saved key, tick Clear the saved key on save under the field and click Save. Spaces and line breaks in pasted keys are removed when you save.

Payment notifications (IPN)

The notification tells your store 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 demo. On OpenCart 3 it looks like https://your-store/index.php?route=extension/payment/wcp_epaybg_gateway/notify, on OpenCart 4 like https://your-store/index.php?route=extension/wcp_epaybg_gateway/payment/wcp_epaybg_gateway.notify. It is built from the storefront address of your OpenCart installation. Copy the URL exactly as the settings show it. Orders get a status only from these signed notifications; the customer returning to the store does not pay an order.

ePay.bg reports these results for each invoice:

PAID: the customer paid. The order gets its status.
DENIED: the payment was denied. The order gets no status.
EXPIRED: the payment request expired unpaid. The order gets no status.

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 the on-hold status. Without the notification URL in the merchant profile, no order gets a status.

Payment request

Invoice Prefix: digits only (up to 10), put in front of the OpenCart order ID to form the ePay.bg invoice number, for example 00001 + 123 = 00001123. Use different prefixes for different stores on one ePay.bg account. Other characters are removed when you save, with a warning that shows the saved prefix. 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 the order gets no status. Choose 1, 3, 6, 12, 24, 48 or 72 hours. The time is sent in Bulgarian time, whatever the time zone of your store. Default: 24 hours.

Language: the language of the ePay.bg payment page, English or Bulgarian. Default: English.

Orders

OpenCart creates the order at the Confirm Order step without a status (a missing order). It gets a status only when ePay.bg reports the payment. A denied, expired or abandoned payment leaves it without a status, and the customer can pay again. The status fields below list your OpenCart order statuses.

Order Status After Payment: which status is set after a successful payment.

Default (processing status): the Processing status below (default).
Processing: the same, the Processing status.
Completed: the Completed status.
On Hold: the On Hold status: every paid order waits for your manual review.

Processing status: the OpenCart status for Default and Processing. Default: Processing.

Completed status: the OpenCart status for Completed. Default: Complete.

On Hold status: the OpenCart status for On Hold and for payments that need a manual review: the order total or currency changed after the payment request, the notification came in the other mode, or the order status was changed before the payment arrived (for example cancelled). Such an order is not marked as paid; a note explains why. Default: Pending, because OpenCart has no On hold status. You can create your own status in System > Localisation > Order Statuses and select it here.

Advanced

Logging: writes payment requests and notifications to epay_bp_debug.log.php in the OpenCart logs folder (storage/logs). The file cannot be opened from the web, and at 5 MB it is moved to epay_bp_debug.old.log.php. 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 extension removes the gateway settings and the log. The ePay.bg payment records and orders are always kept. Default: off.

Import / Export

Export: Download JSON saves the settings as a JSON file. Secret keys are not exported.

Import: paste previously exported JSON and click Import to restore the settings. Saved secret keys are kept.

Checkout

At the Payment Method step the customer chooses the payment method (by default ePay.bg). At the Confirm Order step the customer sees your description and the note You will be redirected to ePay.bg to pay with a bank card or your ePay.bg account. OpenCart creates the order at this step, still without a status. On OpenCart 4 the customer picks the payment method with the Choose button of the payment method block, in the window Payment method options, and clicks Confirm Order at the bottom of the checkout page. When the customer clicks Confirm Order, the extension sends the customer to ePay.bg with a signed payment request for the order total in the order currency, with the invoice number and the expiration time. The payment shows on ePay.bg as Order and the order number. On ePay.bg the customer pays with a bank card or an ePay.bg account.

After paying, the customer returns to your store. The order is marked paid only after ePay.bg confirms it with the signed notification. The order then gets its status the standard OpenCart way, with the usual order e-mails and stock update. If the notification has already arrived, the customer sees the OpenCart order success page. If not, a Payment confirmation page says Thank you. Your payment is being confirmed by ePay.bg — your order is confirmed as soon as ePay.bg reports the payment. 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. On OpenCart 4 these messages are shown above the checkout page. A new attempt for the same order uses the same invoice number. OpenCart 3 creates a new order every time the Confirm Order step is shown; OpenCart 4 updates the order of the checkout, so a new attempt pays the same order with a new payment request. When another order of the same cart is already paid, the customer goes to the success page and no new payment is started.

OpenCart 4 keeps the order in the checkout until the success page is shown. If that order was closed without a payment meanwhile (for example you cancelled it), the customer is sent back to the checkout with Your previous order was cancelled without a payment. Please confirm the order again to pay with a new order., and the next Confirm Order pays a new order of the cart. If that order is already paid but the cart has changed since, including a new quantity, the customer is sent back to the checkout, and the next Confirm Order pays the new cart with a new order. A paid order is never shown as paid for a different cart.

If the order cannot be paid with ePay.bg, the customer stays at the Confirm Order step with a short message above the button, for example ePay.bg payments are temporarily unavailable. Please choose another payment method. or that ePay.bg does not accept payments in the order currency.

The notification also works while the store is in maintenance mode, because OpenCart 3 lets payment extension requests through and the extension adds a startup action for it on OpenCart 4. Notifications of payments already started are accepted even if you turn the payment method off.

The extension takes one-time payments on ePay.bg only. It has no refunds from OpenCart, no saved cards, no subscriptions or recurring payments and no EasyPay or B-Pay cash payment codes.

Orders

Order statuses

No status (missing order): 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. In Sales > Orders such orders are shown only with the filter Order Status set to Missing Orders.

Processing, Completed or On Hold status: the payment was confirmed. The status follows Order Status After Payment. A note shows the invoice number, the payment date, the STAN and the BORICA code.

On Hold status after payment: the payment arrived, but not for what the order says now: the order total or currency was changed after the payment request, the notification came in the other mode (test or live) than the request, or the payment method of the order is no longer ePay.bg. The payment is not recorded as paid. The same happens when you had already given the order another status, for example cancelled it. 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, the status is not changed, and a note asks you to check for a double payment in the ePay.bg merchant panel. If the customer has paid two orders of the same cart, the second one gets a note about a possible double payment. A late denied or expired notice never changes a paid order; an order with a status only gets a note.

Notes are entries in the order History that the customer does not see.

VibeFox ePay.bg Gateway tab

In Sales > Orders open an order paid with ePay.bg. At the bottom of the order page, next to History and Additional, the VibeFox ePay.bg Gateway tab shows the invoice, the environment (test or live) with a Test mode label for test payments, the requested amount and currency, the state of the payment request, the notification result, the payment date, the STAN, the BORICA code and the ePay.bg notes of the order. The tab is read-only and is shown to users who have access to the extension.

Refunds

Refunds from OpenCart 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 status in OpenCart manually. Product returns in Sales > Returns do not send money back through ePay.bg.

License key

The extension works with a VibeFox license key from vibefox.net. The license block License — VibeFox ePay.bg Gateway is the first block on Extensions > Extensions > Payments > VibeFox ePay.bg Gateway > Edit, 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 store. Below them are the line Product: opencart-payment-epaybg and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only admin users with the Modify permission for the extension can change the key. The texts of the block follow the admin 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 store address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the extension keeps working on the last known status.

One key works on one domain: the store address from the OpenCart configuration. Removing the key from the store 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. An admin user who is logged in to the admin in the same browser still sees the payment method in the store, marked (unlicensed — visible to admins only), so you can set up and test the extension before you buy a key. On OpenCart 4 this preview is not available: the store does not see the admin login, so without an active key the payment method is hidden for everybody. After you have opened the Edit page once, a reminder appears on the admin Dashboard. Close it with × to hide it for 7 days. Existing orders are not affected: payments already started are still confirmed.

When a license expires, the extension keeps working, but updates and support need a renewal. The status is checked again automatically when you open the admin Dashboard or the Edit page: once a day for the first 14 days after the key is entered, then once a week. No cron job is needed. Uninstalling the extension 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 customer checks out in BGN, EUR or USD. The settings page shows a warning when the credentials are missing. Also check that the payment address is in the selected Geo Zone and that the order reaches the Total set in the settings.

The payment went through, but the order stays without a status: the order gets its status only from 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 extension 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 gets its status 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 store, for example by another store on the same ePay.bg account. Give each store its own Invoice Prefix.

Notification answers STATUS=ERR: a temporary error, for example two notifications for the same order at the same moment, or the order status could not be set. 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.

The customer sees This payment method is not available. Please reload the checkout page.: the checkout session no longer matches the order, or the payment method was turned off meanwhile. The customer reloads the checkout.

The customer sees This order has nothing to pay.: the order total is zero, so there is nothing to send to ePay.bg.

Order is in the On Hold status after payment: read the notes in the VibeFox ePay.bg Gateway tab (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: before the payment form is sent to ePay.bg, the extension triggers the OpenCart event epay_bp_form_fields with the form fields and the order, for example to use the direct card page (PAGE=credit_paydirect); the signed data and the checksum cannot be changed by it.

Uninstall

Go to Extensions > Extensions, choose the type Payments and click Uninstall (the red − button) next to VibeFox ePay.bg Gateway. The license key and license status of this extension are always removed. OpenCart always removes its own settings of the extension: Enable/Disable, Sort Order, Geo Zone, Total and the OpenCart statuses of the Orders section, which return to their defaults on a re-install. On OpenCart 4 the event of the extension (the checkout message) and its startup action, which lets the notification through in maintenance mode, are removed too. If Delete Data on Uninstall is on, the other gateway settings (title, description, test mode, MIN and secret keys, payment request, order status after payment, logging) and the log are removed. If it is off, they are kept for a later re-install. The ePay.bg payment records are always kept, so a payment started before a re-install is still confirmed. Existing orders keep their payment notes.

On OpenCart 4, to remove the files of the extension as well, go to Extensions > Installer after the uninstall and click Uninstall (the orange − button) next to VibeFox ePay.bg Gateway in the list of installed extensions, then Delete (the red bin button) to remove the uploaded package.

ePay.bg is a trademark of its respective owner. This extension is not affiliated with or endorsed by ePay.bg.