PayPack routes one payment call onto three different rails: Alipay (CNY), WeChat Pay (CNY), and x402 / AP2 on-chain payments (USDC or ETH). This page documents each rail, what it is good for, and its current verification status.
| Rail | Currency | Settlement | Best for | Verification |
|---|---|---|---|---|
| Alipay | CNY | Fiat, T+1 style merchant settlement | Users who pay with the Alipay app | Sandbox OK · Production verified |
| WeChat Pay | CNY | Fiat, merchant settlement | Users inside WeChat and mini programs | Backend OK · Production verified |
| x402 / AP2 | USDC, ETH | On-chain | Machine-to-machine API payments | Testnet and mainnet verified |
The agent creates a payment intent; PayPack calls the Alipay gateway with your app id and RSA2-signed request, and returns either a cashier URL (PC web) or the parameters a mobile frontend needs. The user completes the payment in the Alipay app.
| Property | Value |
|---|---|
| Signer class | paypack.signer.alipay.AlipaySigner |
| Sandbox switch | sandbox=True (set False for production) |
| Web checkout | signer.page_pay(out_trade_no, total_amount, subject, body) |
| Direct send | pay.send(to, amount, currency="CNY", subject) |
| Credentials needed | app id, app private key, Alipay public key |
WeChat Pay uses a separate commercial module, paypack_wechat, which requires a license key. The open-source package ships a template (paypack_wechat_run.example.py) so you can see the exact shape of the integration.
| Property | Value |
|---|---|
| Signer class | paypack_wechat.WechatSigner |
| Credentials needed | merchant id, certificate serial, API v3 key, private key, app id, notify URL |
| Frontend hand-off | result["prepay_params"] → wx.requestPayment() |
| Callback | Server-side notify endpoint; PayPack verifies and reconciles |
paypack_wechat is a commercial module. The license key is required by design, not by accident — it gates production WeChat Pay support.For machine-to-machine payments, the merchant API answers HTTP 402 with a payment requirement. The agent parses it, pays, and retries the request with proof of payment — no human in the loop.
from paypack import AgentPay
import requests
pay = AgentPay(wallet_config={"private_key": "0x..."}, network="base-sepolia", spend_limit_daily=10.0)
response = requests.get("https://api.example.com/premium")
if response.status_code == 402:
content = pay.auto_handle_402(response)
| Network | Chain ID | Currencies |
|---|---|---|
| Base Sepolia (testnet) | 84532 | ETH, USDC |
| Base Mainnet | 8453 | ETH, USDC |
| Ethereum Mainnet | 1 | ETH, USDC |
| Polygon Mainnet | 137 | POL, USDC |
| Arbitrum Mainnet | 42161 | ETH, USDC |
PayPack is a developer tool for payment integration. It does not provide investment services, does not promise returns, and does not hold user funds.
Operated by Xiamen Shizhun Technology Co., Ltd. (Unified Social Credit Code: 91350211MA34XHGG5T) · Website: rhcjw.com · ICP filing: 闽ICP备2024041817号-2