CPay for OpenCart 4
Add crypto to your OpenCart checkout in minutes. Customers pay in USDT or USDC from MetaMask or Trust Wallet, the money goes straight to your wallet, and every payment is AML-checked. No KYC, no KYB, no monthly plan. The extension is built on the CPay PHP SDK, which is bundled inside.
- OpenCart
- 4.0.2.x or newer
- PHP
- 8.0+ with
gmp,bcmath,curl - Package
cpay.ocmod.zip- Currencies
- USDT, USDC
- Languages
- English, Russian
- License
- MIT, open source
What you get
- Native payment method. "CPay (Crypto USDT/USDC)" appears at checkout next to your other methods, with geo zone, minimum total and sort order.
- Any store currency. The order total is converted to USD automatically — by a daily public rate with your markup, or by a fixed rate.
- Invoices signed locally. The shop key never leaves your server; it can live in
config.phpinstead of the database. - Automatic order statuses. "Waiting" while the invoice is open, then separate "paid" statuses for digital and physical orders.
- Receipts everywhere. A receipt button in the admin order and in the customer's order history, plus a link in the order comment and email.
- Safe confirmation. The webhook and the success page both verify a cryptographic proof — whichever comes first wins.
- Partner commission. Optionally share a percentage of each payment with a partner wallet.
OpenCart 3.x and 2.x
This build is for OpenCart 4 only. Older versions use a different architecture and need a separate build.
Installation
Upload the extension
Go to Extensions → Installer → Upload, choose
cpay.ocmod.zipand press the green Install button next to it.Install the payment method
Open Extensions → Extensions, choose the type Payments, find CPay (Crypto USDT/USDC) and press Install (+). This creates the order table, default settings and the receipt buttons.
Open the settings
Press Edit (the pencil) to configure the extension as described below.
Configuration
Create a shop with a dedicated account
Make a new MetaMask account just for the shop and create your shop with it. Do not use the wallet that receives your money.
Enter the shop key
Paste the private key of the shop account. The shop address is derived and shown automatically. Safer: add
define('CPAY_PRIVATE_KEY', '...');toconfig.phpandadmin/config.php— the field is then ignored.Set the payout wallet
Enter the wallet that receives USDT/USDC. It must differ from the shop account; the extension checks this on save.
Connect the webhook
Copy the Webhook URL and Success page URL from the top of the settings page into your shop settings on dappcrypto.github.io.
Choose rates and statuses
Pick automatic or fixed rate, the invoice lifetime and order statuses. Enable the extension and save.
Run a test order
Place a small order and pay it to see the whole flow, including the receipt.
Key settings
| Setting | What it does | Default |
|---|---|---|
| Default network | Network preselected on the payment page: 1 Ethereum, 56 BNB Smart Chain. The customer can switch. | 1 |
| Exchange rate mode | Automatic (public rate + markup) or Fixed (your own rate). | Automatic |
| Markup / fee, % | Added to the converted amount to cover volatility and network fees. | 0 |
| Invoice lifetime | How long the invoice can be paid, in minutes. | 1440 (24 h) |
| Order ID offset | Added to the OpenCart order ID. Use different offsets if several stores share one shop. | 0 |
| Status after payment | Separate statuses for digital and for physical/other orders. | Complete / Processing |
| Partner wallet and commission | 100 = 1% of each payment goes to the partner wallet. | off |
| Debug log | Writes events to cpay.log in the OpenCart log folder. | off |
How a payment works
The customer chooses CPay
On the confirm step they press Pay with crypto.
An invoice is created
The total is converted to USD, the invoice is signed locally, the order gets the "waiting" status and the customer goes to the secure payment page.
The customer pays on-chain
From MetaMask or Trust Wallet, on the network they choose.
The order is marked as paid
The webhook or the success page verifies the proof, the order gets your "paid" status, the customer is notified and the receipt link is saved.
Troubleshooting
| Problem | What to check |
|---|---|
| Method not shown at checkout | Is it enabled? Are the key and payout wallet set? Are gmp, bcmath, curl installed? Is a rate available? Check minimum total and geo zone. |
| Order not marked as paid | The webhook URL in your dappcrypto shop must match the settings page exactly. Turn on the debug log. |
| No exchange rate | Allow outgoing HTTPS to open.er-api.com, or switch to a fixed rate. |
Full settings reference, endpoints and uninstall notes are in the README on GitHub.
Supported networks
- Ethereum gas in ETH
- BNB Smart Chain gas in BNB
- Arbitrum gas in ETH
- Base gas in ETH
- Polygon gas in POL
FAQ
Do I need cron for exchange rates?
No. Rates are refreshed automatically at checkout or when you open the settings page, and are cached for 24 hours.
What does it cost?
The extension is free. 99% of each payment goes to you and 1% is the DAppCrypto service fee; connecting a shop costs a one-time network fee.
Can several stores use one shop?
Yes. Give each store a different Order ID offset so order numbers never collide.
What happens on uninstall?
Uninstalling the payment method removes its table, settings (including the key) and cached rates. Order history comments stay with your orders.
Start with a shopThe extension signs invoices for a CPay shop. Create one with a dedicated MetaMask account, then paste its key into the extension settings.
Create your shop