mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-23 18:44:26 +08:00
codex基础代码更新
This commit is contained in:
@@ -6,6 +6,7 @@ namespace app\common\contracts;
|
||||
|
||||
use app\exceptions\PaymentException;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
|
||||
/**
|
||||
* 支付插件接口
|
||||
@@ -81,4 +82,8 @@ interface PaymentInterface
|
||||
* @throws PaymentException 验签失败、数据异常等
|
||||
*/
|
||||
public function notify(Request $request): array;
|
||||
|
||||
public function notifySuccess(): string|Response;
|
||||
|
||||
public function notifyFail(): string|Response;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ use app\common\contracts\PaymentInterface;
|
||||
use app\exceptions\PaymentException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use Yansongda\Pay\Pay;
|
||||
use Yansongda\Supports\Collection;
|
||||
|
||||
@@ -267,4 +268,13 @@ class AlipayPayment extends BasePayment implements PaymentInterface
|
||||
throw new PaymentException('支付宝回调验签失败:' . $e->getMessage(), 402);
|
||||
}
|
||||
}
|
||||
public function notifySuccess(): string|Response
|
||||
{
|
||||
return 'success';
|
||||
}
|
||||
|
||||
public function notifyFail(): string|Response
|
||||
{
|
||||
return 'fail';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use app\common\base\BasePayment;
|
||||
use app\common\contracts\PaymentInterface;
|
||||
use app\exceptions\PaymentException;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
|
||||
/**
|
||||
* 拉卡拉支付插件(最小可用示例)
|
||||
@@ -74,5 +75,13 @@ class LakalaPayment extends BasePayment implements PaymentInterface
|
||||
{
|
||||
throw new PaymentException('LakalaPayment::notify 暂未实现', 402);
|
||||
}
|
||||
}
|
||||
public function notifySuccess(): string|Response
|
||||
{
|
||||
return 'success';
|
||||
}
|
||||
|
||||
public function notifyFail(): string|Response
|
||||
{
|
||||
return 'fail';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user