Accept Bitcoin, Lightning, Litecoin, Monero and more on your Magento 2 store with NakoPay.
- Magento 2.4.x
- PHP 8.1+
- A NakoPay account (sign up)
composer require nakopay/magento2
php bin/magento module:enable NakoPay_Payments
php bin/magento setup:upgrade
php bin/magento cache:flush- Go to Stores > Configuration > Sales > Payment Methods > NakoPay
- Set Enabled to Yes
- Enter your Secret API Key (
sk_live_*orsk_test_*) from nakopay.com/dashboard/api-keys - Enter your Webhook Secret (
whsec_*) - created when you register a webhook endpoint - Choose your default cryptocurrency and invoice expiry time
- Save and flush cache
Register a webhook endpoint in your NakoPay dashboard pointing to:
https://your-store.com/nakopay/payment/webhook
Enable these events:
invoice.paidinvoice.expiredinvoice.canceled
All webhooks are verified using HMAC-SHA256 signatures before processing.
- Customer selects "Pay with Bitcoin & Crypto" at checkout
- Magento creates the order and redirects to NakoPay's hosted checkout page
- Customer pays with their chosen cryptocurrency
- NakoPay sends a webhook to update the order status automatically
- Customer is redirected back to the success page
Use a sk_test_* API key to test without real payments. Test invoices behave identically but don't require actual crypto.
- API keys are stored encrypted using Magento's built-in
Encryptedbackend model - Webhook payloads are verified with HMAC-SHA256 timing-safe signature comparison
- CSRF protection is properly handled on the webhook endpoint
- No raw SQL - uses Magento's repository and search criteria APIs
Logs are written to var/log/nakopay.log. Check this file for debugging webhook and API issues.
MIT