The Payfim_CryptoPayment extension adds a Pay with Crypto payment method to the Magento checkout. The order is placed as Pending Payment, the crypto invoice is created on your server from the order total, and the order is invoiced automatically when your Payfim Gateway confirms the payment.
Before you start, install your Payfim Gateway and add your wallets (see Install the gateway and Add wallets). Compatibility: Magento Open Source / Adobe Commerce 2.4.4 – 2.4.8 · PHP 7.4 – 8.4.
- Upload and enable the extension.
Unzip
Payfim_CryptoPayment.zipin your Magento root folder - it createsapp/code/Payfim/CryptoPayment/. Then run from the Magento root:bin/magento module:enable Payfim_CryptoPayment bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy -f bin/magento cache:flush
(
setup:di:compileandstatic-content:deployare only needed in production mode.)Tip: Prefer Composer? Put
payfim-module-crypto-payment-3.0.0.zipin a folder, add it as anartifactrepository and runcomposer require payfim/module-crypto-payment. - Open the payment settings.
In the admin go to Stores → Settings → Configuration → Sales → Payment Methods. Under Other Payment Methods: expand Payfim - Crypto Payments (Bitcoin, USDT, Ethereum, Litecoin and more).
- Connect your Payfim Gateway.
Set Enabled to Yes, keep or change the Title (default Pay with Crypto) and Description, then enter the Gateway URL (e.g.
https://pay.yourstore.com) and the API Key from your Payfim dashboard (Integrations). Click Test connection - it should answer Connected to "Your Store" (Payfim 3.0.0, license valid) with the list of enabled coins - and click Save Config.Tip: The API key is stored encrypted and always shown as ****** after saving. Test connection uses the saved key when the field still shows ******.
- Choose how underpayments are handled.
When a Customer Underpays: Set order to Payment Review (default - the order view then offers Accept Payment / Deny Payment), Put order On Hold, or Keep Pending Payment, add a comment only. An underpaid order is never invoiced automatically. Optional: restrict countries, set minimum/maximum order totals, the sort order and Debug Logging (writes
var/log/payfim.log, never the API key). - How orders are processed.
After Place Order the customer is sent to your Payfim checkout page. When the payment is confirmed, the gateway posts a signed webhook to
https://yourstore.com/payfim/webhook/index/; the extension checks the signature, re-reads the invoice from the gateway and then creates the Magento invoice with a capture transaction whose ID is the blockchain transaction hash. The order moves to Processing, the history shows coin, amount and hash, and the order confirmation and invoice e-mails are sent. See it in Sales → Operations → Orders.Tip: Expired crypto quotes cancel the pending order automatically. Magento's own Stores → Configuration → Sales → Sales → Orders Cron Settings → Pending Payment Order Lifetime (minutes) also cancels abandoned Pending Payment orders - keep it longer than your Payfim invoice expiry (default 30 minutes after the coin is chosen).
Troubleshooting
- "Crypto payment is temporarily unavailable" after Place Order
- The invoice could not be created - the order is canceled and the cart restored. Enable Debug Logging and check
var/log/payfim.log; usually the Gateway URL/API key is wrong or the gateway license is invalid (use Test connection). - Payment method not shown at checkout
- Check Enabled for the right scope (Default Config / website), country and min/max total restrictions, and run
bin/magento cache:flush. After an upgrade runsetup:upgradeandsetup:static-content:deploy. - Order stays Pending Payment after paying
- Your store must be reachable from the gateway server at
/payfim/webhook/index/over HTTPS. Check Webhooks in the Payfim dashboard for the HTTP status; failed deliveries are retried for 24 hours. A full-page cache or WAF must not block POST requests to that URL. - Order is in Payment Review
- The customer sent less than requested. Contact the customer; click Accept Payment to continue (then create the invoice manually) or Deny Payment to cancel the order and refund from your wallet.
Get the Magento 2 Crypto Payment Extension - the download includes an illustrated PDF version of this guide.
