noncepay / module-payment
NoncePay crypto payments for Magento 2 and Adobe Commerce: USDT, USDC, BTC, ETH, SOL and more, forwarded to your own wallets
Package info
github.com/Nonce-pay/noncepay-magento
Type:magento2-module
pkg:composer/noncepay/module-payment
Requires
- php: ~8.1.0||~8.2.0||~8.3.0||~8.4.0
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- magento/framework: ^103.0.6
- magento/module-checkout: ^100.4.6
- magento/module-payment: ^100.4.6
- magento/module-quote: ^101.2.6
- magento/module-sales: ^103.0.6
- magento/module-store: ^101.1.6
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Accept crypto payments in your Magento store: USDT, USDC, Bitcoin, Ethereum, Solana and more, forwarded straight to your own wallets. NoncePay is non-custodial: there is no account, no API key, no monthly fee and no withdrawal step.
The module adds a Pay with crypto payment method to the checkout. After placing the order, the customer is sent to the NoncePay hosted payment page, picks a coin and pays. The order is invoiced and moves to Processing as soon as NoncePay confirms the payment with a signed callback.
Requirements
- Magento Open Source or Adobe Commerce 2.4.6 or later
- PHP 8.1 to 8.4 with the
curl,json,mbstringandopensslextensions (bcmathis used when present) - Your store reachable over the internet, so NoncePay can call
https://your-store/noncepay/payment/callback/ - Orders in a currency NoncePay prices: USD, EUR, GBP, CAD, AUD, CHF, JPY, BRL, INR and about thirty others
Install
With Composer (recommended)
composer require noncepay/module-payment bin/magento module:enable NoncePay_Payment bin/magento setup:upgrade bin/magento setup:di:compile # production mode only bin/magento setup:static-content:deploy # production mode only bin/magento cache:flush
Manually, in app/code
- Download
noncepay-magento.zipfrom the latest release and unzip it into the root of your Magento installation. It addsapp/code/NoncePay/Payment/. - Run the same
bin/magentocommands as above, frommodule:enableon.
setup:upgrade creates the noncepay_payment_link table.
Configure
In the admin, go to Stores > Configuration > Sales > Payment Methods > NoncePay (crypto), enter a receiving wallet for each family of coins you accept, set Enabled to Yes and save.
| Setting | Default | What it does |
|---|---|---|
| Enabled | No | Shows the method at checkout |
| Title | Pay with crypto | The method name at checkout, per store view |
| EVM wallet | empty | One 0x… address for Ethereum, BNB Smart Chain, Polygon, Base, Arbitrum, Optimism and Avalanche coins |
| Tron, Bitcoin, Litecoin, Bitcoin Cash, Dogecoin, Solana wallets | empty | One address per chain family; a family without a wallet is not offered |
| Coins offered | every coin of your wallets | Optional comma-separated tickers such as trc20/usdt,bep20/usdt,btc |
| Merchant name | the store name | Shown on the payment page, 64 characters max; empty uses General > Store Information > Store Name |
| Logo URL | none | An https image shown beside your name, on a dark background, at most 40 px tall |
| Underpayment tolerance (%) | 0 | 0 to 1. With 0.5, an order of 100 counts as paid from 99.50, which covers exchange withdrawal fees |
| API base URL | https://api.noncepay.app |
Change only to test against another NoncePay instance |
| Test mode | No | Allows an http API base URL (a local or testnet instance) |
| Debug log | No | Logs API calls and every callback to var/log/noncepay.log; problems are always logged |
Wallets, coins, the logo URL, the tolerance and the API base URL are checked when you save. Every wallet accepts the
split syntax 0.7@addressA|0.3@addressB. NoncePay checks the wallets strictly when the first link is created.
The method is hidden at checkout while no wallet is set or when the cart currency is one NoncePay does not price.
How it works
- The customer picks Pay with crypto and places the order. The order is created in Pending Payment, without the order confirmation email.
- The browser goes to
noncepay/payment/redirect, which creates a NoncePay payment link for the order grand total in the order currency, and redirects to its payment page. A reload reuses the same link. If the link cannot be created (NoncePay unreachable, a wallet refused), the order is cancelled, the cart is restored and the customer can pick another method. - The customer picks a coin and pays. Each payment is forwarded to your wallet as soon as it confirms, minus the NoncePay fee (1.25%, lower with volume) and the network cost.
- Once the confirmed payments cover the order, NoncePay sends a signed callback to
noncepay/payment/callback. The module verifies itsx-ca-signature(RSA-SHA256) against the NoncePay public key (fetched from/pubkey/and cached), checks the link and the amount against what it stored, then registers the capture: an invoice is created with the link id as transaction id, the order moves to Processing and the order email is sent. A repeated callback is recognised by that transaction id and captured once. - The payment page sends the customer to
noncepay/payment/return. It shows the checkout success page once the order is captured; until then, a page that says the payment is being confirmed and refreshes itself. The order is never marked paid from this redirect, only from the signed callback.
Per-deposit callbacks are answered *ok* and only logged. Every capture and every payment that needs a look is
written as a comment in the order history.
Amounts
- Underpayment within the tolerance: the order is invoiced in full; the order comment says how much was missing.
- Underpayment beyond the tolerance: the payment page asks the customer for the rest; nothing is captured until the link is paid.
- Overpayment: the order is invoiced in full and the comment records the surplus, which is in your wallet.
- Fees: the NoncePay fee is deducted from the crypto forwarded to your wallet, not charged separately.
FAQ
How long can the customer take to pay? Magento cancels orders still in Pending Payment after the Pending Payment Order Lifetime (Stores > Configuration > Sales > Sales > Orders Cron Settings, 480 minutes by default). The payment link expires one hour before that, leaving time for the payment to confirm, and is never shorter than two hours nor longer than seven days. Keep the lifetime at two hours or more.
A customer paid after the order was cancelled. The funds are in your wallet. The callback adds a comment to the cancelled order with the link and transaction ids, so you can refund from your wallet or create a new order.
The callback is rejected with "Bad signature". Check that nothing in front of Magento (a WAF, a proxy) rewrites
the request body or strips the x-ca-signature header, and that the server can reach api.noncepay.app.
Can I take crypto orders from the admin? No: the customer has to pay on the NoncePay page, so the method is only offered at the storefront checkout.
Does it work with several stores or websites? Yes. Wallets and settings can differ per website, the title and merchant name per store view.
Refunds? NoncePay never holds funds, so there is nothing to refund from: send a refund from your wallet and create an offline credit memo.
Development
docker run --rm -v "$PWD":/app -w /app/dev composer:2 composer install --ignore-platform-req='ext-*' docker run --rm -v "$PWD":/app -w /app php:8.2-cli dev/vendor/bin/phpunit docker run --rm -v "$PWD":/app -w /app php:8.2-cli dev/vendor/bin/phpcs \ --standard=dev/vendor/magento/magento-coding-standard/Magento2 --ignore='*/dev/*' . ./bin/build.sh # dist/noncepay-magento.zip
The link, signature and callback logic lives in Core/, which does not depend on Magento; the tests run it against
in-memory fakes of the store and the NoncePay API, with a test RSA key in Test/Unit/_files/.
Links
- NoncePay and its documentation
- Magento guide, payment links and callbacks
License
MIT, see LICENSE.