feat : Bridge pay
This commit is contained in:
45
app/Service/Test/Bridge/Pay/Lib/AlipayPayment.php
Normal file
45
app/Service/Test/Bridge/Pay/Lib/AlipayPayment.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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\Bridge\Pay\Lib;
|
||||
|
||||
use App\Interface\Test\Bridge\PaymentInterface;
|
||||
|
||||
class AlipayPayment implements PaymentInterface
|
||||
{
|
||||
/**
|
||||
* @param float $amount
|
||||
* @return array
|
||||
*/
|
||||
public function pay(float $amount): array
|
||||
{
|
||||
return [
|
||||
'type' => 'pay',
|
||||
'price' => $amount,
|
||||
'pay_type' => 'alipay',
|
||||
'msg' => 'Processing credit card payment of ' . $amount . PHP_EOL,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $amount
|
||||
* @return array
|
||||
*/
|
||||
public function refund(float $amount): array
|
||||
{
|
||||
return [
|
||||
'type' => 'refund',
|
||||
'price' => $amount,
|
||||
'pay_type' => 'alipay',
|
||||
'msg' => 'Processing credit card refund of ' . $amount . PHP_EOL,
|
||||
];
|
||||
}
|
||||
}
|
||||
45
app/Service/Test/Bridge/Pay/Lib/CreditCardPayment.php
Normal file
45
app/Service/Test/Bridge/Pay/Lib/CreditCardPayment.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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\Bridge\Pay\Lib;
|
||||
|
||||
use App\Interface\Test\Bridge\PaymentInterface;
|
||||
|
||||
class CreditCardPayment implements PaymentInterface
|
||||
{
|
||||
/**
|
||||
* @param float $amount
|
||||
* @return array
|
||||
*/
|
||||
public function pay(float $amount): array
|
||||
{
|
||||
return [
|
||||
'type' => 'pay',
|
||||
'price' => $amount,
|
||||
'pay_type' => 'credit_card',
|
||||
'msg' => 'Processing credit card payment of ' . $amount . PHP_EOL,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $amount
|
||||
* @return array
|
||||
*/
|
||||
public function refund(float $amount): array
|
||||
{
|
||||
return [
|
||||
'type' => 'refund',
|
||||
'price' => $amount,
|
||||
'pay_type' => 'credit_card',
|
||||
'msg' => 'Processing credit card refund of ' . $amount . PHP_EOL,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user