V2TradeOnlinepaymentTransferAccountQueryRequestDemo.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * 银行转账资金流水查询 - 示例
  4. *
  5. * @author sdk-generator
  6. * @Description
  7. */
  8. namespace BsPayDemo;
  9. // 1. 资源及配置加载
  10. require_once dirname(__FILE__) . "/loader.php";
  11. require_once dirname(__FILE__). "/../BsPaySdk/request/V2TradeOnlinepaymentTransferAccountQueryRequest.php";
  12. use BsPaySdk\core\BsPayClient;
  13. use BsPaySdk\request\V2TradeOnlinepaymentTransferAccountQueryRequest;
  14. // 2.组装请求参数
  15. $request = new V2TradeOnlinepaymentTransferAccountQueryRequest();
  16. // 请求流水号
  17. $request->setReqSeqId(date("YmdHis").mt_rand());
  18. // 请求日期
  19. $request->setReqDate(date("Ymd"));
  20. // 商户号
  21. $request->setHuifuId("6666000003100615");
  22. // 原请求流水号
  23. $request->setOrgReqSeqId("20211659949882");
  24. // 原请求日期
  25. $request->setOrgReqDate("20220808");
  26. // 打款结束日期
  27. $request->setTransEndDate("20220808");
  28. // 交易开始日期
  29. $request->setTransStartDate("20220801");
  30. // 设置非必填字段
  31. $extendInfoMap = getExtendInfos();
  32. $request->setExtendInfo($extendInfoMap);
  33. // 3. 发起API调用
  34. $client = new BsPayClient();
  35. $result = $client->postRequest($request);
  36. if (!$result || $result->isError()) { //失败处理
  37. var_dump($result -> getErrorInfo());
  38. } else { //成功处理
  39. var_dump($result);
  40. }
  41. /**
  42. * 非必填字段
  43. *
  44. */
  45. function getExtendInfos() {
  46. // 设置非必填字段
  47. $extendInfoMap = array();
  48. // 银行卡号
  49. $extendInfoMap["bank_card_no"]= "Xmjm1RB4AAOaFYQ+PgjBlpugXbd8VAYAGB3J2zrbLfC42Bh5xiB47OOV1EdXyGpBq4H8je7mB/MlyEEs6O8PX6aoI4QHumr8VglrLM6uzbVNCIc3S5RPSmi2M+9+EdIQ6nlWd5+XQ7RJXX5Uvnegn74XzQBcN1d4gd04buwKbLpUPV3tWd1qjQwEE8w4gwEtH3L5AP75Mynz+wHFrUKJF3BTiW2/zJlcq5GJomOl06GEW52AZkXwn6U2suP3a0ySd0Rxbf1yQ1lj3SP56NeeEzuBaFLQWB7mEqJfZF3pE9MHNfi6tR1xwLdcxt98bdIqlteKdNAmgfQzcS13UcwH+w==";
  50. // 付款方名称
  51. $extendInfoMap["certificate_name"]= "沈显龙";
  52. // 入账标识
  53. $extendInfoMap["in_acct_flag"]= "YDNI2NDJIKKPAFGQ";
  54. return $extendInfoMap;
  55. }