datadownioad.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <?php
  2. /* *
  3. * 功能:支付宝手机网站alipay.data.dataservice.bill.downloadurl.query (查询对账单下载地址)接口调试入口页面
  4. * 版本:2.0
  5. * 修改日期:2016-11-01
  6. * 说明:
  7. * 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
  8. 请确保项目文件有可写权限,不然打印不了日志。
  9. */
  10. header("Content-type: text/html; charset=utf-8");
  11. require_once dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'service/AlipayTradeService.php';
  12. require_once dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'buildermodel/AlipayDataDataserviceBillDownloadurlQueryContentBuilder.php';
  13. require dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'./../config.php';
  14. if (!empty($_POST['WIDbill_type']) && !empty($_POST['WIDbill_date'])){
  15. //账单类型,商户通过接口或商户经开放平台授权后其所属服务商通过接口可以获取以下账单类型:trade、signcustomer;
  16. //trade指商户基于支付宝交易收单的业务账单;signcustomer是指基于商户支付宝余额收入及支出等资金变动的帐务账单;
  17. $bill_type = trim($_POST['WIDbill_type']);
  18. //账单时间:日账单格式为yyyy-MM-dd,月账单格式为yyyy-MM。
  19. $bill_date = trim($_POST['WIDbill_date']);
  20. $RequestBuilder = new AlipayDataDataserviceBillDownloadurlQueryContentBuilder();
  21. $RequestBuilder->setBillType($bill_type);
  22. $RequestBuilder->setBillDate($bill_date);
  23. $Response = new AlipayTradeService($config);
  24. $result=$Response->downloadurlQuery($RequestBuilder);
  25. return ;
  26. }
  27. ?>
  28. <!DOCTYPE html>
  29. <html>
  30. <head>
  31. <title>alipay.data.dataservice.bill.downloadurl.query(查询对账单下载地址)</title>
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  33. <style>
  34. *{
  35. margin:0;
  36. padding:0;
  37. }
  38. ul,ol{
  39. list-style:none;
  40. }
  41. body{
  42. font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
  43. }
  44. .hidden{
  45. display:none;
  46. }
  47. .new-btn-login-sp{
  48. padding: 1px;
  49. display: inline-block;
  50. width: 75%;
  51. }
  52. .new-btn-login {
  53. background-color: #02aaf1;
  54. color: #FFFFFF;
  55. font-weight: bold;
  56. border: none;
  57. width: 100%;
  58. height: 30px;
  59. border-radius: 5px;
  60. font-size: 16px;
  61. }
  62. #main{
  63. width:100%;
  64. margin:0 auto;
  65. font-size:14px;
  66. }
  67. .red-star{
  68. color:#f00;
  69. width:10px;
  70. display:inline-block;
  71. }
  72. .null-star{
  73. color:#fff;
  74. }
  75. .content{
  76. margin-top:5px;
  77. }
  78. .content dt{
  79. width:100px;
  80. display:inline-block;
  81. float: left;
  82. margin-left: 20px;
  83. color: #666;
  84. font-size: 13px;
  85. margin-top: 8px;
  86. }
  87. .content dd{
  88. margin-left:120px;
  89. margin-bottom:5px;
  90. }
  91. .content dd input {
  92. width: 85%;
  93. height: 28px;
  94. border: 0;
  95. -webkit-border-radius: 0;
  96. -webkit-appearance: none;
  97. }
  98. #foot{
  99. margin-top:10px;
  100. position: absolute;
  101. bottom: 15px;
  102. width: 100%;
  103. }
  104. .foot-ul{
  105. width: 100%;
  106. }
  107. .foot-ul li {
  108. width: 100%;
  109. text-align:center;
  110. color: #666;
  111. }
  112. .note-help {
  113. color: #999999;
  114. font-size: 12px;
  115. line-height: 130%;
  116. margin-top: 5px;
  117. width: 100%;
  118. display: block;
  119. }
  120. #btn-dd{
  121. margin: 20px;
  122. text-align: center;
  123. }
  124. .foot-ul{
  125. width: 100%;
  126. }
  127. .one_line{
  128. display: block;
  129. height: 1px;
  130. border: 0;
  131. border-top: 1px solid #eeeeee;
  132. width: 100%;
  133. margin-left: 20px;
  134. }
  135. .am-header {
  136. display: -webkit-box;
  137. display: -ms-flexbox;
  138. display: box;
  139. width: 100%;
  140. position: relative;
  141. padding: 7px 0;
  142. -webkit-box-sizing: border-box;
  143. -ms-box-sizing: border-box;
  144. box-sizing: border-box;
  145. background: #1D222D;
  146. height: 50px;
  147. text-align: center;
  148. -webkit-box-pack: center;
  149. -ms-flex-pack: center;
  150. box-pack: center;
  151. -webkit-box-align: center;
  152. -ms-flex-align: center;
  153. box-align: center;
  154. }
  155. .am-header h1 {
  156. -webkit-box-flex: 1;
  157. -ms-flex: 1;
  158. box-flex: 1;
  159. line-height: 18px;
  160. text-align: center;
  161. font-size: 18px;
  162. font-weight: 300;
  163. color: #fff;
  164. }
  165. </style>
  166. </head>
  167. <body text=#000000 bgColor="#ffffff" leftMargin=0 topMargin=4>
  168. <header class="am-header">
  169. <h1>支付宝手机网站查询对账单下载地址(接口名:alipay.data.dataservice.bill.downloadurl.query)</h1>
  170. </header>
  171. <div id="main">
  172. <form name=alipayment action='' method=post target="_blank">
  173. <div id="body" style="clear:left">
  174. <dl class="content">
  175. <dt>账单类型:</dt>
  176. <dd>
  177. <input id="WIDbill_type" name="WIDbill_type" value="trade" />
  178. </dd>
  179. <hr class="one_line">
  180. <dt>账单时间:</dt>
  181. <dd>
  182. <input id="WIDbill_date" name="WIDbill_date" />
  183. </dd>
  184. <hr class="one_line">
  185. <dt></dt>
  186. <dd>
  187. <span style="line-height: 28px; color:red;">注意:账单类型和账单时间不能为空!账单时间:日账单格式为yyyy-MM-dd,月账单格式为yyyy-MM。</span>
  188. </dd>
  189. <dd id="btn-dd">
  190. <span class="new-btn-login-sp">
  191. <button class="new-btn-login" type="submit" style="text-align:center;">确 认</button>
  192. </span>
  193. <span class="note-help">如果您点击“确认”按钮,即表示您同意该次的执行操作。</span>
  194. </dd>
  195. </dl>
  196. </div>
  197. </form>
  198. <div id="foot">
  199. <ul class="foot-ul">
  200. <li>
  201. 支付宝版权所有 2015-2018 ALIPAY.COM
  202. </li>
  203. </ul>
  204. </div>
  205. </div>
  206. </body>
  207. </html>