DrawcashTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\api\controller\tests;
  3. use AdaPay;
  4. use AdaPaySdk;
  5. use PHPUnit\Framework\TestCase;
  6. class DrawcashTest extends TestCase
  7. {
  8. public function testCreate()
  9. {
  10. $adaPay = new AdaPay\AdaPay();
  11. $adaPay->gateWayType = 'api';
  12. $obj = new AdaPaySdk\Drawcash();
  13. $obj_params = array(
  14. 'order_no' => "CS_" . date("YmdHis") . rand(100000, 999999),
  15. 'app_id' => 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
  16. 'cash_type' => 'T1',
  17. 'cash_amt' => '0.02',
  18. 'member_id' => 'user_00008',
  19. 'notify_url' => ''
  20. );
  21. $obj->create($obj_params);
  22. print("创建取现对象" . $obj->isError() . '=>' . json_encode($obj->result) . "\n");
  23. $this->assertEquals('succeeded', $obj->result['status']);
  24. // $this->assertTrue($obj->isError());
  25. }
  26. public function testQuery()
  27. {
  28. $adaPay = new AdaPay\AdaPay();
  29. $adaPay->gateWayType = 'api';
  30. $obj = new AdaPaySdk\Drawcash();
  31. $obj_params = array(
  32. 'order_no' => "CS_20200720081844501083"
  33. );
  34. $obj->query($obj_params);
  35. print("查询取现对象" . $obj->isError() . '=>' . json_encode($obj->result) . "\n");
  36. $this->assertEquals('succeeded', $obj->result['status']);
  37. // $this->assertTrue($account->isError());
  38. }
  39. }