Back

VibeFox Yoco for PrestaShop — Help

Requirements

PrestaShop: 8.0 to 9.x.

PHP: 8.0 or later. The module refuses to install on older PHP versions.

Shop currency: South African rand (ZAR). Yoco accepts ZAR only. In any other currency the payment method is hidden at checkout. The order total must be at least R2.00.

Yoco account: a Yoco account with online payments. You need its secret keys, which you find in the Yoco Business Portal under Selling Online > Payment Gateway. Only the secret keys are entered. The webhook is registered by the module, and its signing secret is filled in for you.

Public site: Yoco sends webhooks to your shop, so it must be reachable from the internet. The webhook URL must accept a POST without redirects.

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 Yoco Pay 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. Paste the test secret key (sk_test_...) and, when you are ready, the live secret key (sk_live_...). Click Save. The webhook is registered for each mode that has a key.

5. Turn on Enable/Disable and click Save. Make a test payment with a Yoco test card while Test mode is on, then turn off Test mode to take real payments.

On install the module creates the order status Yoco 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 Yoco Pay Gateway > Configure. Each section has its own Save button, which saves the whole page. Above the fields the page warns you when the shop currency is not ZAR (Yoco is then not offered at checkout) and when the current mode has no secret key, for example Enter the test secret key to offer Yoco at checkout (test mode). When you save, the module checks the keys and the webhook secrets and registers the webhooks. Messages about this appear at the top of the page.

Yoco

Enable/Disable: Enable Yoco 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: Card or Instant EFT (Yoco).

Description: the text shown under the payment method at checkout. Default: You will be redirected to the secure Yoco page to pay by card or Instant EFT.

API keys

Copy the secret keys from the Yoco Business Portal under Selling Online > Payment Gateway. Yoco has one API for both modes: the key decides whether a payment is a test or a real one. Test mode uses only the test key, live mode only the live key.

Test mode: uses the test secret key. No real money is charged; pay with Yoco test cards. Default: on. Turn it off to take real payments. While it is on, customers see Test mode — use a Yoco test card; no real money is charged. under the payment method.

Test secret key: the secret key of the test mode. It starts with sk_test_.

Live secret key: the secret key of the live mode. It starts with sk_live_.

A key that does not start with the expected prefix is not saved: the page shows an error, for example Yoco: the test secret key must start with sk_test_ — the previous value was kept. If Yoco reports during webhook registration that a key belongs to the other mode, the page tells you so.

Saved keys and secrets are never shown again. The field stays empty and shows Saved — leave empty to keep it. Type a new value only to change it.

Webhooks

Yoco confirms payments and refunds to the URL shown in Webhook URL in this section. With friendly URLs it looks like https://your-shop/module/wcp_yoco_pay/webhook, possibly with a language code such as /en/. You do not need to create the webhook in the Yoco portal. When you save the settings, the module registers the URL with Yoco for each mode that has a secret key but no webhook secret, and stores the signing secret in the field of that mode. It registers the URL again when the secret key of that mode changes or the webhook URL changes. When the URL changes, the old registration is removed.

For each mode (Test and Live) the section shows the state of the webhook:

registered: the module registered the webhook, and its Yoco ID is shown. If the note says it is for another URL, save the settings to register it again.
secret entered manually: you pasted a secret yourself. The module does not change it.
not registered: the mode has a key, but no webhook yet. Save the settings to register it. Until then payments are confirmed only when the customer returns to the shop.
no secret key: the mode has no secret key.

The module handles these events (they are also listed in this section):

payment.succeeded: a payment was made. The module asks Yoco for the checkout before it creates the order.
refund.succeeded: a refund was completed, made from PrestaShop or in the Yoco portal.
refund.failed: a refund failed. A note is added to the order.

Webhooks without a valid signature are rejected. An event must be signed with the secret of the mode the payment was made in, so a test secret never confirms a live payment. Copy the URL exactly as the settings show it, because the webhook must reach your shop without a redirect.

Test webhook secret: filled in automatically when the webhook is registered. Paste a secret (whsec_...) only if you registered the webhook URL yourself.

Live webhook secret: filled in automatically when the webhook is registered. Clear it and save to register the webhook again.

