KillB 沙盒环境允许您在不处理真实交易或转移实际资金的情况下测试您的集成。
Base URL: https://sandbox.killb.app功能:
- 使用假钱测试
- 模拟支付流程
- 不需要真实的 KYC 验证
- 即时交易处理
- 完整的 API 功能
用于:
- 开发和测试
- 集成验证
- 演示应用程序
- CI/CD 测试
Base URL: https://killb.app功能:
- 真实资金交易
- 完整的 KYC/KYB 验证
- 实际支付处理
- 监管合规
- 生产支持
用于:
开始使用沙盒
步骤 1:获取沙盒凭证
- 在 otc.killb.com 注册
- 导航到 设置 → API 密钥
- 创建 沙盒 API 密钥
- 记录您的沙盒电子邮件和密码
步骤 2:设置环境变量
KILLB_ENV=sandbox
KILLB_BASE_URL=https://sandbox.killb.app
KILLB_EMAIL=[email protected]
KILLB_PASSWORD=your-sandbox-password
KILLB_API_KEY=your-sandbox-api-key
步骤 3:身份验证
curl --request POST \
--url https://sandbox.killb.app/api/v2/auth/login \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"password": "your-sandbox-password"
}'
测试功能
Faker 端点
沙盒提供特殊端点来模拟支付事件:
模拟用户完成法币支付(PSE、SPEI 等)POST /api/v2/faker/cash-in
请求:{
"rampId": "ramp-id-from-creation"
}
作用:
- 将现金入账标记为已完成
- 触发转换过程
- 将 ramp 移动到下一个状态
示例:curl --request POST \
--url https://sandbox.killb.app/api/v2/faker/cash-in \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"rampId": "your-ramp-id"}'
模拟加密货币到法币转换的完成POST /api/v2/faker/cash-out
请求:{
"rampId": "ramp-id-from-creation"
}
作用:
- 完成现金出账过程
- 将 ramp 标记为 COMPLETED
- 触发 webhooks
示例:curl --request POST \
--url https://sandbox.killb.app/api/v2/faker/cash-out \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"rampId": "your-ramp-id"}'
测试工作流
完整的 On-Ramp 测试
创建测试用户
使用任何看起来有效的数据 - 沙盒中不需要真实验证{
"firstName": "Test",
"lastName": "User",
"email": "[email protected]",
"document": { "type": "PASSPORT", "number": "TEST123" }
}
创建钱包账户
使用任何有效的钱包地址格式{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"network": "POLYGON",
"currency": "USDC"
}
模拟支付
使用 /api/v2/faker/cash-in 模拟用户支付
验证完成
检查 ramp 状态是否移动到 COMPLETED
完整的 Off-Ramp 测试
创建银行账户
使用测试银行详情{
"type": "PSE",
"accountNumber": "1234567890",
"bankCode": "0001"
}
模拟完成
使用 /api/v2/faker/cash-out 完成流程
验证状态
确认状态为 COMPLETED 并触发 webhooks
测试数据
测试银行账户(哥伦比亚)
| 银行名称 | 银行代码 | 账户类型 |
|---|
| Bancolombia | 0001 | savings, checking |
| Banco de Bogotá | 0002 | savings, checking |
| Davivienda | 0003 | savings, checking |
测试银行账户(墨西哥)
| 银行名称 | 银行代码 | CLABE 格式 |
|---|
| BBVA | 012 | 012XXXXXXXXXXXXXXXXX |
| Santander | 014 | 014XXXXXXXXXXXXXXXXX |
| Banorte | 072 | 072XXXXXXXXXXXXXXXXX |
测试钱包地址
Polygon (MATIC):
0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb
Solana:
5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP4UJnC
Ethereum:
0x71C7656EC7ab88b098defB751B7401B5f6d8976F
Tron:
TXYZopYRdj2D9XRtbG4uXyrFPRw6sM3pjN
这些是用于测试的示例地址。在沙盒中,任何格式有效的地址都可以工作。
沙盒限制
| 功能 | 沙盒 | 生产 |
|---|
| 真实资金 | ❌ 否 | ✅ 是 |
| KYC 验证 | ❌ 模拟 | ✅ 真实验证 |
| 支付处理 | ⚡ 即时 | ⏱️ 真实时间 |
| Webhooks | ✅ 是 | ✅ 是 |
| API 速率限制 | 🔓 宽松 | 🔒 强制执行 |
在沙盒中调试
启用详细日志
const DEBUG = process.env.KILLB_ENV === 'sandbox';
async function makeRequest(endpoint, options) {
if (DEBUG) {
console.log('Request:', endpoint, options);
}
const response = await fetch(endpoint, options);
const data = await response.json();
if (DEBUG) {
console.log('Response:', data);
}
return data;
}
监控 Ramp 状态
async function waitForRampCompletion(rampId, maxAttempts = 30) {
for (let i = 0; i < maxAttempts; i++) {
const ramp = await fetch(`/api/v2/ramps/${rampId}`, {
headers: { 'Authorization': `Bearer ${token}` }
}).then(r => r.json());
console.log(`Attempt ${i + 1}: Status = ${ramp.status}`);
if (ramp.status === 'COMPLETED') {
return ramp;
}
if (['FAILED', 'CANCELED', 'REJECTED'].includes(ramp.status)) {
throw new Error(`Ramp ${ramp.status}: ${ramp.details}`);
}
await new Promise(resolve => setTimeout(resolve, 2000));
}
throw new Error('Ramp completion timeout');
}
切换到生产环境
当您准备上线时:
更新 Base URL
从 teste-94u93qnn.uc.gateway.dev 更改为 killb.appconst baseUrl = 'https://killb.app';
移除 Faker 调用
移除所有对 /api/v2/faker/* 端点的调用
实现真实 KYC
处理实际的 KYC 验证和文档上传
测试清单
在上线生产之前,测试这些场景:
需要帮助?