Back

VibeFox Transbank 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: Chilean peso (CLP). Add it in System > Localisation > Currencies if your store does not have it, with 0 decimal places: Webpay Plus charges whole pesos only. For orders in another currency the payment method is not shown.

Transbank account: for live payments you need a standard Webpay Plus commerce (immediate capture) with its production Commerce Code and API Key Secret. Transbank gives you the Commerce Code when your affiliation is approved and the API Key Secret after the integration validation process (see the Transbank developers documentation). For tests no credentials are needed. Webpay Plus Mall, Oneclick and deferred-capture commerce codes are not supported.

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_transbank_gateway-oc3-(version).ocmod.zip and the OpenCart 4 package wcp_transbank_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_transbank_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 Transbank 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. Turn on Enable / Disable and click Save. Test a payment in CLP with Integration (test) mode on, using the test cards from the Transbank developers documentation.

5. To go live, enter your Production Commerce Code and Production API Key Secret, turn off Integration (test) mode and click Save.

OpenCart 4

1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_transbank_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 Transbank Gateway, 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 return URL is different (see Return URL).

No return URL or webhook has to be set up at Transbank. The extension sends its return URL with every transaction. A new install starts with the payment method turned off and integration mode on.

Configuration

All settings are on the extension page: Extensions > Extensions > Payments > VibeFox Transbank Gateway > Edit. The sections are listed on the left; the Save button under the list saves the whole page. Above the settings the page warns you when production is selected but the production Commerce Code or API Key is missing or invalid (Webpay is then hidden at checkout), when the default currency of the store is not CLP (the payment method is hidden for other currencies), and when CLP has decimal places (totals are rounded to whole pesos). While integration mode is on, the page shows that payments go to the Transbank integration environment with the public test commerce code and that no real money is charged. Without the right to modify the extension the page shows the settings but cannot save them.

When you save, Title must not be empty or longer than 128 characters, Sort Order must be a whole number (negative values are allowed), Total must be a number of 0 or more and the order statuses must exist; otherwise nothing is saved and the page shows the error.

Transbank Webpay Plus

Enable / Disable: Enable Transbank Webpay Plus payments 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: Webpay Plus. Required, at most 128 characters.

Description: the text shown to the customer at the Confirm Order step, above the confirm button. Default: Pay with credit, debit or prepaid card via Webpay.

Sort Order: the position of Webpay among the payment methods at checkout. Leave it empty or enter a whole number (negative values are allowed).

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

Environment and credentials

The section text links to the Transbank developers documentation and explains when Transbank gives you the production credentials.

Integration (test) mode: payments go to the Transbank integration environment with its public test commerce code (597055555532), used automatically. The production credentials below are not used and no real money is charged. Default: on. Turn it off to go live. While it is on, customers see TEST MODE — Integration environment. No real charges. at the Confirm Order step.

Production Commerce Code: your production commerce code (Tbk-Api-Key-Id): 12 digits, starting with 5970. If yours has 8 digits, enter it as it is; the 5970 prefix is added when you save. Spaces and other characters are removed. The public test commerce codes of Transbank do not work in production: with one of them Webpay stays hidden at checkout.

Production API Key Secret: the Tbk-Api-Key-Secret of your production commerce. Keep it secret. Spaces are removed when you save. A saved key is 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 the saved key, tick Clear saved API key and click Save.

Integration (test) mode decides where new payments go. Each payment remembers its environment: the confirmation and refunds of a payment always go to the environment (integration or production) and with the credentials it was created with, even if you switch the mode later.

Return URL

Return from Webpay: the address Transbank sends the customer back to, shown for reference. On OpenCart 3 it looks like https://your-store/index.php?route=extension/payment/wcp_transbank_gateway/back, on OpenCart 4 like https://your-store/index.php?route=extension/wcp_transbank_gateway/payment/wcp_transbank_gateway.back. Nothing has to be configured at Transbank: the extension sends this URL with every transaction (Transbank has no webhook: the payment is confirmed when the customer comes back). It must be reachable from the internet; maintenance mode does not block it (on OpenCart 4 the extension adds a startup action for it).

Orders

OpenCart creates the order at the Confirm Order step without a status (a missing order). The order gets a status only after the store has confirmed the transaction with Transbank (commit) when the customer comes back from Webpay. Each field below lists your OpenCart order statuses.

Order Status After Payment: the status set after an approved and verified Webpay payment. Default: Processing.

Transbank Payment On Hold Status: Transbank authorized a payment that does not match the order (amount, buy order, session id): the order is held for manual review, and 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.

Refunded Status: set after the payment is fully refunded from the order page. Default: Refunded.

Advanced

