This commit is contained in:
36
app/Service/Test/Adapter/Pay/WechatPayAdapter.php
Normal file
36
app/Service/Test/Adapter/Pay/WechatPayAdapter.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
* @web_site https://ctexthuang.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Test\Adapter\Pay;
|
||||
|
||||
use App\Interface\Test\Adapter\PaymentGateway;
|
||||
|
||||
class WechatPayAdapter implements PaymentGateway
|
||||
{
|
||||
/**
|
||||
* @var WechatPayService
|
||||
*/
|
||||
private WechatPayService $wechatPay;
|
||||
|
||||
public function __construct(WechatPayService $wechatPay)
|
||||
{
|
||||
$this->wechatPay = $wechatPay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $amount
|
||||
* @return array
|
||||
*/
|
||||
public function pay(float $amount): array
|
||||
{
|
||||
return $this->wechatPay->makePayment($amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user