Back

VibeFox 2C2P 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.

2C2P account: you need the Merchant ID and Secret Key of your 2C2P merchant account. They are issued by 2C2P when your merchant account is opened. Sandbox and live accounts have different keys. Developer documentation and sandbox test cards are on developer.2c2p.com.

Currency: the checkout currency must be supported by the extension and enabled on your 2C2P account. Supported are, among others, THB, SGD, MYR, PHP, IDR, VND, MMK, KHR, LAK, CNY, HKD, TWD, JPY, KRW, INR, AUD, NZD, USD, EUR and GBP. If the customer's currency is not supported, the payment method is hidden at checkout.

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_2c2p_payment-oc3-(version).ocmod.zip and the OpenCart 4 package wcp_2c2p_payment.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_2c2p_payment-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 the archive into the root folder of your store.

2. Go to Extensions > Extensions and choose the type Payments. Find VibeFox 2C2P Payment 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 your sandbox Merchant ID and Secret Key, turn on Enable/Disable, click Save and place a test order.

5. When you are ready, enter the live credentials and turn off Sandbox Mode.

OpenCart 4

1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_2c2p_payment.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 extension type Payments. Find VibeFox 2C2P Payment, click Install (the green + button), then Edit (the pencil button).

4. Enter the license key and the settings as in steps 3 to 5 for OpenCart 3. The settings page and its fields are the same in both versions. Only the result URLs are different (see Payment page).

A new install starts with the payment method turned off and sandbox mode on. The return and notification URLs are sent with every payment. Nothing has to be configured in the 2C2P portal.

Configuration

All settings are on the extension page: Extensions > Extensions > Payments > VibeFox 2C2P Payment > Edit. The sections are listed on the left; the Save button under the list saves the whole page. Above the settings the page shows Sandbox mode is active. No real transactions will be processed. while sandbox mode is on. It warns you when the gateway is enabled but the Merchant ID or Secret Key of the current mode is empty, and when the default currency of the store is not supported. In both cases the payment method is hidden at checkout. Without the right to modify the extension the page shows the settings but cannot save them.

When you save with Sandbox Mode off, the page shows Please enter your live Merchant ID. or Please enter your live Secret Key. if a live field is empty. The settings are saved anyway. Sort Order must be a whole number, Total a number of 0 or more and Title at most 128 characters, and the geo zone and order statuses must exist; otherwise nothing is saved and the page names the field.

2C2P

Enable/Disable: Enable 2C2P 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, so it can be at most 128 characters. If it is empty, the default is used. Default: 2C2P Payment.

Description: the text shown to the customer at the Confirm Order step, above the confirm button. Default: Pay securely via credit/debit card, e-wallet, or internet banking through 2C2P. In sandbox mode (TEST MODE) is added to it.

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

Geo Zone: offer 2C2P 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 2C2P is offered. Leave it empty to offer 2C2P for any total.

Test mode (sandbox)

Sandbox Mode: sends payments to the 2C2P sandbox (demo2.2c2p.com) with the sandbox credentials below. Default: on. Turn it off to take real payments.

Sandbox Merchant ID: your sandbox 2C2P Merchant ID.

Sandbox Secret Key: your sandbox 2C2P Secret Key.

Live API Credentials

Used when sandbox mode is off.

Merchant ID: your live 2C2P Merchant ID.

Secret Key: your live 2C2P Secret Key. The key is saved as entered, including quotes and backslashes.

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 value on save under the field and click Save.

Payment page

Result URLs: shows, for reference, the Frontend return URL and the Backend notification URL. They look like https://your-store/index.php?route=extension/payment/wcp_2c2p_payment/back and https://your-store/index.php?route=extension/payment/wcp_2c2p_payment/notify on OpenCart 3, and https://your-store/index.php?route=extension/wcp_2c2p_payment/payment/wcp_2c_2p_payment.back and https://your-store/index.php?route=extension/wcp_2c2p_payment/payment/wcp_2c_2p_payment.notify on OpenCart 4. They are built from the storefront address of your OpenCart installation. They are sent with every payment automatically. Results are always checked with the Merchant ID and Secret Key of the mode the payment was made in: a payment started in sandbox mode is still verified with the sandbox key after you switch to live, and a result signed with the key of the other mode is rejected.

Payment Page Language: the language of the 2C2P payment page. Default: English.

Options: English, Thai, Japanese, Bahasa Indonesia, Burmese, Simplified Chinese.

Redirect API version: keep 8.5 unless 2C2P told you that your account still uses the old version 7.0 (SHA-1 signatures). Results of payments started before a switch are still verified.

8.5 — HMAC-SHA256 (recommended): the current version (default).
7.0 — HMAC-SHA1 (legacy accounts): for older 2C2P accounts.