Debug log: logs API requests and returns to wc_tbk_debug.log.php in the OpenCart logs folder (storage/logs). The file cannot be opened from the web. Errors are always logged, even when this option is off. No card data, API keys or full tokens are logged. Default: 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. Order and payment data are always kept. Default: off.

Import / Export

Export: Download JSON saves the settings as a JSON file. The API Key Secret is not exported.

Import: paste previously exported JSON and click Import to restore the settings. The saved API key is kept.

Checkout

At the Payment Method step the customer chooses the payment method (by default Webpay Plus). At the Confirm Order step the customer sees your description and the note You will be redirected to Webpay (Transbank) to complete the payment. OpenCart creates the order at this step, still without a status. When the customer clicks Confirm Order, the extension creates a Transbank transaction for the order total in whole pesos (a total with decimals is rounded to the nearest peso) and the customer goes straight to the Webpay form, where they pay by credit, debit or prepaid card. 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 returns, the extension confirms (commits) the transaction with Transbank server-to-server. The order is marked paid only after Transbank confirms it: the answer must be approved, and the amount, buy order and session must match what the store sent for this attempt. The order then 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 Webpay payment has been received. For an order on review the page shows Your Webpay payment was received and is being reviewed by the store.

If the confirmation call fails, for example on a timeout, the extension asks Transbank for the transaction status. If the status still cannot be known, the order stays without a status and the customer is back at checkout with We could not confirm your Webpay payment with Transbank. Please try again in a moment; if your card was charged, contact us before paying again. If another request is confirming the same cart at that moment, or Transbank approved the payment but the order status could not be set yet, the customer sees a Payment confirmation page with Your Webpay payment is being confirmed. Please do not pay again — check again in a moment. and the buttons Check again and Back to checkout. The status is then set from the stored answer, without a second confirmation.

If the customer cancels on Webpay, or the Webpay form expires or reports an error, nothing is charged. The customer is back at checkout with a message, for example You cancelled the Webpay payment. Nothing was charged — you can try again or choose another payment method. A rejected card shows Your Webpay payment was rejected and nothing was charged. Please try again or choose another payment method. The cart is kept, and each new attempt is a new Webpay transaction. On OpenCart 4 these messages are shown above the checkout page.

OpenCart 3 creates a new order every time the Confirm Order step is shown. OpenCart 4 keeps one order for the checkout and updates it, so after a cancelled or rejected payment the customer pays the same order with a new Webpay transaction. If the order changed after the payment started (its currency or total no longer match the transaction), the transaction is not confirmed, so Transbank does not charge it, and the customer sees Your order changed after the Webpay payment was started. The payment was not confirmed, so it was not charged — please pay again. If the order already has a status, or another order of the same cart is already paid, a late return is not confirmed either: the customer goes to the success page of the paid order, or sees This order can no longer be paid (it was cancelled or already paid). Your Webpay payment was not confirmed, so it was not charged.

On OpenCart 4, if the order of the checkout got a status without a Webpay payment or was closed by the store meanwhile, the next Confirm Order sends the customer back to the checkout with the same message, and the cart is paid with a new order. If the order of the checkout is already paid but the cart has changed since, including a new quantity, the customer is sent back to the checkout and the new cart is paid with a new order.

If Webpay cannot start the payment, the customer stays at the Confirm Order step with a short message, for example Could not connect to Webpay. Please try again in a moment. or Webpay could not start the payment. Please try again or choose another payment method. The technical reason is written to the log.

Transbank has no payment webhook: the result is processed when the customer comes back from Webpay. If the customer closes the browser on Webpay and never returns, the transaction is not confirmed and the order stays without a status; according to Transbank, unconfirmed transactions are not settled. The extension has no Webpay Plus Mall, Oneclick saved cards, subscriptions, deferred capture or currency conversion.

Orders and refunds

Order statuses

No status (missing order): the customer was sent to Webpay and has not paid, cancelled, let the form expire, the card was rejected, or the payment could not be confirmed yet. In Sales > Orders such orders are shown only with the filter Order Status set to Missing Orders.

Order Status After Payment (default Processing): Transbank approved the payment. A note shows the authorization code, the last four card digits, the buy order, the amount, the payment type and the number of installments.

Transbank Payment On Hold Status (default Pending): Transbank authorized a payment that does not match the order (amount, buy order or session). The note lists the differences. Check the Transbank portal and fulfil the order or refund the payment.

Refunded Status (default Refunded): the payment was fully refunded through the extension.

If Webpay returns a payment for an order that already has a status, or for a cart that another order has already paid, the payment is not confirmed and a note asks you to check the Transbank portal if the customer reports a charge. Cancellations, expired forms, form errors and rejected cards are also noted. Notes are entries in the order History that the customer does not see.

