Back

VibeFox PagSeguro 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: Brazilian Real (BRL). The payment method is shown only for carts in BRL.

HTTPS: your shop must be reachable from the internet over HTTPS so that PagBank can deliver payment notifications.

PagBank account: a production token for real payments and a sandbox token for tests. Production: log in to your PagBank account, open Venda online > Integrações and click Gerar token; PagBank sends the token by e-mail. Sandbox: create a sandbox account in the PagBank developer portal and copy its token. Sandbox and production tokens only work in their own environment.

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 PagSeguro 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 sandbox token and, to take real payments, the production token.

5. Turn on Enable / Disable and click Save. Make test payments with Sandbox Mode on, then switch it off to take real payments.

On install the module creates two order statuses, Awaiting PagBank payment and PagBank payment on hold. PrestaShop offers a new payment module for all currencies, countries and customer groups. You can limit them in Payment > Preferences; the BRL currency must stay allowed for the module.

Configuration

All settings are on the module page: Modules > Module Manager > VibeFox PagSeguro Gateway > Configure. Each section has its own Save button, which saves the whole page. Above the fields the page shows the current mode: SANDBOX MODE (payments are created in the PagBank sandbox, no real charges) or LIVE (payments are created with the production token). It warns you when the token of the current mode is missing (the payment method is then hidden at checkout) and when the default shop currency is not BRL (the payment method is then not offered for carts in other currencies).

PagSeguro / PagBank

Enable / Disable: Enable PagSeguro/PagBank 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: PagSeguro / PagBank. Required.

Description: the text shown under the payment method at checkout. Default: Pay securely via PagSeguro/PagBank. You will be redirected to complete your payment.

PagBank account

The section explains where to get the tokens and links to your PagBank account and to the PagBank page about tokens.

Sandbox Mode: Enable sandbox/test mode (no real charges). New payments go to the PagBank sandbox with the sandbox token, and customers see SANDBOX MODE — Using test environment. No real charges. under the payment method. Status checks and refunds of an order always use the environment and token in which its payment was created. Default: on.

Sandbox token: the PagBank sandbox token. Used while sandbox mode is on.

Production token: the PagBank production token (Bearer). Used when sandbox mode is off. Keep it secret.

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

Clear saved tokens: tick a token and click Save to remove it. An empty field keeps the saved value.

Payment notifications

Notification URL: every payment tells PagBank where to report status changes, so there is nothing to configure in PagBank. The section shows the URL. With friendly URLs it looks like https://your-shop/module/wcp_pagseguro_gateway/webhook. The address must be reachable from the internet over HTTPS.

Notifications that carry an x-authenticity-token header are checked with the token of the environment in which the payment was created; an invalid signature is rejected. The notification body itself is never trusted: the module always reads the checkout and the PagBank order from the PagBank API (status, amount, currency) before an order is created or changed. Without notifications, the order is created when the customer returns to the shop after paying.

Advanced

Debug log: Log API requests and notifications writes details to logs/wc_psg_debug.log.php in the module folder. The file cannot be opened from the web. Logs contain no tokens and no customer data. Errors are always 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 module removes the gateway settings and the log. Orders, their PagBank references (needed for refunds) and the order statuses are always kept. Default: off.

Checkout

At the payment step the customer chooses the payment method (by default PagSeguro / PagBank) and confirms. The module creates a PagBank checkout for the cart total in BRL as one item, Order # with the cart number and your shop name, and sends the customer to the PagBank payment page. The customer's name and e-mail, the CPF or CNPJ from the Identification number or VAT number field of the address and a Brazilian phone number are filled in when the shop has them; the customer can complete or correct them on the PagBank page. The customer pays with the methods enabled in your PagBank account, for example credit card, PIX or boleto. The payment page expires after 120 minutes. No order exists yet at this point.

After paying, the customer returns to your shop. The order is marked paid only after PagBank confirms it: the module reads the payment from the PagBank API when the notification arrives or when the customer comes back, and a return alone never marks an order paid. The order is then created and the customer sees the order confirmation page with Your payment with PagBank has been received. For a generated boleto or PIX, or a payment in analysis, the page shows Your PagBank payment is awaiting confirmation (boleto / PIX / analysis). The order will be confirmed as soon as PagBank reports the payment. If such a payment is later declined or cancelled, the page shows Your PagBank payment was not completed. Please contact us about this order. If PagBank has not confirmed the payment yet when the customer comes back, a Payment confirmation page shows We are confirming your payment with PagBank. The order will be updated automatically — please do not pay again. with a Check again button.

If the payment was not completed, the customer is back at checkout with The PagBank payment was not completed. You can pay the order again below., The PagBank payment page has expired. You can pay the order again below. or The payment was declined by PagBank. Please try again with another card or payment method. The cart is kept. If an order that was waiting for a boleto or PIX was cancelled, the customer sees The PagBank payment was cancelled, so the order was cancelled.

When the customer pays again, the open PagBank checkout is reused if the amount and environment are the same and it does not expire within 10 minutes. Otherwise the previous checkout is deactivated, so it can no longer be paid. A payment made on the previous page before that still counts for the cart, and the order is created instead of a new payment.

