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

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.签订协议,开通接口,如下图:

 

 

 

二.访问参数:

 

 

请求参数举例:

 

[php] view plain copy

  1. array (size=12)  
  2.   'service' => string 'refund_fastpay_by_platform_nopwd' (length=30)  
  3.   'partner' => string '222221624104006' (length=16)  
  4.   '_input_charset' => string 'UTF-8' (length=5)  
  5.   'sign_type' => string 'MD5' (length=3)  
  6.   'notify_url' => string 'http://www.test.com/admin/api/refund/alipay/notify_url.php' (length=60)  
  7.   'dback_notify_url' => string 'http://www.test.com/admin/api/refund/alipay/notify_url.php' (length=60)  
  8.   'batch_no' => string '2016081818103' (length=13)  
  9.   'refund_date' => string '2016-08-18 18:49:51' (length=19)  
  10.   'batch_num' => string '1' (length=1)  
  11.   'detail_data' => string '2016081821001004270231872174^0.01^协商退款' (length=46)  
  12.   'use_freeze_amount' => string 'N' (length=1)  
  13.   'return_type' => string 'xml' (length=3)  
  14.   
  15. 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.同步受理回调参数:

 

[php] view plain copy

  1. string '<?xml version="1.0" encoding="GBK" ?>   
  2. <alipay>  
  3. <is_success>F</is_success>  
  4. <error>DUPLICATE_BATCH_NO</error>  
  5. </alipay>' (length=122)  


2.异步回调参数:

正常异步回调:

 

[php] view plain copy

  1. 成功举例:  
  2. 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"}  
  3.   
  4.   
  5. 失败举例:  
  6. 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"}  

 

 

 

充退回调:

 

 

 

 

四.碰到问题:

 

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

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

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

 

 

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

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值