settlement.php 942 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * The file is part of the payment lib.
  4. *
  5. * (c) Leo <dayugog@gmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. require_once __DIR__ . '/../../vendor/autoload.php';
  11. date_default_timezone_set('Asia/Shanghai');
  12. $wxConfig = require_once __DIR__ . '/../wxconfig.php';
  13. // 订单信息
  14. $params = [
  15. 'mode' => 'bank', // bank mch
  16. 'start_time' => strtotime('-2days'),
  17. 'end_time' => time(),
  18. 'operator_id' => '9999'
  19. ];
  20. // 使用
  21. try {
  22. $client = new \Payment\Client(\Payment\Client::CMB, $wxConfig);
  23. $res = $client->settleDownload($params);
  24. } catch (InvalidArgumentException $e) {
  25. echo $e->getMessage();
  26. exit;
  27. } catch (\Payment\Exceptions\GatewayException $e) {
  28. echo $e->getMessage();
  29. exit;
  30. } catch (\Payment\Exceptions\ClassNotFoundException $e) {
  31. echo $e->getMessage();
  32. exit;
  33. }
  34. var_dump($res);