If PagBank cannot start the payment, the customer stays at checkout with a short message, for example PagBank did not accept your billing details (CPF/CNPJ). Please check them and try again. or Could not connect to PagBank. Please try again in a moment. The technical reason is written to the log.

Notifications work while the shop is in maintenance mode and are not blocked by the country restriction of your shop.

The module has no on-site card form, no saved cards, no subscriptions or recurring payments and no split payments or marketplaces. Payment methods and installments are those configured in your PagBank account.

Orders and refunds

Order statuses

No order yet: the customer was sent to PagBank and has not paid, the card was declined or the payment page expired. Only the cart exists, and the customer can pay again.

Payment accepted: the payment was confirmed with the expected amount and currency. The payment is recorded with the PagBank charge ID as the transaction ID, and a note shows the amount, the payment method and the charge ID.

Awaiting PagBank payment: a boleto or PIX was generated and is waiting for payment, or the payment is in analysis. The order moves to Payment accepted when PagBank reports it as paid.

PagBank payment on hold: PagBank reported a different amount or currency than the cart (for example, the cart was changed after the payment page was created), a payment arrived after the order had been cancelled (check stock, then complete the order or refund the payment in PagBank), or a card payment was authorized but not captured (capture it in PagBank). The note explains it. The money actually received is recorded on the order.

Payment error: a payment that was waiting or in analysis was declined.

Canceled: a payment that was waiting, for example an expired boleto or PIX, was cancelled.

Refunded: the payment was fully refunded, through the module or in the PagBank dashboard.

Every PagBank status is applied once, so repeated notifications or returns add no notes or status changes. If a second payment arrives for an order that is already paid, the order is not changed and a note asks you to refund the duplicate in PagBank.

PagBank payment block

The order page shows a PagBank payment block with the PagBank checkout, the PagBank order and charge IDs, the payment method, the status, the amount paid and refunded, a Sandbox badge for sandbox payments, the refund history and the PagBank notes of the order.

Refunds

In the PagBank payment block enter the amount (the amount not refunded yet is filled in), optionally a reason, and click Refund via PagBank. Confirm the question Refund this amount through PagBank? This cannot be undone. Full and partial refunds are supported. You need the right to edit orders; access to the Modules pages is not needed. The limit is the amount PagBank charged, so after an amount mismatch you can refund up to what the customer actually paid, not the order total. The refund is sent in the environment and with the token in which the payment was made. A refund is recorded only when PagBank confirms it; otherwise the block shows the error, for example PagBank refund failed: ... or PagBank did not confirm the refund, and nothing is recorded. Refunds of boleto payments and partial refunds of PIX follow PagBank's rules. A successful refund is added to the refund history and the notes with the charge ID. A full refund sets the order to Refunded; a partial refund does not change the status. Refunds are available once PagBank has reported the payment as paid.

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

Refunds made in the PagBank dashboard are seen with the next notification: a full refund sets the order to Refunded, a partial refund adds a note with the refunded amount, and you can add the refund to the order manually.

License key

The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox PagSeguro Gateway is the first block on Modules > Module Manager > VibeFox PagSeguro 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-pagseguro 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, PagBank 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

PagBank does not appear at checkout: check that the license is active, Enable / Disable is on, the token of the current mode is set (Sandbox token in sandbox mode, Production token in live mode) and the cart currency is BRL. The settings page shows a warning when the token is missing or the shop currency is not BRL. In Payment > Preferences check that the module is allowed for BRL, the customer's country and the customer's group.

The payment went through, but no order was created: PagBank has not reported the payment yet and the customer did not return to the shop. The order is created as soon as the notification arrives. Check that your shop is reachable from the internet over HTTPS at the Notification URL, and turn on Debug log to see the notifications.

The notification answers Invalid signature: the x-authenticity-token does not match the token of the environment in which the payment was made, or that token is not saved. Check that the right token is in the settings.

The notification answers Verification failed, retry later: the PagBank API could not be reached, the token of the payment's environment is missing, or the cart was being processed by another request at the same moment. PagBank retries the notification.

The notification answers Order not found: the notification is for a cart that was not paid with this module in this shop. Nothing is changed.

The customer sees PagBank payments are temporarily unavailable. Please choose another payment method.: the token of the current mode is missing or PagBank rejected it.

The customer sees PagSeguro/PagBank only accepts payments in Brazilian Real (BRL).: the cart is in another currency.

Order is PagBank payment on hold: read the notes in the PagBank payment block (see Order statuses), compare the amounts in PagBank, then fulfil the order or refund the payment.

Refund fails with a message about the token: the payment was made in the sandbox or in production, and the token of that environment is missing or rejected. Enter the right token and try again.

Uninstall

Go to Modules > Module Manager, open the menu next to VibeFox PagSeguro 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 PagBank payments and refunds of the orders and the order statuses Awaiting PagBank payment and PagBank 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.

PagSeguro and PagBank are trademarks of their respective owner. This module is not affiliated with or endorsed by PagSeguro or PagBank.