借记卡
Quick Reference
What接受借记卡支付
Why与信用卡共用同一 API(应用程序编程接口)端点(endpoint)——强制 3DS(3D Secure 验证)以安全完成借记授权
Reading Time10 分钟
Difficulty初级
Prerequisites身份验证 → 信用卡
借记与信用卡一览
| 功能 | 信用卡 | 借记卡 |
|---|---|---|
type_charge | credit_card | debit_card |
| 3DS | 可选 | 必填 |
| 分期付款 | 最高 12 期 | 不支持 |
预授权(capture: false) | 是 | 否 |
| 资金来源 | 信用额度 | 银行余额 |
| 结算 | 收单机构账期 | 通常更快 |
3DS 必需
借记卡始终需要 3DS。未设置 threeds_authentication: true 且未提供有效 device_info 的收费,系统将拒绝处理。
交易流程
创建借记卡收费
数据安全
A55 全链路通过 PCI DSS(支付卡行业数据安全标准)一级认证。卡数据在我们认证的基础设施中安全传输和处理。如需更简化的集成方案——完全不在您的服务器上处理卡数据——请参阅 SDK 集成 或 Checkout Page。
- 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": "liming@example.com",
"payer_cell_phone": "+5511999999999",
"payer_tax_id": "12345678901",
"items": [{"name":"商品","quantity":1,"total_amount":100,"unit_amount":100,"sku":"SKU-001","code":"P001"}],
"payer_address": {"street":"Sample St","address_number":"123","complement":"","neighborhood":"Centro","city":"São Paulo","state":"SP","postal_code":"01000-000","country":"BR"},
"currency": "BRL",
"installment_value": 100,
"installment_count": 1,
"due_date": "2026-12-31",
"description": "借记卡消费",
"type_charge": "debit_card",
"card_name": "李明",
"card_number": "4111111111111111",
"card_expiry_month": "12",
"card_expiry_year": "2030",
"card_cvv": "123",
"threeds_authentication": true,
"device_info": {"ip_address":"192.168.0.1","user_agent":"Mozilla/5.0","http_browser_language":"en-US","http_browser_color_depth":"24","http_browser_screen_height":"1080","http_browser_screen_width":"1920"},
"webhook_url": "https://yoursite.com/webhook",
"redirect_url": "https://yoursite.com/return"
}'
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": "liming@example.com",
"payer_cell_phone": "+5511999999999",
"payer_tax_id": "12345678901",
"items": [{"name": "商品", "quantity": 1, "total_amount": 100, "unit_amount": 100, "sku": "SKU-001", "code": "P001"}],
"payer_address": {"street": "Sample St", "address_number": "123", "complement": "", "neighborhood": "Centro", "city": "São Paulo", "state": "SP", "postal_code": "01000-000", "country": "BR"},
"currency": "BRL",
"installment_value": 100,
"installment_count": 1,
"due_date": "2026-12-31",
"description": "借记卡消费",
"type_charge": "debit_card",
"card_name": "李明",
"card_number": "4111111111111111",
"card_expiry_month": "12",
"card_expiry_year": "2030",
"card_cvv": "123",
"threeds_authentication": True,
"device_info": {"ip_address": "192.168.0.1", "user_agent": "Mozilla/5.0", "http_browser_language": "en-US", "http_browser_color_depth": "24", "http_browser_screen_height": "1080", "http_browser_screen_width": "1920"},
"webhook_url": "https://yoursite.com/webhook",
"redirect_url": "https://yoursite.com/return",
},
)
charge.raise_for_status()
print(charge.json())
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: "liming@example.com",
payer_cell_phone: "+5511999999999",
payer_tax_id: "12345678901",
items: [{ name: "商品", quantity: 1, total_amount: 100, unit_amount: 100, sku: "SKU-001", code: "P001" }],
payer_address: { street: "Sample St", address_number: "123", complement: "", neighborhood: "Centro", city: "São Paulo", state: "SP", postal_code: "01000-000", country: "BR" },
currency: "BRL",
installment_value: 100,
installment_count: 1,
due_date: "2026-12-31",
description: "借记卡消费",
type_charge: "debit_card",
card_name: "李明",
card_number: "4111111111111111",
card_expiry_month: "12",
card_expiry_year: "2030",
card_cvv: "123",
threeds_authentication: true,
device_info: { ip_address: "192.168.0.1", user_agent: "Mozilla/5.0", http_browser_language: "en-US", http_browser_color_depth: "24", http_browser_screen_height: "1080", http_browser_screen_width: "1920" },
webhook_url: "https://yoursite.com/webhook",
redirect_url: "https://yoursite.com/return",
}),
}
);
if (!response.ok) throw new Error(`请求失败(HTTP ${response.status}):${await response.text()}`);
console.log(await response.json());
异步状态
响应常返回 status: "pending" 与 url_3ds。最终状态通过 Webhook(网络钩子)送达。
响应示例
{
"charge_uuid": "51dcca6e-7310-4b73-a94c-90835408f2ff",
"type": "debit_card",
"status": "pending",
"url_3ds": "https://secure.example.com/3ds-challenge?transaction_id=abc123"
}
状态生命周期
| 状态 | 含义 |
|---|---|
pending | 3DS 认证进行中 |
authorized | 授权成功 |
captured | 扣款确认 |
paid | 已确认待结算 |
failed | 拒绝或认证失败 |
cancelled | 已作废 |
refunded | 已处理退款 |