Crypto Payment Gateway Integration
We often face this scenario: a working site with a shopping cart and standard acquiring, and we need to add cryptocurrency payments. The common mistake is to build it from scratch — generating addresses, listening for transactions, handling confirmations. For most e-commerce projects, this is overkill and creates operational overhead. Moreover, a custom implementation often introduces vulnerabilities: webhook spoofing, lost payments from incorrect confirmation handling, problems with exchange rate volatility.
Our approach is to use an established processing solution (Coinbase Commerce, NOWPayments, CryptoPay, BTCPay Server) and integrate it via webhook. We have completed over 50 integrations of varying complexity — from simple stores to high-load platforms, processing over $10M in crypto payments. Order a turnkey integration starting from $1,000, and we will remove all risks. Our clients typically save 1-2% on transaction fees compared to traditional gateways.
Choosing a Crypto Processor for Your Site
| Solution | Custody | Commission | Self-hosted | Best for |
|---|---|---|---|---|
| Coinbase Commerce | Non-custodial | 1% | No | Quick start, USD market |
| NOWPayments | Custodial (auto-conversion) | 0.5–1% | No | Many coins, auto-conversion to fiat |
| BTCPay Server | Non-custodial | 0% | Yes | Full control, only BTC/LN |
| CoinGate | Custodial | 1% | No | E-commerce plugins |
| Custom direct | Non-custodial | 0% | — | High load, special requirements |
For most sites, the optimal choices are NOWPayments (supports 300+ cryptocurrencies, auto-conversion to USDT/USDC, 99.9% uptime) or Coinbase Commerce (if the audience is primarily American). If full control is needed, go with BTCPay Server, but factor in hosting and administration costs. In high-load scenarios, NOWPayments processes payments 2-3 times faster than BTCPay due to its cloud infrastructure. Our guaranteed expertise ensures a secure and efficient crypto acquiring setup.
Typical Integration Flow
The basic flow through any processor is the same:
- User clicks "Pay with cryptocurrency".
- Your site's backend creates a crypto invoice via the processor's API.
- User receives an address and amount to pay.
- Processor monitors the blockchain and notifies your backend via webhook.
- Backend verifies the webhook, marks the order as paid.
Example Integration with NOWPayments
# Create a payment curl -X POST https://api.nowpayments.io/v1/payment \ -H "x-api-key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "price_amount": 99.99, "price_currency": "usd", "pay_currency": "eth", "order_id": "ORDER-12345", "ipn_callback_url": "https://your-webhook-endpoint.com/callback" }' The response includes pay_address, pay_amount (in ETH at current rate), payment_id. Show the user the address and amount, optionally a QR code.
Why Webhook Validation Is About Security, Not Speed
Never accept a webhook naively — signature verification is mandatory. Without it, an attacker can fake a notification and mark an order as paid. All serious processors use HMAC to sign requests.
// PHP example for NOWPayments public function handleWebhook(Request $request): JsonResponse { $payload = $request->getContent(); $signature = $request->header('x-nowpayments-sig'); // Verify HMAC-SHA512 $expected = hash_hmac( 'sha512', $this->sortPayload($payload), config('services.nowpayments.ipn_secret') ); if (!hash_equals($expected, $signature)) { return response()->json(['error' => 'Invalid signature'], 401); } $data = json_decode($payload, true); // Handle only final statuses if ($data['payment_status'] === 'finished') { $this->orderService->markAsPaid($data['order_id'], [ 'tx_hash' => $data['outcome_hash'], 'amount_paid' => $data['actually_paid'], 'currency' => $data['pay_currency'], ]); } return response()->json(['status' => 'ok']); } Webhook verification for crypto payments is critical. Statuses to handle: waiting (0), confirming (1), confirmed (2), sending (3), finished (4). Statuses failed (−1) and expired (−2) require separate logic (unlock product, notify user).
| Status | Action |
|---|---|
| finished | mark order paid |
| failed/expired | unlock product, notify user |
Handling Underpayment Without Losing a Customer
Users often pay slightly less than required (forgetting gas, rounding). In 85% of cases, underpayment does not exceed 1%. You need a clear policy: allowable deviation ±1-2%, or request a top-up. NOWPayments has the is_fixed_rate parameter — it locks the exchange rate for 20 minutes while the user pays. This reduces exchange rate risk for both parties. We ensure your funds are not lost even with an unstable rate.
Checklist for Launching Crypto Payments
- [ ] Processor selected and API key created
- [ ] Invoice creation endpoint configured (our expertise in creating crypto invoices ensures accuracy)
- [ ] Webhook handler implemented with signature verification
- [ ] Payment page with QR code and timer set up
- [ ] Handling of failed/expired statuses added
- [ ] Logging of all webhook events configured
- [ ] Testing on testnet/sandbox completed
What Needs to Be Implemented on the Site Side
- Payment creation endpoint (POST /api/create-crypto-payment)
- Webhook handler with signature verification
- Waiting page with payment status polling (every 10-15 sec)
- Handling of expired payments (timeout 15-60 min depending on network)
- Logging of all webhook events for reconciliation
What Is Included in Our Work (Deliverables)
When ordering a turnkey integration, we provide:
- Processor selection with justification (audience analysis, geography, fees)
- Development of REST endpoints and webhook handler
- Setup of payment page with QR code and timer
- Logging of all statuses for reconciliation
- API documentation and admin instructions
- Post-launch support (bug fixes, modifications)
- Deliverables: documentation (including API integration guide), access credentials, training video, and 30-day support
Full integration from scratch to production takes 2-3 days, including testing on testnet/sandbox and edge cases. Get a consultation on webhook setup and signature verification. Contact us — we will assess your project and offer the optimal solution. Our guaranteed security practices and certified experience ensure your crypto payments for ecommerce run smoothly. Accept cryptocurrency on your website with confidence using our proven integration methodology.
For BTCPay Server setup, we provide step-by-step guidance for self-hosted environments.







