Ethereum
快速启动
- 报名 at ethereum.org 并获取 API 凭据
- 创建终端 输入 管理控制台 参数如下:
- 开始处理 ——适配器预建并准备使用.
概览
Ethereum 付款一体化
| 供应商 ID | ethereum |
| 类别 | 密码链( B) |
| 网站 | ethereum.org |
配置
所需参数
| 参数 | 说明 |
|---|---|
api_key | 访问的密钥 Ethereum RPC (例如:Infura) (中文(简体) ). API 键) |
示例配置
{
"env": "prod",
"api_key": "infura-api-key",
"need_auth": true
}
付款流程
付款(一个阶段,有需要_auth=真实):(标识符:need_auth)
-
获取 _ 附加_参数_ for_aut - 用于认证的生成参数:(标识符:
get_additional_params_for_auth)- 获取接受付款的目的地钱包_ 地址(标识符:
wallet_address) - AML 检查源代码(_A) (冷钱包)(标识符:
source_addr) - 生成签名 : 符号 (“ tx_ id: wallet_ address” )(标识符:
tx_id,wallet_address) - 退还钱包地址和签名(标识符:
wallet_address)
- 获取接受付款的目的地钱包_ 地址(标识符:
-
进程_操作( 需要_ auth= true) - 用核查区块链进行处理:(标识符:
process_operation,need_auth)- 从额外的 params for_auth 获取 tx_hash(标识符:
additional_params_for_auth) - 唯一性检查 tx_ hash( 以前没有使用过)(标识符:
tx_hash) - 通过 Ethers 从块链获取收件。 get_ transaction_ receipt(标识符:
get_transaction_receipt) - 从日志交易中提取到的金额
- 验证:from == source,to == destination,金额一致
- 审定后立即收取的退款
- 从额外的 params for_auth 获取 tx_hash(标识符:
付款( 有需要的一阶段_ auth=虚假):(标识符:need_auth)
-
进程_操作( 需要_ auth=虚假) - 创建块链交易:(标识符:
process_operation,need_auth)- 确定符号标准( A)ERC20)和货币(USDT/ZOLT)
- 获取足够余额的源钱包( 发件人)
- 获取目的钱包_ 地址(标识符:
wallet_address) - AML 检查支付目的钱包_ 地址(标识符:
wallet_address) - 通过Fx.find_fx_rate_值交换货币(标识符:
find_fx_rate_value) - 调用合同. 转让(日期、金额)
- 通过 Ethers.send 以签名符发送(标识符:
signer_opts) - 将 tx_hash 退款为外部xid/merchantxid
-
状态 - 状态检查区块链交易:
- 通过 Ethers.get_transaction_ receipt 获取收件(标识符:
get_transaction_receipt) - 分析从收到状态: "1" + 指控, " 0x1 " + 指控,其余 + 驳回
- 充电: 更新钱包余额和气体
- 退款商家_meta. status 或提供者状态(标识符:
merchant_meta)
- 通过 Ethers.get_transaction_ receipt 获取收件(标识符: