支付宝退款接口(即时到帐无密退款)

refund_fastpay_by_platform_nopwd 官方参考文档:

点击下载:http://download.csdn.net/detail/ty_hf/9611096

步骤:
  • 1. 按照官方文档,编写此接口所需要的各个参数;
  • 2. 对各参数进行签名处理,生成URL
  • 3.调用此URL,跳转到对应请求页面
  • 4.同步回调返回【受理结果】,注意是受理结果,就是此笔退款支付宝已经受理成功要去执行了,至于执行退款成功否,见5
  • 5.异步返回【退款结果】,详细参数见下

  • 【注意,此功能接口,默认是不支持开放的,需要签约才可以。】

一.签约步骤:

1.登录 http://b.alipay.com

2.申请人工服务,提交此接口的开通申请。

3.等待几个工作日,阿里会联系你,进行签约

4.签订协议,开通接口,如下图:

支付宝退款接口(即时到帐无密退款)_第1张图片

支付宝退款接口(即时到帐无密退款)_第2张图片



二.访问参数:

支付宝退款接口(即时到帐无密退款)_第3张图片

支付宝退款接口(即时到帐无密退款)_第4张图片


请求参数举例:

array (size=12)
  'service' => string 'refund_fastpay_by_platform_nopwd' (length=30)
  'partner' => string '222221624104006' (length=16)
  '_input_charset' => string 'UTF-8' (length=5)
  'sign_type' => string 'MD5' (length=3)
  'notify_url' => string 'http://www.test.com/admin/api/refund/alipay/notify_url.php' (length=60)
  'dback_notify_url' => string 'http://www.test.com/admin/api/refund/alipay/notify_url.php' (length=60)
  'batch_no' => string '2016081818103' (length=13)
  'refund_date' => string '2016-08-18 18:49:51' (length=19)
  'batch_num' => string '1' (length=1)
  'detail_data' => string '2016081821001004270231872174^0.01^协商退款' (length=46)
  'use_freeze_amount' => string 'N' (length=1)
  'return_type' => string 'xml' (length=3)

https://mapi.alipay.com/gateway.do?_input_charset=UTF-8&batch_no=2016081818103&batch_num=1&dback_notify_url=http%3A%2F%2Fwww.test.com%2Fadmin%2Fapi%2Frefund%2Falipay%2Fnotify_url.php&detail_data=2016081821001004270231872174%5E0.01%5E%E5%8D%8F%E5%95%86%E9%80%80%E6%AC%BE¬ify_url=http%3A%2F%2Fwww.121mai.com%2Fadmin%2Fapi%2Frefund%2Falipay%2Fnotify_url.php&partner=2222221624104006&refund_date=2016-08-18+18%3A50%3A51&return_type=xml&service=refund_fastpay_by_platform_pwd&use_freeze_amount=N&sign=528ec9059f4bf1fb29d147632d737d73&sign_type=MD5



三.回调参数:

1.同步受理回调参数:

支付宝退款接口(即时到帐无密退款)_第5张图片

支付宝退款接口(即时到帐无密退款)_第6张图片

string ' 

F
DUPLICATE_BATCH_NO
' (length=122)

2.异步回调参数:
正常异步回调:
支付宝退款接口(即时到帐无密退款)_第7张图片

成功举例:
post:{"sign":"e18debab04898b7d5ce7d43823e21512","result_details":"2016082921001004270202288006^0.01^SUCCESS","notify_time":"2016-08-31 20:49:16","sign_type":"MD5","notify_type":"batch_refund_notify","notify_id":"86742cf72c3edb4f2818e67799d873cmva","batch_no":"2016083120318","success_num":"1"}


失败举例:
post :{"sign":"85915ba45f3d14d5668e2387eadc8817","result_details":"2016082721001004640239968415^160.00^SELLER_BALANCE_NOT_ENOUGH","notify_time":"2016-09-01 10:00:52","sign_type":"MD5","notify_type":"batch_refund_notify","notify_id":"e5b820377bb685b3462419885e505denn2","batch_no":"2016090110120","success_num":"0"}




充退回调:
支付宝退款接口(即时到帐无密退款)_第8张图片 支付宝退款接口(即时到帐无密退款)_第9张图片



四.碰到问题:

1.碰到问题,查看有密退款的问题描述,类似的

2.无密退款详细细节,请参见文档,一定要注意它的必填项与特殊参数的格式要求,比如 detail_data

3.在开发过程中,异步回调的不能再本地电脑调试,改host什么的无效,请到外部可以访问的页面进行,或者使用【花生壳】等工具映射到本地也可



本文地址:http://blog.csdn.net/ty_hf/article/details/52483880



你可能感兴趣的:(Others,微信/支付宝)