VibeFox Barion for Adobe Commerce — Yardım
Requirements
Magento: Magento Open Source or Adobe Commerce 2.4.6 to 2.4.9, on your own server or hosting, on premises or on Adobe Commerce on cloud infrastructure. The module does not work with Adobe Commerce as a Cloud Service (the SaaS edition), which does not accept PHP modules.
PHP: 8.1 to 8.4.
Barion shop: you need the POSKey (secret key) of your shop and the e-mail address of the Barion wallet that receives the payments. Both are in the Barion portal: secure.barion.com for live, secure.test.barion.com for test, under My stores and your shop. Test and live have different credentials.
Currency: the order currency must be HUF, EUR, USD or CZK. For other currencies the payment method is hidden at checkout.
Reachable store: Barion calls your store after each payment, so the site must be reachable from the internet, without a firewall or basic authentication in front of it.
VibeFox license key: bought on vibefox.net. One key works on one domain.
Installation
The module is one ZIP file. It is a Composer package and can also be copied into app/code. Run the commands in the Magento root folder as the user that owns the Magento files.
1. With Composer: put the ZIP file into a folder that your project uses as a Composer "artifact" repository and run composer require vibefox/module-barion-payment. Without Composer: unpack the ZIP file into app/code/Vibefox/BarionPayment/, so that registration.php is directly in that folder.
2. Run bin/magento module:enable Vibefox_BarionPayment and bin/magento setup:upgrade. In production mode also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy, then bin/magento cache:flush.
3. In the Admin go to Stores > Configuration > Sales > Payment Methods and open VibeFox Barion Gateway. When the Magento PayPal module is enabled, the group is listed under Other Payment Methods. Paste your VibeFox license key into License key in the license block, the first row of the group, and click Activate (see License key).
4. Enter the test POSKey and test payee e-mail, keep Test Mode at Yes, set Enable to Yes, click Save Config and place a test order. When everything works, enter the live credentials, set Test Mode to No and click Save Config.
The module adds the Barion payment method to the Magento checkout. It is off after installation (Enable = No). The module uses the standard Magento order states and creates no order statuses of its own. It creates its own tables for the Barion payment attempts, the verified payment states and the refunds. The callback URL is sent to Barion automatically with every payment. Nothing has to be configured in the Barion portal.
Configuration
All settings are in Stores > Configuration > Sales > Payment Methods > VibeFox Barion Gateway, in the standard Magento configuration form. Like other Magento settings, they can be changed for a website with the Scope switcher at the top of the page; Title and Description also for a store view. Remove Data on Uninstall is read for the default store view, so set it in the Default Config. Save Config saves the whole page. Amounts accept "9.99" and "9,99".
If a value is wrong, Magento shows an error and nothing on the page is saved: an empty Title or a title longer than 128 characters (Barion: enter a title of 1 to 128 characters.); a Sort Order that is not a whole number (Barion: sort order must be a whole number.); a Minimum Order Total or Maximum Order Total that is not a number of 0 or greater (Barion: order total must be a non-negative number.). The POSKeys and payee e-mails are saved as entered, only spaces at the start and end are removed; their format is not checked when you save.
Barion Setup
The first row after the license block shows the Callback URL (sent to Barion automatically with each payment), which looks like https://your-store/wcpbariongateway/callback/index/, the hint Get the POSKey and wallet email from My stores in the matching Barion test or live portal. and the links Barion test portal and Barion live portal. Each payment sends the callback URL of the store view where the order was placed, so there is nothing to configure in Barion. It only has to be reachable from the internet.
While Enable is Yes, the row also shows warnings: Barion: store currency … is not supported. with the list of supported currencies; Barion: the POSKey or Payee Email of the active mode is missing; the method is hidden at checkout.; Barion: check the wallet email of the active mode. when the payee e-mail of the current mode is not a valid e-mail address; and Test mode: no real payment is taken. while test mode is on.
General
Enable: shows or hides Barion at checkout. It is shown only when the POSKey and the payee e-mail of the current mode are set. Default: No.
Title: the payment method name customers see at checkout. It is also the payment method name stored in the order. Default: Barion. Required, at most 128 characters.
Description: shown in the payment method list at checkout, under the method when the customer selects it. Default: Pay securely with Barion — card, Barion Wallet, Apple Pay or Google Pay.
Barion Shop Credentials
Get your POSKey and wallet e-mail in the Barion portal: secure.barion.com (live) or secure.test.barion.com (test), My stores, your shop. Test mode uses only the test credentials, live mode only the live ones.
Test Mode: uses the test credentials below and the Barion sandbox (api.test.barion.com). No real money is charged. Default: Yes. Set it to No to take real payments. While it is on, customers see Test mode: no real payment is taken. under the payment method.
Test POSKey: the POSKey of your TEST Barion shop (secure.test.barion.com, My stores).
Test Payee Email: the e-mail address of the TEST Barion wallet receiving the payment.
Live POSKey: the POSKey of your LIVE Barion shop (secure.barion.com, My stores).
Live Payee Email: the e-mail address of the LIVE Barion wallet receiving the payment.
Magento stores the POSKeys encrypted and shows only a mask (******) after saving. Leave the mask unchanged to keep the saved key, type a new value to change it. To delete a saved key, clear the field and click Save Config.
Callbacks, returns and refunds always use the POSKey of the mode the payment was started in. A payment started in test mode is still checked with the test POSKey after you switch to live, so keep the key of the old mode until its payments are finished.
Orders
Order Status After Payment: the order state set after a successful, verified payment.
Payments still processing at Barion leave the order in Pending Payment. Amount or currency mismatches always put the order On Hold.
Native Restrictions
Payment from Applicable Countries: All Allowed Countries offers Barion for every country your store allows, Specific Countries only for the countries below.
Payment from Specific Countries: offer Barion only for billing addresses in these countries.
Minimum Order Total: offer Barion only from this order total, in the base currency of your store. Empty means no minimum.
Maximum Order Total: offer Barion only up to this order total, in the base currency. Empty means no maximum.
Sort Order: the position among the payment methods at checkout. A whole number.
Advanced
Logging: writes Barion requests, callbacks and errors to var/log/barion_p_debug.log.php in the Magento folder. The file cannot be opened from the web and is rotated at 5 MB. POSKeys, e-mail addresses and URLs are hidden in the log. Default: No. Nothing is written while it is off, errors included.
Remove Data on Uninstall: when Yes, uninstalling the module with its data removes the module settings of all scopes and the log (see Uninstall). The license key is always removed. Orders, invoices, credit memos and the Barion payment and refund records are always kept. Default: No.
Log: shows the size and the latest entries of the log. Click Clear log to empty it.
Checkout
At the payment step the customer chooses the payment method (by default Barion) and sees the description and the note You will be redirected to Barion to complete the payment securely. After Place Order, Magento places the order in Pending Payment. No invoice is created and no order e-mail is sent yet. The module starts a Barion payment for the order total in the order currency and sends the customer to the Barion payment page, where the customer pays by card, Barion Wallet, Apple Pay or Google Pay, whatever your Barion shop offers. Card data never touches your site.
The payment lists the products with their SKU, the shipping and the tax; discounts and rounding are spread over the lines so that the lines add up to the order total. HUF amounts are sent without decimals. The payment carries the Magento order number, the customer's e-mail is passed as a hint, and the page language follows the locale of the store view where Barion supports it (Hungarian, German, French, Spanish, Czech, Slovak, Slovenian, Greek; otherwise English). If the customer opens the payment step again for the same order, the same Barion payment page is used.
After paying, the customer returns to your store, and Barion also calls the callback URL. Barion callbacks are not signed, so neither request marks anything paid by itself: the module asks Barion for the payment state with the POSKey of the mode the payment was started in. The order is marked paid only after Barion confirms it, and only if the PaymentId, the amount and the currency match the order. The return link contains a random token of the payment attempt and only checks that attempt. The callback and the return are handled even when Enable is No or the license is not active.
After a successful payment Magento creates the invoice with the Barion transaction as the transaction ID, the order moves to the state set in Order Status After Payment and the order e-mail is sent. The customer sees the standard order success page. If Barion reports the payment as still in progress, or Barion cannot be reached at that moment, the customer sees a Payment confirmation page with Your payment is being confirmed by Barion. Please wait for confirmation before attempting another payment. and a Check again link; the callback confirms the order as soon as Barion confirms the payment. For an order on hold the page says Your Barion payment needs review. Please contact the store. A customer who comes back to a paid order in another browser lands on the home page with Your Barion payment has been received. A return link that does not match the payment attempt shows Payment verification failed.
If the payment was not completed (cancelled, expired or failed, or the customer came back without paying), the order is cancelled (the stock goes back), the cart is restored and the customer is back in the cart with Payment was not completed. Please try again. The customer can pay again or choose another payment method. Every attempt is kept: before a new Barion payment of the same cart is started, earlier unfinished attempts are checked at Barion again. While an earlier payment is still in progress or needs review, no second payment is started and the customer sees The previous Barion payment is still being verified. Check its status before starting another payment. If the cart is already paid by another order, the customer sees Your cart has already been paid. No second Barion payment was started.
If the payment cannot be started, the order is cancelled, the cart is restored and the customer sees a short message in the cart: The Barion payment could not be started. Please try again or choose another payment method., Barion payment is not available at the moment. Please choose another payment method. (the module is disabled, the POSKey or payee e-mail of the current mode is missing, or the currency is not supported) or Barion cannot process a zero order total. The details go to the log when Logging is on.
Magento cancels orders that stay in Pending Payment longer than the Pending Payment Order Lifetime (Stores > Configuration > Sales > Sales > Orders Cron Settings). Barion has no API to cancel a started payment, so the module does not stop such a cancellation. If Barion later reports a payment for a cancelled order, the order is not invoiced and not reopened: it stays Canceled and a note asks you to reconcile the payment in the Barion portal.
The module works with the standard Magento checkout. It takes immediate payments only. It has no reservation or delayed capture payments, no subscriptions or recurring payments, no saved cards and no Barion Pixel; Barion handles 3-D Secure on its payment page. Barion is not offered for orders created in the Admin or for checkout with multiple addresses.
Orders and refunds
Order statuses
Pending Payment: the order was placed and the customer was sent to Barion, but Barion has not confirmed the payment yet. When Barion reports the payment as in progress, a note shows the PaymentId and the Barion status. There is no invoice. The order is invoiced when Barion confirms the payment.
Processing or Complete: Barion confirmed the payment. The state follows Order Status After Payment. The invoice is created with the Barion transaction as the transaction ID, and a note shows how the payment was confirmed (callback or return), the PaymentId, the transaction, the amount and the payment request.
On Hold: Barion reported a different amount or currency than the order total. No invoice is created. The note shows the received and the expected amount and asks you to review the payment in the Barion portal. Fulfil the order or refund the payment in the Barion portal.
Canceled: the payment was cancelled, expired or failed at Barion, the customer came back without paying, the payment could not be started, or the order was cancelled in Magento. The note shows the Barion status.
Closed: the payment was fully refunded with a credit memo.
A paid or refunded order is never changed by a later callback, and repeated callbacks and returns, even at the same moment, never invoice an order twice. If a payment succeeds for an order that is already cancelled, for a cart that is already paid by another order, or with a Barion transaction that belongs to another order, nothing is invoiced: a note says that the payment needs portal reconciliation and that no new invoice was created. Check it in the Barion portal and refund it there if it is a duplicate. The notes are order comments that the customer does not see.
Barion payment information
On the admin order page (Sales > Orders > View) the payment information shows the payment method title and, when known, Barion payment ID, Barion request ID, Barion payment transaction, Barion mode (test or live), Last Barion status, Barion attempt status, Barion expected amount and the Barion refund history (date, amount, status, Barion refund transaction and the linked credit memo). It is shown also when the module is disabled. The customer sees only the payment method title.
Refunds
Open the order, go to the Invoices tab, open the invoice and click Credit Memo. Choose the items and amounts to refund and click Refund. The money is sent back through Barion. Full and partial refunds are supported. The Comment Text of the credit memo is sent to Barion as the refund comment. A credit memo started from the order page instead of the invoice offers only Refund Offline, which does not send money back through Barion.
The refund is made in the order currency, up to the amount Barion charged minus the amounts already refunded through the module. HUF refunds must be whole amounts. The refund is sent in the mode (test or live) the payment was made in, so that mode's POSKey must be set. If Barion does not accept or confirm the refund, Magento shows the error and the credit memo is not created. After a successful refund Magento records it on the order with the Barion refund transaction as the transaction ID, and the refund appears in the refund history. A full refund closes the order. Refunds are available once Barion has confirmed the payment and the order has an invoice; an order on hold after a mismatch has no invoice, so refund it in the Barion portal.
Every refund request is recorded before it is sent. If the answer of Barion is lost, the next try of the same credit memo first looks for that refund at Barion and does not send a second refund blindly. While the result of an earlier refund is uncertain, no new refund is sent. Refunds made in the Barion portal are not recorded in Magento. Create a credit memo with Refund Offline to record them.
License key
The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Barion Gateway is the first row of the VibeFox Barion Gateway group in Stores > Configuration > Sales > Payment Methods (Default Config scope), 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: magento-payment-barion and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only Admin users whose role allows the Payment Methods configuration section can change the key. The texts of the block follow the Admin interface locale (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 module keeps working on the last known status.
One key works on one domain: the domain of the default store view, also when the installation has several websites or stores. Removing the key from the store does not free its domain slot. Free the slot in your vibefox.net account.
Without an active key, Barion is not shown to customers at checkout. If a payment is started anyway, the order is cancelled, the cart is restored and the customer sees This payment method is not available. Please choose another one. The Magento storefront does not know that you are logged in to the Admin, 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 the System Messages of the Admin, with the links Enter the license key and Dismiss, which hides it for 7 days. 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: once a day for the first 14 days after the key is entered, then once a week, by the Magento cron and while you work in the Admin. Uninstalling the module with its data always removes the license key and license status.
Troubleshooting
Barion does not appear at checkout: check that the license is active and Enable is Yes for the website of the store, and that the current mode has a POSKey and a payee e-mail: the test fields in test mode, the live fields in live mode. The Barion Setup row shows a warning when one is missing. Check that the cart currency is HUF, EUR, USD or CZK. Check Payment from Applicable Countries and Payment from Specific Countries against the customer's billing address, and Minimum Order Total and Maximum Order Total.
The payment went through, but the order stays Pending Payment: the order is confirmed when Barion calls the callback URL or when the customer returns to your store. Make sure the site is reachable from the internet (no firewall or basic authentication in front of the callback URL). Check that the POSKey of the mode the payment was made in is correct, because the module asks Barion for the payment state with it. If Barion reports the payment as still in progress, the order waits until Barion confirms it. Turn on Logging to see the callback.
The callback answers Busy, retry: the order was being confirmed by the customer's return at the same moment, or an error occurred while the order was being updated. Barion calls again. Turn on Logging to see the reason.
The callback answers API error: the store could not read the payment state from Barion, or the POSKey of the mode the payment was made in is not set. Check that POSKey.
The callback answers Order not found: the PaymentId was not started by this store. Barion calls for other stores or test systems are ignored. Missing paymentId means that the request did not carry a valid PaymentId.
Callbacks fail while the store is in maintenance mode: Magento maintenance mode closes the whole site, the callback and return URLs too. The order is confirmed by the next callback or return that reaches the store.
The customer sees Payment verification failed: the return link does not match the payment attempt, for example it was edited. The payment state is still confirmed by the callback.
The customer is back in the cart with The Barion payment could not be started: turn on Logging and look at the Log field. A wrong POSKey or payee e-mail is the usual cause. The order of that attempt is cancelled.
The order is On Hold or a note asks for portal reconciliation: read the note on the order, check the payment in the Barion portal, then fulfil the order or refund the payment in the Barion portal.
Barion accepts HUF refunds only in whole currency units: Barion processes HUF without decimals. Enter whole amounts in the credit memo. If the order total has decimals, refund the rest in the Barion portal and record it with Refund Offline.
The refund says The Barion POSKey for this payment mode is missing: the payment was made in test or live mode, and that mode's POSKey is empty. Enter it and try again.
The refund says the previous Barion refund has an uncertain result: the answer of Barion to an earlier refund was lost or unclear. Check the refund in the Barion portal. Retrying the same credit memo checks Barion first; no second refund is sent.
The Refund button is missing on the credit memo: start the credit memo from the invoice (Invoices tab), not from the order page. An order without an invoice (for example On Hold after a mismatch) cannot be refunded online; refund it in the Barion portal.
The settings page or the checkout looks unchanged after installing or updating: run bin/magento setup:upgrade and bin/magento cache:flush; in production mode also setup:di:compile and setup:static-content:deploy.
Uninstall
Deleting the module code alone removes nothing from the database: the license key and the settings stay. To remove the data, uninstall the module with the Magento command:
Installed with Composer: run bin/magento module:uninstall --remove-data Vibefox_BarionPayment. It removes the data and the code.
Installed in app/code: run bin/magento module:uninstall --non-composer Vibefox_BarionPayment to remove the data, then bin/magento module:disable Vibefox_BarionPayment, delete the folder app/code/Vibefox/BarionPayment and run bin/magento setup:upgrade.
The license key and license status are always removed. If Remove Data on Uninstall is Yes, the module settings of all scopes and the log are removed too. If it is No, the settings are kept for a re-install. The tables with the Barion payment attempts and refunds are always kept, so orders paid before can still be refunded after a re-install. Existing orders keep their invoices, payment notes and transaction IDs.
Barion is a trademark of its respective owner. This module is not affiliated with or endorsed by Barion.
