V2TradeSettlementEnchashmentDmamtQueryRequestDemo.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * DM取现额度查询 - 示例
  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/V2TradeSettlementEnchashmentDmamtQueryRequest.php";
  12. use BsPaySdk\core\BsPayClient;
  13. use BsPaySdk\request\V2TradeSettlementEnchashmentDmamtQueryRequest;
  14. // 2.组装请求参数
  15. $request = new V2TradeSettlementEnchashmentDmamtQueryRequest();
  16. // 商户号
  17. $request->setHuifuId("6666000021291985");
  18. // 设置非必填字段
  19. $extendInfoMap = getExtendInfos();
  20. $request->setExtendInfo($extendInfoMap);
  21. // 3. 发起API调用
  22. $client = new BsPayClient();
  23. $result = $client->postRequest($request);
  24. if (!$result || $result->isError()) { //失败处理
  25. var_dump($result -> getErrorInfo());
  26. } else { //成功处理
  27. var_dump($result);
  28. }
  29. /**
  30. * 非必填字段
  31. *
  32. */
  33. function getExtendInfos() {
  34. // 设置非必填字段
  35. $extendInfoMap = array();
  36. // 账户号
  37. $extendInfoMap["acct_id"]= "F00598600";
  38. return $extendInfoMap;
  39. }