A webhook secret must look like whsec_ followed by base64 text. Any other value is not saved, and the previous value is kept.

Clear saved secrets: tick a key or secret and click Save to remove it. An empty field keeps the saved value. Clearing a webhook secret and saving registers the webhook again.

Advanced

Debug log: writes Yoco requests and webhooks to logs/yoco_p_debug.log.php in the module folder. The file cannot be opened from the web. Errors and warnings, such as failed requests to Yoco and rejected webhooks, are always logged. Keys, webhook secrets and e-mail addresses are masked. Default: off.

Log: shows the size and the latest entries of the log. Click Clear log to empty it.

Delete data: when on, uninstalling the module removes the settings, the log and the webhooks the module registered at Yoco. Order data (Yoco checkout and payment IDs, refunds) and the order status Yoco payment on hold always stay, because they are needed for refunds. Default: off.

Checkout

At the payment step the customer chooses the payment method (by default Card or Instant EFT (Yoco)) and confirms. The module creates a Yoco checkout for the cart total in cents and sends the customer to the Yoco payment page, where the customer pays by card or Instant EFT. No order exists yet at this point.

After paying, the customer returns to your shop. The order is marked paid only after Yoco confirms it: the module asks Yoco for the checkout when the customer comes back and again when the signed webhook arrives. The order is then created and the customer sees the standard order confirmation page with Your payment with Yoco has been received. If Yoco has not confirmed the payment yet when the customer comes back, a Payment confirmation page shows We are waiting for Yoco to confirm your payment. The order will be updated automatically — please do not pay again. with a Check again button; the webhook creates the order as soon as it arrives.

If the customer cancels on the Yoco page, the customer is back at checkout with The Yoco payment was cancelled. Your cart is saved — you can pay again or choose another payment method. If the payment fails, the message is The Yoco payment was not successful. Please try again or choose another payment method. The cart is kept.

Before a new payment attempt for the same cart the module checks the previous one with Yoco. If it was already paid, the order is created without a new payment page. If it is still open for the same amount and was created less than 30 minutes ago, the customer gets the same Yoco page again. Otherwise a new Yoco checkout is created.

If Yoco cannot start the payment, the customer stays at checkout with Yoco could not start the payment. Please try again in a moment or choose another payment method. and the reason is written to the log. An order below R2.00 gets Yoco requires an order total of at least R2.00.

The webhook works while the shop is in maintenance mode and is not blocked by the country restriction of your shop.

Payments are charged immediately on the Yoco page. The module has no saved cards, subscriptions or recurring payments, no on-site card form and no separate authorize and capture, and it does not work in currencies other than ZAR.

Orders and refunds

Order statuses

No order yet: the customer was sent to Yoco and has not paid, cancelled on the Yoco page, or Yoco has not confirmed the payment yet. Only the cart exists.

