ApplePay支付
POST
/applepay/apisequenceDiagram
Merchant->>UseePay Server: 请求/applepay/api
接口
UseePay Server-)Merchant: 支付结果
Merchant->>Merchant: 处理支付结果
Merchant->>consumer: 展示支付结果
关于请求参数
1.payerInfo中的的paymentMethod需指定为”applepay“
关于签名:
1.按照ASCII码顺序对请求的 payload 进行排序
2.按第一步获取的结果,进行key-value 遍历, 对 value trim 后不为空的 key-value 使用 URL 键值对的格式进行拼接(key1=value1&key2=value2...),
3.第2步取到字符串, 拼接上 &pkey=商户的MD5/RSA密钥, 然后对该字符串进行MD5/RSA, 得到的值即为签名值
关于响应处理:
1.根据resultCode判断交易状态。
2.redirectParam中包含的ApplePayPaymentAuthorizationResult字符串,为ApplePaySDK需要的参数,请解析之后使用
请求参数
Header 参数
Content-Type
string
必需
示例值:
application/x-www-form-urlencoded
Body 参数application/x-www-form-urlencoded
version
string
必需
目前固定为 1.0
示例值:
1.0
merchantNo
string
商户号
示例值:
500000000007362
transactionId
string
订单号
示例值:
202212070142347
transactionType
string
传 pay
示例值:
pay
transactionExpirationTime
integer
必需
交易过期时间(单位为分钟)
示例值:
30
appId
string
必需
提交审核的网站, 需与商户后台网站审核值一致
示例值:
www.pay.com
amount
string
必需
订单金额, 必须大于0,单位为对应货币的最小货币单位参考节 (12)
示例值:
1234
currency
string
必需
货币单位,请参考一节
示例值:
USD
orderInfo
string
必需
json string,订单信息
示例值:
{ "subject": "订单标题", "goodsInfo": [ { "id": "商品编号", "name": "商品名称", "body": "商品描述", "category": "商品类目", "categoryTree": "商品类目树,不同级别类目使用”|”分割", "brand": "商品品牌", "quantity": 1, "price": 1234, "url": "商品url", "sku": "商品sku", "image": "商品图片url" } ], "deliveryMethod": "logistics", "deliveryTime": "", "shippingAddress": { "email": "victor.yang@useepay.com", "phoneNo": "+44 20 7734 9638", "firstName": "Victor", "lastName": "Yang", "street": "Heathcoat House, 20 Savile Row", "postalCode": "W1S 3PR", "city": "London", "state": "LND", "country": "GB" }}
payerInfo
string
必需
json string, 付款方信息
示例值:
{ "paymentMethod": "applepay", "authorizationMethod": "cvv", "billingDescriptor": "", "billingAddress": { "houseNo": "El Gallo Giro(https://gallogiro.com/)", "email": "victor.yang@useepay.com", "phoneNo": "(323) 585-4433", "firstName": "Victor", "lastName": "Yang", "street": "7148 Pacific Blvd, Huntington Park, CA 90255", "postalCode": "90225", "city": "Huntington Park", "state": "CA", "country": "US" }}
userInfo
string
必需
json string,消费者信息
示例值:
{ "userId": "victor007", "ip": "103.25.65.178", "email": "victor.yang@useepay.com", "phoneNo": "(323) 585-4433", "createTime": "20200520131400"}
notifyUrl
string
可选
异步通知地址 (512)
示例值:
https://gatewaytest.useepay.com/gateway-test/notifyV2u0
echoParam
string
可选
回声参数,Response 中将会原样返回 (length=256)
示例值:
echoParam
signType
string
必需
签名类型(MD5/RSA)(length=4)
示例值:
MD5
sign
string
必需
签名值,签名方法请参加《签名指导》章节
示例值:
decb3b9b728c7af4251acae23804939b
referer
string
当前页面的 URL
示例值:
https://pinkx.com/
applePayPayment
string
必需
ApplePay SDK生成
示例代码
返回响应
成功(200)
服务器错误(500)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
merchantNo
string
商户订单号
transactionId
string
交易类型
transactionType
string
交易类型:pay
amount
string
支付金额
currency
string
必需
3 位 ISO 大写字母货币代码
resultCode
string
业务结果
errorCode
string
错误码
errorMsg
string
错误码消息描述
redirectParam
string
必需
ApplePay SDK需要的相关信息
echoParam
string
必需
回声参数,响应报文会原样返回
sign
string
必需
商户请求参数的签名串
reference
string
交易流水号
示例
支付成功
{
"merchantNo": "500000000007381",
"transactionId": "202112011024047",
"transactionType": "pay",
"reference": "1012112011024652513",
"amount": "1234",
"currency": "USD",
"resultCode": "succeed",
"errorCode": "0000",
"errorMsg": "Approved or completed successfully",
"echoParam": "echoParam",
"reserved": "ApplePayPaymentAuthorizationResult(status=0, errors=[])",
"sign": "1aab1771d7846efb74edb801a0fd772d"
}
最后修改时间: 2 个月前