Order ID prefix: optional, letters and digits only (max 10), for example SHOP1. 2C2P rejects an order ID it has already seen. Set a unique prefix when several stores share one 2C2P account, and in the sandbox, where test merchant accounts are shared. The 2C2P order ID is the prefix, the OpenCart order number and the attempt number, for example SHOP1123A1. Other characters are removed when you save, with a warning.

Orders

OpenCart creates the order at the Confirm Order step without a status (a missing order). The order gets a status only after 2C2P has confirmed the result with a valid signature. Each field below lists your OpenCart order statuses.

Order Status After Payment: a successful payment (2C2P status 000). Default: Processing.

Awaiting Payment Status: a pending payment (status 001), for example a cash or bank payment the customer has not made yet. Default: Pending.

On Hold (Review) Status: 2C2P reported a different amount or currency than the order total. Default: Pending, because OpenCart has no On hold status. You can create your own status in System > Localisation > Order Statuses and select it here.

Cancelled Payment Status: a pending payment was then rejected, cancelled or failed (statuses 002, 003, 999). Default: Canceled.

Advanced Settings

Enable Logging: writes 2C2P events to tc2p_p_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 tc2p_p_debug.old.log.php. No card data, secret keys, customer e-mails or payment tokens are logged. Default: off. Nothing is written while it is off, errors included.

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 2C2P transactions always stay, so a late result of an old payment is still handled after a re-install. 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 2C2P Payment). At the Confirm Order step the customer sees your description. OpenCart creates the order at this step, still without a status. When the customer clicks Confirm Order, the page shows Thank you for your order. You will be redirected to 2C2P to complete your payment. and sends the customer to the 2C2P payment page after a moment. If that does not happen, the customer clicks Pay via 2C2P.

On the 2C2P page the customer pays with any method enabled on your 2C2P account, for example cards, e-wallets, QR payments, internet banking or cash payments. The extension passes the order total in the order currency, the customer's e-mail and the names of the products in the order. The payment can be completed within 24 hours. Each click on Confirm Order starts a new attempt with its own 2C2P order ID, because 2C2P never accepts the same order ID twice.

2C2P reports the result twice: the customer's browser comes back to the store, and 2C2P sends a server-to-server notification. Both are handled the same way. The order is marked paid only after 2C2P confirms it with a valid signature. The result must also belong to the payment: the 2C2P order ID must be one your store issued, and the merchant ID and the random token of the attempt are checked. Results without a valid signature are rejected. The notification also works while the store is in maintenance mode, because OpenCart lets payment extension requests through. On OpenCart 4 the extension adds a startup action for this, which lets the signed results of 2C2P through.

After a successful payment the order gets its status the standard OpenCart way, with the usual order e-mails and stock update, and the customer sees the OpenCart order success page with Your 2C2P payment has been received. For a pending payment the page shows Your 2C2P payment is pending (for example a cash or bank payment that is not made yet). The order will be processed as soon as 2C2P confirms the payment. For an order on review it shows Your payment was received and is being reviewed by the shop.

If the payment was not completed or was cancelled on the 2C2P page, the order stays without a status. The customer is back at checkout with Payment was not completed. Please try again or choose a different payment method. The cart is kept, and the customer can pay again or choose another payment method. If the result cannot be confirmed, the customer sees We could not confirm the payment result. If your account was charged, please contact us before paying again. If the payment cannot be started, for example because the order currency is not supported or the order total is zero, the customer stays at the Confirm Order step with This payment method is currently unavailable for this order. Please contact us or choose another payment method.

If the order already has a status (paid or waiting for a pending payment), no second payment form is built. The customer is sent to the order success page.

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. The messages about a payment that was not completed or could not be confirmed are shown above the checkout page. OpenCart 4 keeps one order for the checkout and updates it: after a failed payment the customer pays the same order with a new attempt (a new 2C2P order ID such as SHOP1123A2). If that order was closed without a payment meanwhile (for example a pending payment was cancelled or you cancelled the order), the customer is sent back to the checkout with Payment was not completed. Please try again or choose a different payment method., and the next Confirm Order pays a new order. If the order was closed after a payment, or it already has a status from a payment of another cart, the message is This order can no longer be paid. Please confirm your order again. A paid order is never shown as paid for a different cart. A change of the cart, including a new quantity, counts as a new cart that needs its own payment.

The extension has no refunds from OpenCart, no saved cards, no recurring payments or subscriptions, no card fields on your site and no support for the 2C2P PGW 4.x API.

Orders

Order statuses

No status (missing order): the customer was sent to 2C2P and no result has arrived yet, or the payment failed. In Sales > Orders such orders are shown only with the filter Order Status set to Missing Orders.

Order Status After Payment (default Processing): 2C2P reported a successful payment. A note shows the 2C2P transaction, approval code, date and payment channel.

