沙箱调试说明
1.
2.
3.
4.
5.
6.
7.
8.
业务用例
9.
签约协议
10.
独立签约
11.
12.
13.
{
"access_params":{
"channel":"ALIPAYAPP"
},
"external_agreement_no":"DKRGVIAZAV",// 商户签约号,代扣协议中标示用户的唯一签约号(确保在商户系统中唯一)
"period_rule_params":{
"execute_time":"2023-07-26",
"period":7,
"period_type":"DAY",
"single_amount":"99"
},
"personal_product_code":"CYCLE_PAY_AUTH_P",// 固定值
"product_code":"GENERAL_WITHHOLDING",// 固定值
"sign_scene":"INDUSTRY|DEFAULT_SCENE"// 协议签约场景,商户可根据 代扣产品常见场景值 选择符合自身的行业场景。
}
14.
独立签约支持 SDK、PC 转二维码、小程序(沙箱暂不支持)等三种方式接入,参数一样,根据接入场景,对返回结果做转换。
15.
INDUSTRY|DEFAULT_SCENE
场景。16.
SDK 内唤起签约页
17.
1.
response = alipayClient.pageExecute(request,"get")
2.
signParams = response.getBody().replace("https://openapi-sandbox.dl.alipaydev.com/gateway.do?","")
3.
signParams = encode(signParams)
4.
callParams = 'alipays://platformapi/startapp?appId=60000157&appClearTop=false&startMultApp=YES&sign_params=' + signParams
18.
19.
alipays://platformapi/startapp?appId=60000157
(该链接里面的 APPID 为固定值,不可修改)20.
PC 转二维码唤起签约页
21.
1.
signUrl = alipayClient.pageExecute(request, "get")
。2.
22.
23.
24.
小程序内唤起签约页
25.
26.
协议管理
27.
协议查询
28.
29.
30.
{
"alipay_user_id":"208872200058****",
"external_agreement_no":"DK9KX0HB",// 商户签约号,代扣协议中标示用户的唯一签约号(确保在商户系统中唯一)
"personal_product_code":"CYCLE_PAY_AUTH_P",
"sign_scene":"INDUSTRY|DEFAULT_SCENE"// 协议签约场景,商户可根据 代扣产品常见场景值 选择符合自身的行业场景。
}
31.
32.
{
"alipay_user_agreement_query_response":{
"msg":"Success",
"code":"10000",
"third_party_type":"PARTNER",
"external_agreement_no":"DK9KX0HB",
"principal_id":"208872200058****",
"sign_time":"2023-07-11 19:29:41",
"agreement_no":"20235511025243691778",// 支付宝系统中用以唯一标识用户签约记录的编号。(只有签约成功时才会返回)
"invalid_time":"2115-02-01 00:00:00",
"personal_product_code":"CYCLE_PAY_AUTH_P",
"pricipal_type":"CARD",
"valid_time":"2023-07-11 19:29:41",
"alipay_logon_id":"pji***@sandbox.com",
"sign_scene":"INDUSTRY|DEFAULT_SCENE",
"status":"NORMAL"
}
}
33.
协议解约
34.
35.
{
"agreement_no":"20235511025243691778"// 支付宝系统中用以唯一标识用户签约记录的编号。(只有签约成功时才会返回)
}
{
"sign":"O8eWkL6LVzBaqNMQONhi1/cLUQVbtFM7q/cugCjR8v31M8jT3gGnJDYnFpo1by7jw9la+qIuAAQMzaGYG4saC4GvoPxIJF/FwNI6jPncGxV3sy7eglA85Sc+YENbAcioqvGS70J+RUFnKrdsZyEWqRvW2o39MOUj524+VcKxmGo/3UbGzxXA7iPQGn9LsFwQ0wXrK0ao44dTovAfxtTYs551Zwn7wCA+7mbdA29ufVZQLSNimBBREoOwxUIkXx0BedvdIOg8kBrey7CEA+ndFakHtHO1PUADEW7dswmWFaubhckzxsYngRGRyImCPSJH0mhJ79NRwJY9Vbt2S+ePYA==",
"alipay_user_agreement_unsign_response":{
"msg":"Success",
"code":"10000"
}
}
36.
协议修改
37.
38.
39.
{
"agreement_no":"20235526025282926778"
"deduct_time":"2023-07-28"
"memo":"测试修改"
}
40.
41.
{
"sign":"MX7oDyzKx3WdHnF8eUWc0qeyC6X1EfOBOTNAbW4H2B1TOsbewzoomPgWl2N7RJEeM4KA9EoJpvCqtVCnzKQimHIswa5efgIDaIrZbolITWUPQHhaFhtD8V5/WdjqHCE4KdMypLFT5g3DojuQrqSAe5HjuauW8nteUmqUuhrhv3UubogRvLvfiJ5TVZ2lZUydkcoXSBKWea36iO7K0Vam3DFh9tJGES1K3qY7jaSyzaIhZDzImqJmx7mRVfzOOao6A7YOAIxvgsmu1D80bfhmYuSdh6qRuzE2mh84RYgNYBumuBBaFByIt1aqPzh9PL6e9PjheuWo1fEwQ7fXjQaNFw==",
"alipay_user_agreement_executionplan_modify_response":{
"msg":"Success",
"code":"10000",
"agreement_no":"20235526025282926778",
"deduct_time":"2023-07-28 08:00:00"
}
}
42.
协议扣款
43.
扣款
44.
45.
46.
{
"agreement_params":{
"agreement_no":"20235511025243691778"
},// 支付宝系统中用以唯一标识用户签约记录的编号。(只有签约成功时才会返回)
"out_trade_no":"b895d854f7794fb3bbb2f17cebb6445b",
"product_code":"GENERAL_WITHHOLDING",// 固定值
"subject":"测试代扣",
"total_amount":"28"
}
47.
48.
49.
50.
{
"alipay_trade_pay_response": {
"code": "10000",
"msg": "Success",
"buyer_logon_id": "pji***@sandbox.com",
"buyer_pay_amount": "28.00",
"buyer_user_id": "208872200058****",
"buyer_user_type": "PRIVATE",
"fund_bill_list": [
{
"amount": "28.00",
"fund_channel": "ALIPAYACCOUNT"
}
],
"gmt_payment": "2023-07-12 14:35:57",
"invoice_amount": "28.00",
"out_trade_no": "86185826a13d4854a982c244a0729626",
"point_amount": "0.00",
"receipt_amount": "28.00",
"total_amount": "28.00",
"trade_no": "2023071222001486780500485476"
}
}
51.
交易撤销
52.
53.
54.
{
"out_trade_no":"7e165070067845fba0f5b6537864f8ad"
}
55.
56.
{
"alipay_trade_cancel_response":{
"msg":"Success",
"code":"10000",
"out_trade_no":"7e165070067845fba0f5b6537864f8ad",
"retry_flag":"N",
"action":"close",
"trade_no":"2023071222001486780500497860"
}
}
57.
交易退款
58.
59.
60.
{
"refund_amount":"28",
"trade_no":"2023071222001486780500485476"
}
61.
62.
{
"alipay_trade_refund_response":{
"msg":"Success",
"refund_detail_item_list":[
{
"amount":"28.00",
"fund_channel":"ALIPAYACCOUNT"
}
],
"code":"10000",
"out_trade_no":"86185826a13d4854a982c244a0729626",
"refund_fee":"28.00",
"gmt_refund_pay":"2023-07-12 17:38:51",
"send_back_fee":"28.00",
"trade_no":"2023071222001486780500485476",
"buyer_logon_id":"pji***@sandbox.com",
"buyer_user_id":"208872200058****",
"fund_change":"Y"
}
}
63.
查询对账单
64.
65.
66.
{
"bill_date":"2023-07-11",
"bill_type":"trade"
}
67.
68.
{
"alipay_data_dataservice_bill_downloadurl_query_response":{
"msg":"Success",
"code":"10000",
"bill_download_url":"http://dwbillcenter-sandbox.dl.alipaydev.com/downloadBillFile.resource?bizType=trade&userId=2088721000621517****&fileType=csv.zip&bizDates=20230711&downloadFileName=20887210006215170156_20230711.csv.zip&fileId=%2Ftrade%2F20887210006215170156%2F20230711.csv.zip×tamp=1689155281&token=fc2b4cc81c517ca4446873365155250b"
}
}
修改于 2023-11-20 05:46:26