DrawcashTest.php 1.3 KB

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