Files
yuyin-php/extend/adapay_sdk_php_v1.4.4/tests/DrawcashTest.php

44 lines
1.3 KiB
PHP

<?php
use PHPUnit\Framework\TestCase;
class DrawcashTest extends TestCase
{
public function testCreate()
{
$adaPay = new AdaPay\AdaPay();
$adaPay->gateWayType = 'api';
$obj = new AdaPaySdk\Drawcash();
$obj_params = array(
'order_no'=> "CS_". date("YmdHis").rand(100000, 999999),
'app_id'=> 'app_7d87c043-aae3-4357-9b2c-269349a980d6',
'cash_type'=> 'T1',
'cash_amt'=> '0.02',
'member_id'=> 'user_00008',
'notify_url'=> ''
);
$obj->create($obj_params);
print("创建取现对象".$obj->isError().'=>'.json_encode($obj->result)."\n");
$this->assertEquals('succeeded', $obj->result['status']);
// $this->assertTrue($obj->isError());
}
public function testQuery()
{
$adaPay = new AdaPay\AdaPay();
$adaPay->gateWayType = 'api';
$obj = new AdaPaySdk\Drawcash();
$obj_params = array(
'order_no'=> "CS_20200720081844501083"
);
$obj->query($obj_params);
print("查询取现对象".$obj->isError().'=>'.json_encode($obj->result)."\n");
$this->assertEquals('succeeded', $obj->result['status']);
// $this->assertTrue($account->isError());
}
}