VibeFox 2C2P for Adobe Commerce — सहायता
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.
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 order currency must be supported by the module 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 currency of the cart 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 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-2c2p-payment. Without Composer: unpack the ZIP file into app/code/Vibefox/TwoCTwoPPayment/, so that registration.php is directly in that folder.
2. Run bin/magento module:enable Vibefox_TwoCTwoPPayment 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 2C2P Payment. 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 your sandbox Merchant ID and Secret Key, set Enable to Yes, click Save Config and place a test order. When you are ready, enter the live credentials, set Sandbox Mode to No and click Save Config.
The module adds the 2C2P Payment 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 one table for the 2C2P payment attempts. The return and notification URLs are sent with every payment. Nothing has to be configured in the 2C2P portal.
Configuration
All settings are in Stores > Configuration > Sales > Payment Methods > VibeFox 2C2P Payment, 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 from the Default Config only. Save Config saves the whole page. Amounts accept "9.99" and "9,99".
Wrong values do not stop the save. Magento saves the page and shows a warning for the field: an empty Title, a title longer than 128 characters or a Sort Order that is not a whole number keeps its previous value (2C2P: invalid title; its previous value was retained.); a Minimum Order Total or Maximum Order Total that is not a number of 0 or greater is cleared (2C2P: order total must be a number, 0 or greater; the invalid field was cleared.).
While Enable is Yes, the Result URLs row in the Payment page section shows Sandbox mode is active. No real transactions will be processed. in sandbox mode, and The gateway is enabled but the Merchant ID or Secret Key for the current mode is empty, so it is hidden at checkout. when a key of the current mode is missing.
General
Enable: shows or hides 2C2P at checkout. It is shown only when the Merchant ID and Secret Key of the current mode are set. Default: No.
Title: the payment method name customers see at checkout. It is also stored in the order. Default: 2C2P Payment. 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 via credit/debit card, e-wallet, or internet banking through 2C2P.
Sandbox Mode: sends payments to the 2C2P sandbox (demo2.2c2p.com) with the sandbox credentials. 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.
Credentials
Sandbox Merchant ID: your sandbox 2C2P Merchant ID.
Sandbox Secret Key: your sandbox 2C2P Secret Key.
Live Merchant ID: your live 2C2P Merchant ID. Used when Sandbox Mode is No.
Live Secret Key: your live 2C2P Secret Key. Used when Sandbox Mode is No.
Magento stores the Secret Keys encrypted and shows only a mask (******) after saving. Leave the mask unchanged to keep the saved key, type a new value to change it. The key is saved exactly as entered, including quotes and backslashes; only spaces at the start and end are removed. To delete a saved key, clear the field and click Save Config.
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
Payment page language: the language of the 2C2P payment page. Default: English.
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.
Order ID prefix: optional, letters and digits only, up to 10 characters, 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. Other characters are removed when you save, with the warning Order ID prefix: only letters and digits (max 10) are allowed, other characters were removed.
Result URLs: shows, for reference, the Frontend return URL and the Backend notification URL of the default store view. They look like https://your-store/wcp2c2ppayment/checkout/back/ and https://your-store/wcp2c2ppayment/notify/index/. Each payment sends these URLs of the store view where the order was placed, automatically.
Conditions
Payment from Applicable Countries: All Allowed Countries offers 2C2P for every country your store allows, Specific Countries only for the countries below.
Payment from Specific Countries: offer 2C2P only for billing addresses in these countries.
Minimum Order Total: offer 2C2P only from this order total, in the base currency of your store. Empty means no minimum.
Maximum Order Total: offer 2C2P only up to this order total, in the base currency. Empty means no maximum.
Advanced
Enable Logging: writes 2C2P events to var/log/tc2p_p_debug.log.php in the Magento folder: rejected signatures, failed confirmations and order e-mails that could not be sent. The file cannot be opened from the web. No card data, secret keys, tokens or customer data are logged. Default: No. Nothing is written while it is off, errors included.
Remove data on uninstall: when Yes, uninstalling the module with its data deletes the gateway settings and the log (see Uninstall). The license key is always removed. The 2C2P payment attempts, the orders and their history always stay. Default: No.
Sort Order: the position among the payment methods at checkout. A whole number.
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 2C2P Payment) and sees the description and the note You will be redirected to 2C2P 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 next page shows You are being redirected to 2C2P. and sends the customer to the 2C2P payment page after a moment. If that does not happen, the customer clicks Pay via 2C2P. The page also has a Back to cart link.
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 module 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 payment attempt gets its own 2C2P order ID (the cart number, the letter A and the attempt number, after the optional prefix), 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 results are handled even when Enable is No or the license is not active.
After a successful payment Magento creates the invoice with the 2C2P transaction as the transaction ID, the order moves to Processing and the order e-mail is sent. The customer sees the standard order success page. For a pending payment, for example a cash payment that is not made yet, the success page shows Your 2C2P payment is awaiting confirmation. For an order on hold it shows Your 2C2P payment is being reviewed by the store. A customer who comes back in another browser lands on the home page.
If the payment was cancelled or not completed, the order is cancelled (the stock goes back), the cart is restored and the customer is back in the cart with Payment was cancelled. You may try again. or Payment was not completed. You may try again. The customer can pay again or choose another payment method. If the result cannot be confirmed, the customer sees We could not confirm the 2C2P payment result. If the payment cannot be started, for example because the order currency is not supported, the order is cancelled, the cart is restored and the customer sees We could not start the 2C2P payment. Please try again or choose another payment method.
If the cart already has a paid, pending or held 2C2P payment, no second payment form is built: the customer goes to the success page of that order, or to the home page with This cart already has a 2C2P payment.
Magento cancels orders that stay in Pending Payment longer than the Pending Payment Order Lifetime (Stores > Configuration > Sales > Sales > Orders Cron Settings). The module does not stop such a cancellation. If 2C2P later reports a payment for a cancelled order, the order is not invoiced automatically: it stays Canceled and a note asks you to check the stock and fulfil the order or refund the payment.
The module works with the standard Magento checkout. It has no online refunds from Magento, no saved cards, no recurring payments or subscriptions, no card fields on your site and no support for the 2C2P PGW 4.x API. 2C2P is not offered for orders created in the Admin.
Orders and refunds
Order statuses
Pending Payment: the order was placed and the customer was sent to 2C2P, but no result has arrived yet, or the payment is pending at 2C2P (status 001), for example a cash payment the customer has not paid yet. There is no invoice. The order is invoiced when 2C2P reports the payment.
Processing: 2C2P reported a successful payment (status 000). The invoice is created with the 2C2P transaction as the transaction ID, and a note shows the transaction and how it was confirmed (backend notification or frontend return).
On Hold: 2C2P reported a different amount or currency than the order total. No invoice is created. The note says 2C2P amount/currency mismatch. Payment is on hold for manual review. Check the order and the transaction in the 2C2P portal.
Canceled: the payment was rejected, cancelled or failed (statuses 002, 003, 999), the payment could not be started, or the order was cancelled in Magento. The note shows the status. A failed result of an older attempt does not cancel an order that waits for a pending payment of 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 or a cart that is already paid, nothing is invoiced again. A note asks you to check it and refund the duplicate in the 2C2P merchant portal. The notes are order comments that the customer does not see.
2C2P payment information
On the admin order page (Sales > Orders > View) the payment information shows the payment method title and, when known, 2C2P order ID, 2C2P mode, Redirect API version, 2C2P transaction, 2C2P status, Payment channel, Approval code, Masked card, Transaction date/time, Channel response code, Channel response and 2C2P reported amount. It is shown also when the module is disabled. The customer sees only the payment method title.
Refunds
Refunds from Magento are not sent to 2C2P. Refund the payment in the 2C2P merchant portal, then create a credit memo for the invoice with Refund Offline to record the refund in Magento.
License key
The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox 2C2P Payment is the first row of the VibeFox 2C2P Payment group in Stores > Configuration > Sales > Payment Methods, 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-2c2p 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, 2C2P 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 We could not start the 2C2P payment. Please try again or choose another payment method. 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.
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
2C2P 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 Merchant ID and Secret Key: the sandbox fields in sandbox mode, the live fields in live mode. The Payment page section shows a warning when a key is missing. Check that the currency of the cart is supported. 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: 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 signature messages in the Log field. Check also that your server accepts requests from 2C2P to the backend notification URL. If the payment is pending at 2C2P (for example a cash payment that the customer has not paid yet), the order waits in Pending Payment until 2C2P reports it.
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 an error occurred while the order was being updated; 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.
Results fail while the store is in maintenance mode: Magento maintenance mode closes the whole site, the notification and return URLs too. The order is confirmed by the next result that reaches the store.
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 On Hold or Canceled: the paid amount or currency did not match the order, or the payment arrived after the order had been cancelled, for example by the Pending Payment Order Lifetime cron. Read the order notes and check the transaction in the 2C2P portal.
The customer is back in the cart with We could not start the 2C2P payment: the currency of the order is not supported, the Merchant ID or Secret Key of the current mode is empty, the order total is zero, the module was disabled or the license is not active. The order of that attempt is cancelled.
There is no Refund button on the credit memo: this is normal. The module has no online refunds. Refund the payment in the 2C2P merchant portal, then use Refund Offline.
For developers: the payment fields can be changed before they are signed with the Magento event tc2p_p_payment_fields (transport fields and the order).
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_TwoCTwoPPayment. It removes the data and the code.
Installed in app/code: run bin/magento module:uninstall --non-composer Vibefox_TwoCTwoPPayment to remove the data, then bin/magento module:disable Vibefox_TwoCTwoPPayment, delete the folder app/code/Vibefox/TwoCTwoPPayment and run bin/magento setup:upgrade.
The license key and license status are always removed. If Remove data on uninstall is Yes, the gateway settings and the log are removed too. If it is No, the settings are kept for a re-install. The 2C2P payment attempts are always kept, so a late result of an old payment is still handled after a re-install. Existing orders keep their invoices, payment notes and transaction IDs.
2C2P is a trademark of its respective owner. This module is not affiliated with or endorsed by 2C2P.
