SettleAccountTransferTest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\api\controller\tests;
  3. use AdaPay;
  4. use PHPUnit\Framework\TestCase;
  5. class SettleAccountTestTransferTest extends TestCase
  6. {
  7. public function testCreate()
  8. {
  9. $adaPay = new AdaPay\AdaPay();
  10. $adaPay->gateWayType = 'api';
  11. $obj = new \AdaPaySdk\SettleAccountTransfer();
  12. $obj_params = array(
  13. 'app_id' => 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
  14. 'order_no' => "TF_" . date("YmdHis") . rand(100000, 999999),
  15. 'trans_amt' => '0.10',
  16. 'out_member_id' => '0',
  17. 'in_member_id' => 'user_000031'
  18. );
  19. $obj->create($obj_params);
  20. print("创建结算交易账户" . $obj->isError() . '=>' . json_encode($obj->result) . "\n");
  21. $this->assertEquals('succeeded', $obj->result['status']);
  22. }
  23. public function testQueryList()
  24. {
  25. $adaPay = new AdaPay\AdaPay();
  26. $adaPay->gateWayType = 'api';
  27. $obj = new \AdaPaySdk\SettleAccountTransfer();
  28. $obj_params = array(
  29. 'app_id' => 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
  30. 'order_no' => '',
  31. 'status' => '',
  32. 'page_index' => '1',
  33. 'page_size' => '10',
  34. 'created_gte' => '',
  35. 'created_lte' => ''
  36. );
  37. $obj->queryList($obj_params);
  38. print("查询结算交易账户" . $obj->isError() . '=>' . json_encode($obj->result) . "\n");
  39. $this->assertEquals('succeeded', $obj->result['status']);
  40. // $this->assertTrue($account->isError());
  41. }
  42. }