Files

41 lines
1.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use PHPUnit\Framework\TestCase;
class AccountTest extends TestCase
{
// public function testOne()
// {
// $this->assertTrue(false);
// }
public function testPayment()
{
// 查询账户余额
$adaPay = new AdaPay\AdaPay();
$adaPay->gateWayType = 'page';
$obj = new AdaPaySdk\Account();
$account_params = array(
# 商户的应用 id
'app_id'=> 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
# 用户ID
'order_no'=> "WL_". date("YmdHis").rand(100000, 999999),
# 订单总金额必须大于0
'pay_amt'=> '0.10',
# 3 位 ISO 货币代码,小写字母
'currency'=> 'cny',
# 商品标题
'goods_title'=> '12314',
# 商品描述信息
'goods_desc'=> '123122123',
);
$obj->payment($account_params);
// var_dump($account->result);
print($obj->isError().'=>'.json_encode($obj->result));
$this->assertEquals('succeeded', $obj->result['status']);
// $this->assertTrue($account->isError());
}
}