mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-14 22:14:28 +08:00
1. 完善易支付API调用全流程
2. 确定支付插件继承基础类和接口规范 3. 引入Yansongda\Pay支付快捷工具 4. 重新整理代码和功能结构
This commit is contained in:
25
app/exceptions/PaymentException.php
Normal file
25
app/exceptions/PaymentException.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace app\exceptions;
|
||||
|
||||
use Webman\Exception\BusinessException;
|
||||
|
||||
/**
|
||||
* 支付业务异常
|
||||
*
|
||||
* 用于支付相关业务错误,如:下单失败、退款失败、验签失败、渠道异常等。
|
||||
*
|
||||
* 示例:
|
||||
* throw new PaymentException('当前环境无可用支付产品');
|
||||
* throw new PaymentException('渠道返回错误', 402, ['channel_code' => 'lakala']);
|
||||
*/
|
||||
class PaymentException extends BusinessException
|
||||
{
|
||||
public function __construct(string $message = '支付业务异常', int $bizCode = 402, array $data = [])
|
||||
{
|
||||
parent::__construct($message, $bizCode);
|
||||
if (!empty($data)) {
|
||||
$this->data($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user