Authipay
快速启动
- 报名 at authipay.com 并获取 API 凭据
- 创建终端 输入 管理控制台 参数如下:
- 开始处理 ——适配器预建并准备使用.
概览
Authipay (Worldpay) - 付款(支付处理器)
| 供应商 ID | authipay |
| 类别 | 卡片处理器 |
| 网站 | authipay.com |
支助行动: Sale (payments_authorize - one_phase) PreAuth (payments_authorize - two_phase verify) Capture (payments_capture - two_phase commit) Status (payments_status) Refund (payments_refund)
认证
方法 : HMAC-SHA256 签署
算法 :
步骤 1: 签名字符串
signature_string = api_key + client_request_id + timestamp + payload_json
步骤 2: HMAC SHA-256
signature = hex(hmac_sha256(signature_string, api_secret))
步骤 3: 页眉
API-KEY: {api_key}
Message-Signature: {signature}
Timestamp: {timestamp_ms}
Client-Request-Id: {uuid}
Auth-Token-Type: HMAC
Content-Type: application/json
示例生成 :
import hmac
import hashlib
import time
import uuid
api_key = "api_abc123"
api_secret = "secret_xyz789"
client_request_id = str(uuid.uuid4())
timestamp = str(int(time.time() * 1000))
payload = '{"requestType":"PaymentCardSaleTransaction",...}'
signature_string = api_key + client_request_id + timestamp + payload
signature = hmac.new(
api_secret.encode(),
signature_string.encode(),
hashlib.sha256
).hexdigest()
配置
所需参数
| 参数 | 说明 |
|---|---|
base_url | 基础 API URL |
api_key | 公开 API 密钥 |
api_secret | 密钥用于 HMAC |
状态映射
| 提供者状况 | 4 工资状况 | 说明 |
|---|---|---|
Successful transaction | Charged / Authorized | |
Error/decline | Failure | |
Processing | Pending |