VibeFox Transbank Gateway tab

In Sales > Orders open an order paid with Webpay. At the bottom of the order page, next to History and Additional, the VibeFox Transbank Gateway tab shows the Buy order and its environment (an Integration label for test payments), the payment Status, the Authorization code, the Card / payment type with the number of installments, Charged / refunded, the refund form, the refund history, the Webpay attempts of the order and the Transbank notes. The tab is shown to users who have access to the extension.

Refunds

In the tab enter the Amount in CLP (the amount not refunded yet is filled in), optionally a Reason (optional), and click Refund via Transbank. Confirm the question Refund this amount via Transbank? Full and partial refunds are supported in whole pesos. You need the right to modify the extension (set in System > Users > User Groups). A partial amount with decimals is refused with Webpay refunds are in whole Chilean pesos. Please enter an amount without decimals. The last remainder of an order total with decimals is rounded like the charge. Refunds are made up to the amount Transbank charged. The refund goes to the environment the payment was made in, so for a production payment the production credentials must be set.

Transbank answers with a reversal (REVERSED) or a nullification (NULLIFIED). A successful refund is added to the refund history and the notes with the amount, type, authorization code and the balance left at Transbank. A full refund sets the Refunded Status without notifying the customer and without returning products to stock, like a manual status change. A partial refund does not change the status. If Transbank does not accept the refund, the tab shows the error and no refund is recorded.

Product returns in Sales > Returns do not send money back through Transbank. Refunds made in the Transbank portal are not imported into OpenCart.

License key

The extension works with a VibeFox license key from vibefox.net. The license block License — VibeFox Transbank Gateway is the first block on Extensions > Extensions > Payments > VibeFox Transbank 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-transbank 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, Webpay Plus 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 the customer returns from Webpay, and refunds from the order page work.

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

Webpay Plus does not appear at checkout: check that the license is active, Enable / Disable is on, the customer pays in CLP and, with integration mode off, that a valid Production Commerce Code (12 digits, starting with 5970) and Production API Key Secret are saved. Also check that the payment address is in the selected Geo Zone and that the order reaches the Total set in the settings. The settings page shows a warning for missing credentials and a non-CLP store currency.

The payment went through, but the order stays without a status: Transbank has no webhook, so the order gets its status only when the customer returns from Webpay. If the customer closed the browser on Webpay, the transaction was not confirmed and, according to Transbank, is not settled. Turn on Debug log, look at the Log field and check the transaction in the Transbank portal.

The customer sees We could not confirm your Webpay payment with Transbank: the confirmation call failed and the status could not be checked. The order was not changed and the reason is in the log. The customer can try again in a moment. If the Transbank portal shows the transaction as authorized, contact the customer before they pay again.

The customer sees Your order changed after the Webpay payment was started: the order total or currency differed from the transaction. Nothing was charged; the customer pays again.

The customer sees an error after Confirm Order: turn on Debug log and look at the Log field on the extension page. Webpay payments are not available at the moment usually means wrong production credentials. Could not connect to Webpay means Transbank could not be reached. Transbank Webpay only supports payments in CLP (Chilean Peso) means the order is in another currency. This payment method is not available. Please reload the checkout page. means the checkout session no longer matches the order: the customer reloads the checkout.

Totals and refunds differ by a few pesos: the CLP currency has decimal places. Webpay charges whole pesos, so totals are rounded. Set the decimal places of CLP to 0 in System > Localisation > Currencies.

Order is in the review status after payment: read the notes in the VibeFox Transbank Gateway tab (see Order statuses), then fulfil the order or refund the payment.

Refund fails with The production Commerce Code / API Key are missing: the payment was made in production and the production credentials are not saved. Enter them and try again.

Refund fails with Transbank refused the refund or Transbank did not approve the refund: Transbank did not accept it; the message shows the reason or the type and response code it returned. Nothing was refunded. Check the transaction in the Transbank portal.

Refund fails with Another request is processing this order: the order was being refunded or confirmed at the same moment. Try again in a moment.

Uninstall

Go to Extensions > Extensions, choose the type Payments and click Uninstall (the red − button) next to VibeFox Transbank 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 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 return from Webpay through in maintenance mode). If Delete data on uninstall is on, the other gateway settings (title, description, integration mode, credentials, debug log switch) and the log are removed. If it is off, they are kept for a later re-install. The Webpay attempts and refunds of orders are always kept, so orders paid before can still be refunded 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 Transbank Gateway in the list of installed extensions, then Delete (the red bin button) to remove the uploaded package.

Transbank and Webpay are trademarks of their respective owner. This extension is not affiliated with or endorsed by Transbank.