How LayerPay Works

A complete walkthrough of the payment flow, from checkout to settlement

The Payment Flow

What happens when a customer pays with crypto

1

Customer Reaches Checkout

When a customer completes their cart and proceeds to checkout, they see "Pay with Crypto (ETH/USDC)" as a payment option alongside traditional methods.

💡 LayerPay only appears if you've configured your merchant wallet address in the plugin settings.
2

Price Conversion

The order total (in EUR, USD, etc.) is converted to crypto in real-time using live market prices from CoinGecko and ExchangeRate APIs.

Order Total: €85.00
ETH Price: €3,520.00
─────────────────
Amount: 0.02415 ETH
+ 2% buffer: 0.02463 ETH

Price Buffer: A small buffer (default 2%) is added to account for price volatility between quote and payment. Any excess is refunded via the smart contract.

3

Customer Selects Options

The customer chooses:

  • Currency: ETH (native) or USDC (stablecoin)
  • Network: Ethereum, Base, Optimism, or Arbitrum
⚠️ The customer must have funds on the selected network. Layer 2 networks (Base, Optimism, Arbitrum) offer much lower fees.
4

Wallet Connection

Customer clicks "Connect Wallet" and chooses their preferred wallet:

  • MetaMask: Direct browser extension connection
  • WalletConnect: QR code for mobile wallets (Trust, Rainbow, etc.)

The wallet prompts the customer to switch to the correct network if needed.

5

Payment Execution

Customer clicks "Pay Now" and their wallet shows the transaction details:

Transaction Request
─────────────────
To: LayerPay Contract
Amount: 0.02463 ETH
Network Fee: ~$0.01
─────────────────
[Confirm] [Reject]

The payment goes to our smart contract, which:

  1. Deducts the 1% platform fee
  2. Forwards 99% to your merchant wallet
  3. Emits an event for verification
6

On-Chain Verification

Once the transaction is confirmed on the blockchain, LayerPay verifies:

  • ✓ Transaction status (success)
  • ✓ Correct contract address
  • ✓ Correct merchant address in event logs
  • ✓ Sufficient amount paid
Verification happens automatically. No manual intervention needed.
7

Order Completion

After verification, the order status changes to "Processing" (or your configured status). The customer sees a confirmation with the transaction hash.

✓ Payment Confirmed!

Transaction: 0x8f3a...7b2c
Network: Base
Amount: 0.02463 ETH

Your order #1234 is being processed.

Smart Contract Architecture

How the payment contract works

📝

Single Entry Point

All payments go through our verified smart contract. The contract address is the same on all supported networks for easy verification.

🔀

Automatic Splitting

The contract automatically splits the payment: 99% to your wallet, 1% platform fee. No manual claiming needed.

📊

Event Logging

Every payment emits blockchain events with payer, merchant, amount, and order reference. This enables trustless verification.

// Payment Event Structure
event ETHPayment(
    address indexed payer,
    address indexed merchant,
    uint256 amount,
    uint256 merchantAmount,
    bytes32 orderRef
);

Security Measures

How we keep payments secure

🔒

Non-Custodial

We never hold your funds. Payments go directly from customer wallet to your wallet via the smart contract. No withdrawal process, no delays.

🔍

On-Chain Verification

Every payment is verified by reading blockchain data directly. We check transaction receipt, event logs, and amounts before marking orders as paid.

🛡️

No Chargebacks

Blockchain transactions are final. Once confirmed, the payment cannot be reversed by the customer, eliminating chargeback fraud.

🔐

Audited Contract

Our payment smart contract is open source and has been reviewed for security vulnerabilities. Contract addresses are verified on block explorers.

Ready to Accept Crypto?

Download LayerPay and start accepting payments in minutes

Download Now Read Documentation