langchain-paypack: x402 (Coinbase) + AP2 (Google) dual-protocol Agent payments — the world's ONLY middleware supporting Alipay AND WeChat dual-channel. PayPack is neutral, independent, not bound to any tech giant ecosystem. One agent.pay() for USDC/ETH (Base/Ethereum/Polygon/Arbitrum) + Alipay/WeChat CNY. Dify Tool Plugin available.
Project description
langchain-paypack: x402 + AP2 dual-protocol for LangChain Agents
🌐 Dual-channel · Neutral · Independent
PayPack is the world's only Agent payment middleware supporting Alipay AND WeChat Pay dual-channel. PayPack stays neutral — not bound to Alipay, not bound to Tencent, not bound to any tech giant ecosystem.
全球唯一同时支持支付宝 + 微信双通道的 Agent 支付中间件。坚持中立,不绑定任何大厂生态。
x402 (Coinbase) + AP2 (Google) 双协议支付。一行代码给 LangChain Agent 加上 USDC/ETH + 支付宝/微信支付能力。Dify Tool Plugin 可用。
安装
pip install paypack-langchain
快速开始
from paypack_langchain import PayPackTool
# 用你的 API Key 初始化
tool = PayPackTool(
api_key="ppk_你的API_KEY",
base_url="https://你的域名.com", # PayPack Cloud 服务地址
)
# 在 Agent 里直接使用
result = tool.run(amount=0.01, subject="AI 数据查询")
print(result)
# 输出:
# 支付订单已创建
# 订单号: PP20260710120000ABC12345
# 金额: ¥0.01
# 状态: pending
# 支付链接: https://openapi.alipay.com/...
# 二维码: https://...
在 LangChain Agent 中使用
from langchain.agents import create_react_agent, AgentExecutor
from langchain_openai import ChatOpenAI
from paypack_langchain import PayPackTool, PayPackQueryTool
llm = ChatOpenAI(model="deepseek-v4-flash")
tools = [
PayPackTool(api_key="ppk_xxx", base_url="https://你的域名.com"),
PayPackQueryTool(api_key="ppk_xxx", base_url="https://你的域名.com"),
]
agent = create_react_agent(llm, tools, ...)
agent_executor = AgentExecutor(agent=agent, tools=tools)
# Agent 现在可以自动发起支付和查询订单了
获取 API Key
curl -X POST https://你的域名.com/v1/register \
-H "Content-Type: application/json" \
-d '{"name": "my_agent"}'
# 返回: {"api_key": "ppk_xxx..."}
发布
cd plugins/langchain
pip install build
python -m build
pip install twine
python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paypack_langchain-0.1.2.tar.gz.
File metadata
- Download URL: paypack_langchain-0.1.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a24192d53949a5b196c7f678b866be5ba88056afed07d34cb802ea8579b750d7
|
|
| MD5 |
b29bf1a9db942ccafde62af0d6b2a1fa
|
|
| BLAKE2b-256 |
3c6d6ff107cbaf69f11be822db5f956b7aa52a4784a3ab9e4208f4392e70170f
|
File details
Details for the file paypack_langchain-0.1.2-py3-none-any.whl.
File metadata
- Download URL: paypack_langchain-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6be6a1468ae0f54439fd77e513d36e762362559aad7bff2ccfe2671dd3ad2b73
|
|
| MD5 |
56337094aa5bf41ec9e051bc114aedc9
|
|
| BLAKE2b-256 |
d21d520086d9647235e46e78c55938451827b7264c8306e050b473728d8af609
|