电子钱包
Quick Reference
What电子钱包支付
Why让客户用偏好的数字钱包付款——一次重定向,卡数据不经过您的服务器
Reading Time10 分钟
Difficulty初级
Prerequisites身份验证 → 环境配置
为何使用数字钱包
| 优势 | 说明 |
|---|---|
| 更高转化 | 已保存凭证——字段更少 |
| 服务器不存卡数据 | 重定向流程确保您的服务器不接触敏感数据 |
| 多币种 | BRL、CLP、MXN 等(视钱包而定) |
| 内置反欺诈 | 钱包提供方处理买家认证 |
| 状态通知 | 最终结果通过 Webhook(网络钩子)异步送达 |
支持的钱包
| 钱包 | 币种 | 流程 |
|---|---|---|
| PayPal | BRL、CLP、MXN、USD | 重定向 |
| MercadoPago | BRL、ARS、CLP、MXN | 重定向 |
可用性
钱包可用性取决于商户配置与国家/地区。上线前请与客户经理确认。
结账流程
创建电子钱包收费
- cURL
- Python
- JavaScript
curl -X POST https://core-manager.a55.tech/api/v1/bank/wallet/charge/ \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wallet_uuid": "00000000-0000-0000-0000-000000000000",
"merchant_id": "11111111-1111-1111-1111-111111111111",
"payer_name": "赵丽",
"payer_email": "zhaoli@example.com",
"payer_tax_id": "12345678901",
"payer_cell_phone": "+5511988887777",
"installment_value": 2000,
"installment_count": 1,
"items": [{"name":"高级套餐","quantity":1,"total_amount":2000,"unit_amount":2000,"sku":"PLAN-001","code":"PP001"}],
"payer_address": {"street":"Av. Apoquindo","address_number":"4500","complement":"","neighborhood":"Las Condes","city":"Santiago","state":"RM","postal_code":"7550000","country":"CL"},
"currency": "CLP",
"due_date": "2026-12-31T23:59:59Z",
"description": "高级订阅",
"type_charge": "e_wallet",
"reference_external_id": "order-789",
"webhook_url": "https://yoursite.com/webhook",
"redirect_url": "https://yoursite.com/success"
}'
import requests
charge = requests.post(
"https://core-manager.a55.tech/api/v1/bank/wallet/charge/",
headers={"Authorization": f"Bearer {access_token}", "Content-Type": "application/json"},
json={
"wallet_uuid": "00000000-0000-0000-0000-000000000000",
"merchant_id": "11111111-1111-1111-1111-111111111111",
"payer_name": "赵丽",
"payer_email": "zhaoli@example.com",
"payer_tax_id": "12345678901",
"payer_cell_phone": "+5511988887777",
"installment_value": 2000,
"installment_count": 1,
"items": [{"name": "高级套餐", "quantity": 1, "total_amount": 2000, "unit_amount": 2000, "sku": "PLAN-001", "code": "PP001"}],
"payer_address": {"street": "Av. Apoquindo", "address_number": "4500", "complement": "", "neighborhood": "Las Condes", "city": "Santiago", "state": "RM", "postal_code": "7550000", "country": "CL"},
"currency": "CLP",
"due_date": "2026-12-31T23:59:59Z",
"description": "高级订阅",
"type_charge": "e_wallet",
"reference_external_id": "order-789",
"webhook_url": "https://yoursite.com/webhook",
"redirect_url": "https://yoursite.com/success",
},
)
charge.raise_for_status()
payment_url = charge.json()["charge_payment_url"]
const response = await fetch(
"https://core-manager.a55.tech/api/v1/bank/wallet/charge/",
{
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
wallet_uuid: "00000000-0000-0000-0000-000000000000",
merchant_id: "11111111-1111-1111-1111-111111111111",
payer_name: "赵丽",
payer_email: "zhaoli@example.com",
payer_tax_id: "12345678901",
payer_cell_phone: "+5511988887777",
installment_value: 2000,
installment_count: 1,
items: [{ name: "高级套餐", quantity: 1, total_amount: 2000, unit_amount: 2000, sku: "PLAN-001", code: "PP001" }],
payer_address: { street: "Av. Apoquindo", address_number: "4500", complement: "", neighborhood: "Las Condes", city: "Santiago", state: "RM", postal_code: "7550000", country: "CL" },
currency: "CLP",
due_date: "2026-12-31T23:59:59Z",
description: "高级订阅",
type_charge: "e_wallet",
reference_external_id: "order-789",
webhook_url: "https://yoursite.com/webhook",
redirect_url: "https://yoursite.com/success",
}),
}
);
if (!response.ok) throw new Error(`请求失败(HTTP ${response.status}):${await response.text()}`);
const { charge_payment_url } = await response.json();
Webhook 示例
{
"charge_uuid": "22222222-2222-2222-2222-222222222222",
"status": "paid",
"transaction_reference": "order-789"
}
Webhook 为准
将 webhook_url 视为支付状态的真实来源。若付款人关闭钱包窗口,重定向至 redirect_url 可能不会触发。
状态生命周期
| 状态 | 说明 |
|---|---|
issued | 重定向 URL 已就绪 |
paid | 钱包已确认 |
failed | 处理失败或拒绝 |
cancelled | 付款人或系统中止 |