添加网站文件

This commit is contained in:
2025-12-22 13:59:40 +08:00
commit 117aaf83d1
19468 changed files with 2111999 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?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);
}
}