AccountTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. class AccountTest extends TestCase
  4. {
  5. // public function testOne()
  6. // {
  7. // $this->assertTrue(false);
  8. // }
  9. public function testPayment()
  10. {
  11. // 查询账户余额
  12. $adaPay = new AdaPay\AdaPay();
  13. $adaPay->gateWayType = 'page';
  14. $obj = new AdaPaySdk\Account();
  15. $account_params = array(
  16. # 商户的应用 id
  17. 'app_id'=> 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
  18. # 用户ID
  19. 'order_no'=> "WL_". date("YmdHis").rand(100000, 999999),
  20. # 订单总金额(必须大于0)
  21. 'pay_amt'=> '0.10',
  22. # 3 位 ISO 货币代码,小写字母
  23. 'currency'=> 'cny',
  24. # 商品标题
  25. 'goods_title'=> '12314',
  26. # 商品描述信息
  27. 'goods_desc'=> '123122123',
  28. );
  29. $obj->payment($account_params);
  30. // var_dump($account->result);
  31. print($obj->isError().'=>'.json_encode($obj->result));
  32. $this->assertEquals('succeeded', $obj->result['status']);
  33. // $this->assertTrue($account->isError());
  34. }
  35. }