mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-02 04:08:21 +08:00
update
This commit is contained in:
parent
f78d464342
commit
737b226daa
@ -30,7 +30,7 @@ abstract class AbstractProvider implements ProviderInterface
|
|||||||
*
|
*
|
||||||
* @return \Yansongda\Supports\Collection|\Psr\Http\Message\ResponseInterface
|
* @return \Yansongda\Supports\Collection|\Psr\Http\Message\ResponseInterface
|
||||||
*/
|
*/
|
||||||
public function call(string $plugin, array $params)
|
public function call(string $plugin, array $params = [])
|
||||||
{
|
{
|
||||||
if (!class_exists($plugin) || !in_array(ShortcutInterface::class, class_implements($plugin))) {
|
if (!class_exists($plugin) || !in_array(ShortcutInterface::class, class_implements($plugin))) {
|
||||||
throw new InvalidParamsException(InvalidParamsException::SHORTCUT_NOT_FOUND, "[$plugin] is not incompatible");
|
throw new InvalidParamsException(InvalidParamsException::SHORTCUT_NOT_FOUND, "[$plugin] is not incompatible");
|
||||||
@ -42,8 +42,7 @@ abstract class AbstractProvider implements ProviderInterface
|
|||||||
$money = Pay::get($plugin);
|
$money = Pay::get($plugin);
|
||||||
|
|
||||||
return $this->pay(
|
return $this->pay(
|
||||||
$this->mergeCommonPlugins($money->getPlugins(...$params)),
|
$this->mergeCommonPlugins($money->getPlugins($params)), $params
|
||||||
...$params
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,28 +110,39 @@ class FooProviderStub extends AbstractProvider
|
|||||||
{
|
{
|
||||||
public function find($order): Collection
|
public function find($order): Collection
|
||||||
{
|
{
|
||||||
|
return new Collection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel($order): Collection
|
public function cancel($order): Collection
|
||||||
{
|
{
|
||||||
|
return new Collection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function close($order): Collection
|
public function close($order): Collection
|
||||||
{
|
{
|
||||||
|
return new Collection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function refund(array $order): Collection
|
public function refund(array $order): Collection
|
||||||
{
|
{
|
||||||
|
return new Collection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function verify($contents = null, ?array $params = null): Collection
|
public function verify($contents = null, ?array $params = null): Collection
|
||||||
{
|
{
|
||||||
|
return new Collection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function success(): ResponseInterface
|
public function success(): ResponseInterface
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function mergeCommonPlugins(array $plugins): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FooPlugin implements PluginInterface
|
class FooPlugin implements PluginInterface
|
||||||
{
|
{
|
||||||
public function assembly(Rocket $rocket, Closure $next): Rocket
|
public function assembly(Rocket $rocket, Closure $next): Rocket
|
||||||
|
Loading…
Reference in New Issue
Block a user