first commit
This commit is contained in:
22
vendor/yansongda/pay/src/Contract/ConfigInterface.php
vendored
Normal file
22
vendor/yansongda/pay/src/Contract/ConfigInterface.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
interface ConfigInterface
|
||||
{
|
||||
/**
|
||||
* @param mixed $default default value of the entry when does not found
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get(string $key, $default = null);
|
||||
|
||||
public function has(string $key): bool;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function set(string $key, $value);
|
||||
}
|
||||
12
vendor/yansongda/pay/src/Contract/ContainerInterface.php
vendored
Normal file
12
vendor/yansongda/pay/src/Contract/ContainerInterface.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
use DI\FactoryInterface;
|
||||
use Invoker\InvokerInterface;
|
||||
|
||||
interface ContainerInterface extends \Psr\Container\ContainerInterface, FactoryInterface, InvokerInterface
|
||||
{
|
||||
}
|
||||
9
vendor/yansongda/pay/src/Contract/EventDispatcherInterface.php
vendored
Normal file
9
vendor/yansongda/pay/src/Contract/EventDispatcherInterface.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
interface EventDispatcherInterface extends \Psr\EventDispatcher\EventDispatcherInterface
|
||||
{
|
||||
}
|
||||
11
vendor/yansongda/pay/src/Contract/HttpClientInterface.php
vendored
Normal file
11
vendor/yansongda/pay/src/Contract/HttpClientInterface.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
use GuzzleHttp\ClientInterface;
|
||||
|
||||
interface HttpClientInterface extends ClientInterface, \Psr\Http\Client\ClientInterface
|
||||
{
|
||||
}
|
||||
9
vendor/yansongda/pay/src/Contract/LoggerInterface.php
vendored
Normal file
9
vendor/yansongda/pay/src/Contract/LoggerInterface.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
interface LoggerInterface extends \Psr\Log\LoggerInterface
|
||||
{
|
||||
}
|
||||
15
vendor/yansongda/pay/src/Contract/ParserInterface.php
vendored
Normal file
15
vendor/yansongda/pay/src/Contract/ParserInterface.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
interface ParserInterface
|
||||
{
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function parse(?ResponseInterface $response);
|
||||
}
|
||||
13
vendor/yansongda/pay/src/Contract/PluginInterface.php
vendored
Normal file
13
vendor/yansongda/pay/src/Contract/PluginInterface.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
use Closure;
|
||||
use Yansongda\Pay\Rocket;
|
||||
|
||||
interface PluginInterface
|
||||
{
|
||||
public function assembly(Rocket $rocket, Closure $next): Rocket;
|
||||
}
|
||||
69
vendor/yansongda/pay/src/Contract/ProviderInterface.php
vendored
Normal file
69
vendor/yansongda/pay/src/Contract/ProviderInterface.php
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Yansongda\Supports\Collection;
|
||||
|
||||
interface ProviderInterface
|
||||
{
|
||||
/**
|
||||
* pay.
|
||||
*
|
||||
* @throws \Yansongda\Pay\Exception\ContainerDependencyException
|
||||
* @throws \Yansongda\Pay\Exception\ContainerException
|
||||
* @throws \Yansongda\Pay\Exception\InvalidParamsException
|
||||
* @throws \Yansongda\Pay\Exception\ServiceNotFoundException
|
||||
*
|
||||
* @return \Psr\Http\Message\MessageInterface|\Yansongda\Supports\Collection|array|null
|
||||
*/
|
||||
public function pay(array $plugins, array $params);
|
||||
|
||||
/**
|
||||
* Quick road - Query an order.
|
||||
*
|
||||
* @param string|array $order
|
||||
*
|
||||
* @return array|\Yansongda\Supports\Collection
|
||||
*/
|
||||
public function find($order);
|
||||
|
||||
/**
|
||||
* Quick road - Cancel an order.
|
||||
*
|
||||
* @param string|array $order
|
||||
*
|
||||
* @return array|\Yansongda\Supports\Collection|void
|
||||
*/
|
||||
public function cancel($order);
|
||||
|
||||
/**
|
||||
* Quick road - Close an order.
|
||||
*
|
||||
* @param string|array $order
|
||||
*
|
||||
* @return array|\Yansongda\Supports\Collection|void
|
||||
*/
|
||||
public function close($order);
|
||||
|
||||
/**
|
||||
* Quick road - Refund an order.
|
||||
*
|
||||
* @return array|\Yansongda\Supports\Collection
|
||||
*/
|
||||
public function refund(array $order);
|
||||
|
||||
/**
|
||||
* Verify a request.
|
||||
*
|
||||
* @param array|\Psr\Http\Message\ServerRequestInterface|null $contents
|
||||
*/
|
||||
public function callback($contents = null, ?array $params = null): Collection;
|
||||
|
||||
/**
|
||||
* Echo success to server.
|
||||
*/
|
||||
public function success(): ResponseInterface;
|
||||
}
|
||||
15
vendor/yansongda/pay/src/Contract/ServiceProviderInterface.php
vendored
Normal file
15
vendor/yansongda/pay/src/Contract/ServiceProviderInterface.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
use Yansongda\Pay\Pay;
|
||||
|
||||
interface ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* register the service.
|
||||
*/
|
||||
public function register(Pay $pay, ?array $data = null): void;
|
||||
}
|
||||
13
vendor/yansongda/pay/src/Contract/ShortcutInterface.php
vendored
Normal file
13
vendor/yansongda/pay/src/Contract/ShortcutInterface.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Contract;
|
||||
|
||||
interface ShortcutInterface
|
||||
{
|
||||
/**
|
||||
* @return \Yansongda\Pay\Contract\PluginInterface[]|string[]
|
||||
*/
|
||||
public function getPlugins(array $params): array;
|
||||
}
|
||||
Reference in New Issue
Block a user