You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace Alipay\EasySDK\Test\payment\facetoface;
use Alipay\EasySDK\Kernel\Factory;
use Alipay\EasySDK\Test\TestAccount;
use PHPUnit\Framework\TestCase;
class ClientTest extends TestCase
{
public function __construct($name = null, array $data = [], $dataName = '')
{
parent::__construct($name, $data, $dataName);
$account = new TestAccount();
Factory::setOptions($account->getTestAccount());
}
public function testPay()
{
$create =Factory::payment()->common()->create("Iphone6 16G",
microtime(), "88.88", "2088002656718920");
$result = Factory::payment()->faceToFace()->pay("Iphone6 16G", $create->outTradeNo, "0.10",
"1234567890");
$this->assertEquals('40004', $result->code);
$this->assertEquals('Business Failed', $result->msg);
$this->assertEquals('ACQ.PAYMENT_AUTH_CODE_INVALID', $result->subCode);
$this->assertEquals('[SOUNDWAVE_PARSER_FAIL]', $result->subMsg);
}
public function testPrecreate(){
$create =Factory::payment()->common()->create("Iphone6 16G",
microtime(), "88.88", "2088002656718920");
$result = Factory::payment()->faceToFace()->precreate("Iphone6 16G", $create->outTradeNo, "0.10");
$this->assertEquals('10000', $result->code);
$this->assertEquals('Success', $result->msg);
}
}