Crypto Payment Acceptance on Website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    848
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Cryptocurrency Payment Integration on Website

Accepting crypto payments without intermediaries is direct blockchain work: address generation, transaction monitoring, block confirmation. With intermediaries (NOWPayments, CoinGate, BitPay) — API similar to classic payment gateway, but with volatility and irreversibility features. Both approaches make sense in different situations.

Implementation via intermediary takes 2–3 working days. Self-hosted for one network — 5–8 days.

Via Payment Gateway (Recommended)

NOWPayments, CoinGate, BitPay take 0.5–1% commission and solve for you: conversion, network monitoring, confirmations, exchange rate risks (if immediate conversion enabled). Integration similar to Stripe.

Direct USDT/USDC Reception (TRC-20, ERC-20)

Without intermediaries, but with exchange rate risk only for stablecoins. For each order unique address generated:

use kornrunner\Ethereum\Ethereum;

class WalletService
{
    private string $masterPrivateKey;

    public function generateDepositAddress(int $orderId): string
    {
        // HD Wallet: master key + path m/44'/195'/0'/0/{orderId}
        $derivedKey = $this->deriveKey($this->masterPrivateKey, $orderId);
        $eth        = new Ethereum();
        return $eth->getAddress($derivedKey->getPublicKey());
    }
}

For TRC-20 (Tron) different derivation used, but concept same — HD Wallet with deterministic addresses. Knowing master key and index, always can recover address and check balance.

Monitoring Fund Arrival

Blockchain events don't come in webhook — need to query network. For Ethereum/ERC-20:

import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider(process.env.ETH_RPC_URL); // Alchemy, Infura

// Subscribe to Transfer events of ERC-20 contract
const usdcContract = new ethers.Contract(USDC_ADDRESS, ERC20_ABI, provider);

usdcContract.on('Transfer', async (from, to, amount, event) => {
    const pendingOrder = await Order.findByDepositAddress(to);
    if (!pendingOrder) return;

    const decimals     = 6; // USDC
    const receivedUSDC = Number(ethers.formatUnits(amount, decimals));

    if (receivedUSDC >= pendingOrder.amount_usd * 0.99) { // 1% tolerance for fees
        await confirmOrderPayment(pendingOrder, event.transactionHash, event.blockNumber);
    }
});

Wait minimum 6 confirmations (blocks) for Ethereum, 20+ for Bitcoin, 19+ for Tron before final order confirmation.

Waiting for Confirmations

async function waitForConfirmations(
    txHash: string,
    requiredConfirmations: number = 6
): Promise<boolean> {
    const tx = await provider.getTransaction(txHash);
    if (!tx) return false;

    const receipt = await provider.waitForTransaction(txHash, requiredConfirmations);
    return receipt !== null && receipt.status === 1;
}

Storing Payment Information

CREATE TABLE crypto_payments (
    id               bigserial PRIMARY KEY,
    order_id         bigint        NOT NULL REFERENCES orders(id),
    network          varchar(20)   NOT NULL, -- 'eth', 'tron', 'btc'
    token            varchar(20)   NOT NULL, -- 'USDT', 'USDC', 'BTC'
    deposit_address  varchar(100)  NOT NULL UNIQUE,
    expected_amount  numeric(18,8) NOT NULL,
    received_amount  numeric(18,8),
    tx_hash          varchar(100),
    confirmations    int           DEFAULT 0,
    status           varchar(20)   NOT NULL DEFAULT 'awaiting',
    expires_at       timestamptz   NOT NULL, -- usually 30–60 minutes
    created_at       timestamptz   NOT NULL DEFAULT now()
);

Payment time limit (expires_at) mandatory. Exchange rate fixed at order creation time. If client doesn't pay in 30 minutes — order cancelled, address can be reused (though better not to).

Exchange Rate and Conversion

At order creation exchange rate fixed from external source (CoinGecko, Binance API). Crypto amount calculated from fiat amount:

$btcRate  = $this->priceService->getRate('BTC', 'USD'); // e.g., 65000
$btcAmount = round($order->total_usd / $btcRate, 8);
// Display to customer: pay 0.00023076 BTC

1–2% tolerance for network fees and time gap — standard practice.

Refunds

Refunding crypto payment — manual process. Automation impossible without storing private keys in hot wallet, creating security risks. Standard practice: manager manually sends transaction to customer wallet. Wallet address need to request from customer when initiating refund.

Security

Private keys stored in HSM or HashiCorp Vault, not in DB or .env. Deposit addresses — derivatives of master key, not standalone keys. Access to master key — only from server monitoring process, not from web application.