Most crypto checkouts put someone in the middle. It might be a processor that holds the payment, an app that takes a cut, or a script that asks the shop to connect a wallet. Wen Counter Pay does without all three. It is a WooCommerce gateway that only receives. The buyer pays from their own wallet straight to the shop's address, and the shop's server reads the chain to decide whether the order is paid. It is free, Apache-2.0 and backed by 54 open checks. Next to it sits an agent skill that lets an AI coding assistant audit a shop and install the gateway without ever touching a key.
This post walks through the design. Full page, downloads and translations: https://wen-watt.github.io/lab/shop-integration.html
The flow in five steps
- The buyer places an order and picks Pay with Solana Pay, in the classic checkout or in the Checkout block.
- The order gets a fresh 32-byte reference key and a Solana Pay link. The link carries the shop address, the amount in USDC (or SOL, WEN, JUP, USDT, or any SPL mint) and the memo
order:<number>. - The buyer scans the QR code or taps Open in wallet and pays from their own wallet.
- The shop server looks up the reference on-chain, fetches the transaction and runs the five-point check: reference, recipient, token, amount, success. Only then is the order marked paid.
- If the buyer closed the tab, a WP-cron job checks pending orders every five minutes for 24 hours.
Three read methods, and nothing else
The RPC client has an allow-list. Any method outside it throws before a request is built:
const READ_ONLY = array( 'getSignaturesForAddress', 'getTransaction', 'getAccountInfo' );
public function call( $method, $params ) {
if ( ! in_array( $method, self::READ_ONLY, true ) ) {
throw new RuntimeException( 'Blocked: Wen Counter Pay only reads the chain' );
}
// wp_remote_post to the public devnet or mainnet endpoint, or a custom https URL
}
There is no sendTransaction and no signing library. Nowhere in the plugin can a private key be pasted. The settings take a public address, and they validate it as one.
The five-point check
This is a PHP port of the same verify_payment that runs in the browser till, Wen Counter. Amounts are compared as strings in base units, so a float never decides whether an order is paid:
if ( ! empty( $meta['err'] ) ) $reasons[] = 'Transaction failed on-chain';
if ( ! in_array( $reference, $keys, true ) ) $reasons[] = 'Reference key is not in the transaction';
// SPL: received = post − pre token balance of (recipient, mint); SOL: lamport delta of recipient
if ( $neg || self::cmp( $received, $expected ) < 0 )
$reasons[] = "Received {$received} base units, expected {$expected}";
return array( 'ok' => 0 === count( $reasons ), 'received' => $received, ... );
Paying to the wrong address gives zero received. Paying with the wrong mint also gives zero received. Paying short fails the amount check. A transaction that reverted fails the success check. A transaction for a different order doesn't contain this order's reference.
One transaction pays one order
A valid transaction could otherwise be replayed against a second order with the same amount. Before payment_complete, the gateway checks whether any order already holds that signature:
$dupes = wc_get_orders( array( 'limit' => 1, 'return' => 'ids',
'meta_key' => '_wcp_signature', 'meta_value' => $sig ) );
if ( ! empty( $dupes ) && (int) $dupes[0] !== (int) $order->get_id() ) {
$order->add_order_note( 'Solana Pay: transaction ' . $sig . ' already paid another order.' );
return 'mismatch';
}
The order page
The thank-you page draws the QR code locally as SVG; there is no CDN and no third-party script. It shows the first and last five characters of the receiving address so the buyer can compare them in their wallet. It polls a REST route, wen-counter/v1/check, that answers only to the order id plus the order key (compared with hash_equals) and is rate-limited to one chain lookup per order every three seconds. The browser accepts a "paid" link only if it starts with https://explorer.solana.com/tx/, and it writes every server string with textContent.
Other details:
- The plugin declares HPOS compatibility.
- It registers a Checkout-block payment method in plain JS, with no build step.
- Mainnet stays locked until the owner ticks a separate "I tested on devnet" box.
Same answers as the JavaScript core
The plugin is a port, so parity is the first thing to prove. A small Node script generates fixtures from the original counter-core.js: base58, reference keys, amounts in base units, Solana Pay URLs, memos, and pass/fail verdicts on sample transactions. The PHP core has to give the same answer to every one.
| Group | Checks | What it proves |
|---|---|---|
| Core parity | 12 | PHP core = JavaScript core on generated fixtures |
| Gateway flow | 22 | bad settings rejected; paid, short, wrong token, failed and foreign transactions; one transaction per order; status route; background check |
| Code safety | 14 | no keys, no signing, read-only RPC, local scripts only, escaped output, attribution kept |
| Browser | 6 | QR drawn, status polled, foreign link ignored, no script errors |
node integrations/woocommerce/wen-counter-pay/tests/make-fixtures.js
php integrations/woocommerce/wen-counter-pay/tests/test-core.php
php integrations/woocommerce/wen-counter-pay/tests/test-gateway.php
php integrations/woocommerce/wen-counter-pay/tests/test-safety.php
The skill: an AI assistant that installs it safely
A skill is a SKILL.md file that assistants such as Claude Code, Codex, Cursor, Copilot or Gemini CLI load when a task matches. One command installs it:
npx skills add wen-watt/wen-watt.github.io
Ours has seven rules and eight steps:
- audit the shop first;
- pick the right path: the plugin for WooCommerce, a payment link or QR for Shopify, Wix and Squarespace, or the hosted till;
- take only the public receiving address;
- test on devnet;
- verify the build;
- report back.
It also lists what the assistant must never do: ask for a seed phrase, connect a wallet, or switch to mainnet without the owner. Its references are the parts the assistant reads when it needs them: a 12-row audit checklist, a security review, a verification script and every source behind it.
Honest limits
- The buyer still needs a funded Solana wallet. No code removes that.
- There is one receiving address per shop.
- A refund is a new payment from the owner's wallet. There are no chargebacks.
- On Shopify, Wix and Squarespace, orders are not yet marked paid automatically.
- This is example code and has not been audited. Start on devnet. The shop owner is responsible for receipts and taxes.
Why WooCommerce first
In May 2026, HTTP Archive data put WooCommerce on 6.64% of measurable websites and Shopify on 4.76%. Wix and Squarespace were around 1% each. The most-installed open platform came first. The skill already covers the rest with links and the hosted till.
Built on Wen Counter (WCP-1), Wen Open Lab, on Solana, Solana Pay, SPL Token and Token-2022, WNS and WEN. Free forever: no fee, no subscription, nobody in the middle.
Italiano
Un gateway Solana Pay per WooCommerce in sola ricezione, e una skill che lo installa
La maggior parte dei checkout crypto mette qualcuno nel mezzo: un processore che trattiene il pagamento, un'app che prende una percentuale o uno script che chiede al negozio di collegare un portafoglio. Wen Counter Pay non fa nessuna di queste cose. È un gateway WooCommerce che riceve soltanto. L'acquirente paga dal proprio portafoglio direttamente all'indirizzo del negozio, e il server del negozio legge la catena per decidere se l'ordine è pagato. È gratuito, Apache-2.0, con 54 verifiche aperte. Accanto c'è una skill che permette a un assistente AI di controllare un negozio e installare il gateway senza mai toccare una chiave.
Il flusso.
- L'acquirente sceglie Pay with Solana Pay, nel checkout classico o nel blocco Checkout.
- L'ordine riceve una nuova chiave di riferimento da 32 byte e un link Solana Pay con indirizzo, importo (USDC, SOL, WEN, JUP, USDT o qualsiasi mint SPL) e memo
order:<numero>. - L'acquirente paga dal proprio portafoglio.
- Il server esegue la verifica in cinque punti: riferimento, destinatario, token, importo, esito.
- Se la scheda viene chiusa, un controllo in background ogni cinque minuti completa il lavoro per 24 ore.
Tre metodi di lettura e nient'altro. Il client RPC ha una lista consentita: getSignaturesForAddress, getTransaction, getAccountInfo. Qualsiasi altro metodo genera un errore prima che la richiesta parta. Non c'è sendTransaction, non c'è una libreria di firma e non c'è un campo per una chiave privata.
La verifica. È un port PHP della stessa verify_payment della cassa nel browser. Gli importi si confrontano come stringhe in unità base, mai in virgola mobile.
- Un indirizzo sbagliato o un mint sbagliato danno zero ricevuto.
- Un importo insufficiente non supera il controllo dell'importo.
- Una transazione fallita non supera il controllo dell'esito.
- Una transazione per un altro ordine non contiene questo riferimento.
Una transazione paga un solo ordine. Prima di payment_complete il gateway cerca la firma tra gli ordini già pagati e rifiuta il riutilizzo.
La pagina dell'ordine.
- Il QR viene disegnato in locale, senza CDN.
- Mostra i primi e gli ultimi cinque caratteri dell'indirizzo, da confrontare nel portafoglio.
- La rotta REST risponde solo con id ordine e chiave d'ordine (
hash_equals), al massimo una lettura ogni tre secondi. - Il browser accetta solo link
https://explorer.solana.com/tx/. - La mainnet resta bloccata finché il proprietario non spunta «ho testato su devnet».
Verifiche: parità del nucleo con il JavaScript 12, flusso del gateway 22, sicurezza del codice 14, browser 6. I comandi sono nel blocco inglese qui sopra.
La skill. npx skills add wen-watt/wen-watt.github.io la installa per molti assistenti. Ha sette regole e otto passi:
- prima controllare il negozio;
- scegliere il percorso;
- usare solo l'indirizzo pubblico;
- provare su devnet;
- verificare e riferire.
Non deve mai chiedere una frase seed, collegare un portafoglio o passare alla mainnet senza il proprietario.
Limiti onesti.
- Serve un portafoglio Solana con fondi.
- C'è un solo indirizzo per negozio.
- I rimborsi sono nuovi pagamenti, senza chargeback.
- Su Shopify, Wix e Squarespace gli ordini non vengono ancora segnati come pagati in automatico.
- È codice di esempio, non sottoposto ad audit. Prima la devnet.
Perché WooCommerce per primo: a maggio 2026 era sul 6,64% dei siti misurabili (Shopify 4,76%). Gratis per sempre. La pagina completa è disponibile anche in italiano (link in alto).
中文
一个只收款的 WooCommerce Solana Pay 网关,以及一个负责安装它的技能
大多数加密货币结账都在中间放了一个角色:替你暂管货款的处理方、抽成的应用,或者要求商店连接钱包的脚本。Wen Counter Pay 三样都不需要。它是一个只收款的 WooCommerce 网关:买家从自己的钱包直接付到商店地址,商店服务器读取链上数据来判断订单是否已付款。免费,Apache-2.0,54 项公开检查。它旁边还有一个技能,让 AI 编程助手审查商店并安装网关,全程不碰任何密钥。
流程。
- 买家在经典结账或结账区块中选择 Pay with Solana Pay。
- 订单得到一个新的 32 字节参考密钥,以及一个 Solana Pay 链接:地址、金额(USDC、SOL、WEN、JUP、USDT 或任意 SPL 铸币)、备注
order:<编号>。 - 买家用自己的钱包付款。
- 服务器执行五点核验:参考号、收款方、代币、金额、成功。
- 页面关掉了?后台每五分钟检查一次,持续 24 小时。
只有三种读取方法。 RPC 客户端有一份允许列表:getSignaturesForAddress、getTransaction、getAccountInfo。其他任何方法在请求发出前就会报错。没有 sendTransaction,没有签名库,也没有填写私钥的地方。
核验。 这是浏览器收银台中同一个 verify_payment 的 PHP 移植版。金额以最小单位的字符串比较,从不使用浮点数。
- 付错地址或付错铸币,收到的金额为零。
- 付款不足,过不了金额检查。
- 失败的交易,过不了成功检查。
- 别的订单的交易里没有本订单的参考号。
一笔交易只付一笔订单。 在 payment_complete 之前,网关会在已付订单中查找该签名,拒绝重复使用。
订单页。
- 二维码在本地绘制,不用 CDN。
- 显示收款地址的前五位和后五位,方便在钱包里核对。
- REST 接口只接受订单号加订单密钥(
hash_equals),每三秒最多一次链上查询。 - 浏览器只接受
https://explorer.solana.com/tx/链接。 - 店主勾选“已在 devnet 测试”之前,主网保持锁定。
检查: 与 JavaScript 核心一致性 12 项,网关流程 22 项,代码安全 14 项,浏览器 6 项。命令见上方英文部分。
技能。 npx skills add wen-watt/wen-watt.github.io 可为多种助手安装。它有七条规则、八个步骤:
- 先审查商店;
- 选择路径;
- 只用公开地址;
- 在 devnet 测试;
- 核验并汇报。
它绝不能索要助记词、连接钱包,或在店主不同意时切换到主网。
诚实的局限。
- 买家需要有余额的 Solana 钱包。
- 每家商店一个收款地址。
- 退款是新的付款,没有拒付。
- Shopify、Wix、Squarespace 的订单暂不能自动标记为已付款。
- 示例代码,未经审计。先用 devnet。
为什么先做 WooCommerce:2026 年 5 月它覆盖 6.64% 的可测量网站(Shopify 为 4.76%)。永远免费。完整页面也有中文版(链接见上文)。
한국어
수신 전용 WooCommerce Solana Pay 게이트웨이와, 그것을 설치하는 스킬
대부분의 암호화폐 결제는 중간에 누군가를 둡니다. 대금을 보관하는 처리업체, 수수료를 떼는 앱, 상점에 지갑 연결을 요구하는 스크립트. Wen Counter Pay에는 그 셋이 모두 없습니다. 수신만 하는 WooCommerce 게이트웨이입니다. 구매자는 자기 지갑에서 상점 주소로 바로 결제하고, 상점 서버가 체인을 읽어 주문이 결제됐는지 판단합니다. 무료, Apache-2.0, 공개 검사 54개. 그 옆에는 AI 코딩 어시스턴트가 상점을 점검하고 키를 한 번도 건드리지 않고 게이트웨이를 설치하게 해 주는 스킬이 있습니다.
흐름.
- 구매자가 클래식 결제나 Checkout 블록에서 Pay with Solana Pay를 고릅니다.
- 주문은 새 32바이트 참조 키와 Solana Pay 링크를 받습니다. 링크에는 주소, 금액(USDC, SOL, WEN, JUP, USDT 또는 어떤 SPL 민트든), 메모
order:<번호>가 들어 있습니다. - 구매자는 자기 지갑으로 결제합니다.
- 서버가 다섯 항목 검증을 합니다: 참조, 수신자, 토큰, 금액, 성공.
- 탭을 닫았다면 5분마다 도는 백그라운드 확인이 24시간 동안 마무리합니다.
읽기 메서드 세 개, 그 밖엔 없음. RPC 클라이언트에는 허용 목록이 있습니다: getSignaturesForAddress, getTransaction, getAccountInfo. 다른 메서드는 요청이 만들어지기 전에 오류가 납니다. sendTransaction도, 서명 라이브러리도, 개인 키를 넣을 칸도 없습니다.
검증. 브라우저 계산대의 verify_payment를 그대로 PHP로 옮겼습니다. 금액은 기본 단위 문자열로 비교하고 부동소수점은 쓰지 않습니다.
- 잘못된 주소나 잘못된 민트로 보내면 받은 금액은 0입니다.
- 금액이 모자라면 금액 검사에서 걸립니다.
- 실패한 트랜잭션은 성공 검사에서 걸립니다.
- 다른 주문의 트랜잭션에는 이 주문의 참조가 없습니다.
트랜잭션 하나는 주문 하나만 결제. payment_complete 전에 게이트웨이가 이미 결제된 주문에서 서명을 찾아 재사용을 거부합니다.
주문 페이지.
- QR은 로컬에서 그리며 CDN을 쓰지 않습니다.
- 수신 주소의 앞뒤 다섯 글자를 보여 줘서 지갑에서 대조할 수 있습니다.
- REST 경로는 주문 번호와 주문 키(
hash_equals)로만 응답하고, 3초에 한 번까지만 체인을 조회합니다. - 브라우저는
https://explorer.solana.com/tx/링크만 받아들입니다. - 소유자가 "devnet에서 시험함"에 체크하기 전까지 메인넷은 잠겨 있습니다.
검사: JavaScript 핵심과의 동등성 12, 게이트웨이 흐름 22, 코드 안전 14, 브라우저 6. 명령은 위 영어 부분에 있습니다.
스킬. npx skills add wen-watt/wen-watt.github.io 하나로 여러 어시스턴트에 설치됩니다. 규칙 일곱 개와 단계 여덟 개가 있습니다.
- 먼저 상점 점검;
- 경로 선택;
- 공개 주소만 사용;
- devnet에서 시험;
- 확인하고 보고.
시드 문구를 묻거나, 지갑을 연결하거나, 소유자 없이 메인넷으로 바꾸는 일은 절대 하지 않습니다.
정직한 한계.
- 자금이 든 Solana 지갑이 필요합니다.
- 상점당 수신 주소는 하나입니다.
- 환불은 새 결제이며 지불 거절은 없습니다.
- Shopify, Wix, Squarespace 주문은 아직 자동으로 결제 완료 처리되지 않습니다.
- 감사받지 않은 예제 코드입니다. devnet 먼저.
왜 WooCommerce가 먼저인가: 2026년 5월 측정 가능한 웹사이트의 6.64%에서 쓰였습니다(Shopify 4.76%). 영원히 무료. 전체 페이지는 한국어로도 있습니다(위 링크).




Top comments (0)