Awaiting Payment Status (default Pending): the payment is pending at 2C2P, for example a cash payment the customer has not paid yet. The order moves to Order Status After Payment when 2C2P reports the payment. OpenCart notifies the customer of this change.

On Hold (Review) Status (default Pending): 2C2P reported a different amount or currency than the order total. The note shows the received and expected values. Check the order and the transaction in the 2C2P portal.

Cancelled Payment Status (default Canceled): a pending payment was then rejected, cancelled or failed. The note shows the status and reason. A failed result of an older attempt does not cancel an order that waits for another attempt.

A paid order is never changed by a later result, and a repeated old result does not re-open an order that was cancelled. If a second payment arrives for an order that is already paid, the order is not changed. A note asks you to check it and refund the duplicate in the 2C2P merchant portal. OpenCart 3 creates a new order each time the customer reaches the Confirm Order step, so one cart can have several orders (OpenCart 4 keeps one order for the checkout, but an earlier order or a second browser tab can still hold the same cart). Once one of them is paid or waits for a pending payment, no new payment starts for the same cart, and a payment that still arrives for another order of that cart does not change it. The paid order gets the note to refund the duplicate.

On OpenCart 4 an unpaid order of the checkout can get the status Voided, which OpenCart 4 sets when the customer comes back to the Confirm Order step. The extension treats such an order as an order without status, and a later payment still confirms it.

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

VibeFox 2C2P Payment tab

In Sales > Orders open an order paid with 2C2P. At the bottom of the order page, next to History and Additional, the VibeFox 2C2P Payment tab shows the 2C2P order ID with a Sandbox label for sandbox payments, the transaction, the payment status, the amount received, the channel, the approval code, the masked card number, the date, the channel response, the API version and the 2C2P notes of the order. The tab is shown to users who have access to the extension.

Refunds

Refunds from OpenCart are not supported. Refund the payment in the 2C2P merchant portal, then record the refund in OpenCart manually, for example by changing the order status.

License key

The extension works with a VibeFox license key from vibefox.net. The license block License — VibeFox 2C2P Payment is the first block on Extensions > Extensions > Payments > VibeFox 2C2P Payment > 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-2c2p 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, 2C2P 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

2C2P does not appear at checkout: check that the license is active, Enable/Disable is on and the current mode has a Merchant ID and Secret Key: the sandbox fields in sandbox mode, the live fields in live mode. Check that the customer's currency is supported. The settings page shows a warning when the credentials are missing or the default currency is not supported. 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: no valid result reached your store. Check that the Merchant ID and Secret Key of the mode the payment was made in match the 2C2P account, and that Redirect API version matches your account. A result with a wrong signature or for another merchant ID is rejected. Turn on Enable Logging and look for hash or merchant ID messages in the Log field. Check also that your server accepts requests from 2C2P to the backend notification URL.

The backend notification answers 400 FAIL: the result has missing fields, a wrong signature, another merchant ID or a wrong token. 404 FAIL means the 2C2P order ID was not issued by this store. 503 RETRY means the order was being confirmed by another request at the same moment, or processing failed; 2C2P retries later. Turn on Enable Logging to see the reason.

The notification URL shows FAIL in the browser: this is normal. The URL accepts only POST requests from 2C2P.

2C2P says the order ID already exists: 2C2P does not accept the same order ID twice. This happens when several stores share one 2C2P account or in the sandbox, where demo merchant accounts are shared by many developers. Set a unique Order ID prefix.

A payment was made but the order is in the awaiting payment or review status: either the payment is still pending at 2C2P (for example a cash payment that the customer has not paid yet), or the paid amount or currency did not match the order. Check the notes in the VibeFox 2C2P Payment tab and the transaction in the 2C2P portal.

The customer sees This payment method is currently unavailable for this order: the order currency is not supported, the Merchant ID or Secret Key of the current mode is empty, or the order total is zero.

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.

Please enter your live Merchant ID or Please enter your live Secret Key on save: sandbox mode is off and a live field is empty. Enter the live credentials or keep Sandbox Mode on.

For developers: before the payment form is signed, the extension triggers the OpenCart event tc2p_p_payment_fields with the form fields and the order.

Uninstall

Go to Extensions > Extensions, choose the type Payments and click Uninstall (the red − button) next to VibeFox 2C2P Payment. 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 order statuses of the Orders section, which return to their defaults on a re-install. The OpenCart event of the extension is removed too (on OpenCart 4 its events and its startup action, which lets the 2C2P results through in maintenance mode). If Delete Data on Uninstall is on, the other gateway settings (title, description, sandbox mode, credentials, payment page settings, logging) and the log are removed. If it is off, they are kept for a later re-install. The 2C2P transactions are always kept, so a late result of an old payment is still handled after a re-install. 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 2C2P Payment in the list of installed extensions, then Delete (the red bin button) to remove the uploaded package.

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