示例

假设配置参数

appid= testappid
appsecret= testappsecret

假设传送的参数

appid=testappid
attach=附加数据
auth_code=134701064877777777
body=测试商品名称
nonce_str=4WTYWD55S9695NXJZ53R3PM8UV43ZGHA
out_trade_no=20180418161909994J3QJGOA
total_amount=1
version=V1.0

第一步:对参数按照key=value的格式,并按照参数名ASCII字典序排序

stringA=’appid=testappid&attach=附加数据&auth_code=134701064877777777&body=测试商品名称&nonce_str=4WTYWD55S9695NXJZ53R3PM8UV43ZGHA&out_trade_no=20180418161909994J3QJGOA&total_amount=1&version=V1.0’;

第二步:拼接API密钥

stringSignTemp=stringA+’&appsecret=testappsecret’
sign=MD5(stringSignTemp).toUpperCase()='352AD703B3EC2550E8F0C4B1F382B7A3’

请求示例

http://openapi.chuangjiangx.com/haipay/micropay?
appid=testappid
&attach=附加数据
&auth_code=134701064877777777
&body=测试商品名称
&nonce_str=4WTYWD55S9695NXJZ53R3PM8UV43ZGHA
&out_trade_no=20180418161909994J3QJGOA
&total_amount=1
&version=V1.0
&sign=352AD703B3EC2550E8F0C4B1F382B7A3

返回参数

{
​    "code": "0",
​    "trade_state": "1",
​    "trade_id": "201705051635193035058670",
​    "pay_time": "2017-05-05 16:35:27"
}
Copyright © 创匠科技 2018 all right reserved,powered by Gitbook该文件修订时间: 2018-07-17 18:00:45

results matching ""

    No results matching ""