Payment accepted: the payment was confirmed. The payment is recorded with the Yoco payment ID as the transaction ID, and a note shows the amount, the Yoco payment and checkout IDs, the mode and how the payment was confirmed (the customer's return, the webhook or a check before a new payment attempt).

Yoco payment on hold: Yoco reported a different amount or currency than the cart total, for example because the cart was changed in another tab after the payment started. No payment is recorded, the note explains it, and the customer sees We received your payment and are reviewing it. We will contact you if anything else is needed. Check the payment before shipping. If the customer then pays the right amount with another attempt, the order moves to Payment accepted.

Cancelled or Refunded: a payment that arrives for such an order does not change it. A note asks you to refund the payment in the Yoco portal or restore the order manually. The customer sees Your payment was received after the order had been cancelled. Please contact us — do not pay again.

If a second payment arrives for an order that is already paid, the order is not changed. A note asks you to refund it in the Yoco portal.

Yoco payment block

The order page shows a Yoco payment block with the Yoco payment and checkout IDs, the status, the amount paid and refunded, a Test mode badge for test payments, the refund history, the payment attempts of the cart (when there was more than one) and the Yoco notes of the order.

Refunds

In the Yoco payment block enter the amount (the amount not refunded yet is filled in), optionally a reason, and click Refund via Yoco. Confirm the question Refund this amount through Yoco? This cannot be undone. Full and partial refunds are supported. You need the right to edit orders. Refunds are made from the amount Yoco charged, so you can refund at most what the customer actually paid, even if the order was edited later. The refund is sent in the mode the payment was made in (test or live), so that mode's secret key must be set. A refund repeated after a lost answer is not paid out twice.

A successful refund is added to the refund history and the notes with the Yoco refund ID. A full refund sets the order to Refunded; a partial refund does not change the status. If Yoco refuses the refund, the block shows Yoco refused the refund: with the reason, and no refund is recorded. If Yoco reports the refund as pending, the block says it is still pending. Do not repeat it: it is recorded when Yoco confirms it by webhook. Refunds are available for orders paid by a Yoco checkout. An order in Yoco payment on hold has no paid checkout to refund; refund it in the Yoco portal.

The module does not create credit slips. The standard PrestaShop refund buttons of the order page do not send money back through Yoco.

Refunds made in the Yoco portal arrive by the refund.succeeded webhook and are recorded in the refund history and the notes. When they reach the amount paid, the order is set to Refunded. A refund larger than the amount left to refund is not recorded, and a note asks you to check the order. A failed refund adds a note that the money was not returned to the customer.

License key

The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Yoco Pay Gateway is the first block on Modules > Module Manager > VibeFox Yoco Pay 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-yoco 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, Yoco 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, and refunds work.

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

Yoco does not appear at checkout: check that the license is active, Enable/Disable is on and the current mode has a secret key: Test secret key in test mode, Live secret key in live mode. The cart currency must be ZAR, and the order total at least R2.00. The settings page shows a warning when the key is missing or the shop currency is not ZAR. In Payment > Preferences check that the module is allowed for ZAR, the customer's country and the customer's group.

The payment went through, but no order was created: the webhook is not working. Open the Webhooks section of the settings and check the state of the mode you use. If it is not registered, or registered for another URL, save the settings. If the registration fails, the page shows the reason. If you entered the secret yourself, check that it belongs to the webhook of this URL and mode. The order is also created when the customer returns to the shop after paying, and when the customer tries to pay again.

Could not register the webhook: payments are still confirmed when customers return to the shop. Fix the reason shown in the message, for example the shop must be reachable from the internet over HTTPS, and save again. You can also register the URL yourself and paste the signing secret.

Webhooks are rejected: rejected webhooks are written to the log. webhook secret not configured means neither webhook secret is set. invalid signature means the secret belongs to another registration or mode. timestamp outside the tolerance means the server clock is wrong: signatures are accepted within 5 minutes of the server time. checkout not completed yet — retry and could not confirm the checkout with Yoco — retry are temporary; Yoco sends the webhook again.

The webhook URL shows POST only in the browser: this is normal. The URL accepts only requests from Yoco.

The secret key must start with sk_test_ / sk_live_ error on save: a key was pasted into the wrong field. The test key starts with sk_test_, the live key with sk_live_. The previous value was kept.

The customer sees an error when choosing Yoco: look at the Log field on the module page. Yoco is not available at the moment. Please choose another payment method. means the current mode has no secret key.

The customer is told a payment needs to be reviewed: an attempt was paid with a different amount, or after the order was cancelled. Read the notes in the Yoco payment block and fulfil the order or refund the payment in the Yoco portal.

Refund fails with a message about the mode: the payment was made in test or live mode, and the secret key of that mode is not set. Enter it and try again.

Refund fails with No answer from Yoco: nothing was recorded in PrestaShop. If Yoco did process the refund, repeat the same refund: it is not refunded twice.

Developers: the hook actionYocoPCheckoutPayload lets another module change the request that creates the Yoco checkout.

Uninstall

Go to Modules > Module Manager, open the menu next to VibeFox Yoco Pay Gateway and choose Uninstall. The license key and license status of this module are always removed. If Delete data is on, the settings, the log and the webhooks the module registered at Yoco are removed. If it is off, all settings are kept for a later re-install. The Yoco checkouts and refunds and the order status Yoco payment on hold are always kept, so orders paid before can still be refunded after a re-install. Existing orders keep their payment notes and transaction IDs.

Yoco is a trademark of its respective owner. This module is not affiliated with or endorsed by Yoco.