queryTransfer.php 797 B

123456789101112131415161718192021222324252627282930313233343536
  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. $data = [
  14. 'trans_no' => '1489852933',
  15. ];
  16. try {
  17. $client = new \Payment\Client(\Payment\Client::WECHAT, $wxConfig);
  18. $client->transferQuery($data);
  19. } catch (InvalidArgumentException $e) {
  20. echo $e->getMessage();
  21. exit;
  22. } catch (\Payment\Exceptions\GatewayException $e) {
  23. echo $e->getMessage();
  24. exit;
  25. } catch (\Payment\Exceptions\ClassNotFoundException $e) {
  26. echo $e->getMessage();
  27. exit;
  28. }
  29. var_dump($res);