TestZfbTransFundCommand.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace App\Console\Test;
  3. use App\Cache\UserCache;
  4. use App\Libs\Utils;
  5. use Illuminate\Console\Command;
  6. use Illuminate\Support\Facades\DB;
  7. use Illuminate\Support\Facades\Redis;
  8. use Ycpay\Alitrans;
  9. use Ycpay\Byte;
  10. use Ycpay\Ali;
  11. /**
  12. * 测试支付宝转账
  13. */
  14. class TestZfbTransFundCommand extends Command
  15. {
  16. /**
  17. * @var string
  18. */
  19. protected $signature = 'test_zfb_trans_fund';
  20. /**
  21. * The console command description.
  22. *
  23. * @var string
  24. */
  25. protected $description = '测试支付宝转账';
  26. /**
  27. * handle
  28. */
  29. public function handle()
  30. {
  31. $uid = 18;
  32. $config = [
  33. 'appid'=>'2021003192638805',
  34. 'secret'=>'2021003192638805',
  35. 'notify_url'=>'https://zfb.ycsd.cn/pay/receive_zfb_third_notify',
  36. 'privateKey'=>file_get_contents(storage_path('cert/huomaoxiaoshuohui/应用私钥RSA2048.txt')),
  37. 'publicKey'=>file_get_contents(storage_path('cert/huomaoxiaoshuohui/应用公钥RSA2048.txt')),
  38. ];
  39. $object = new Alitrans();
  40. \Log::info('$config');
  41. \Log::info($config);
  42. // Byte::init($config);
  43. $object->init($config);
  44. $res = $object->queryAccountFund();
  45. \Log::info('$res');
  46. \Log::info($res);
  47. }
  48. }