DrawcashTest.php 1.2 KB

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