mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-24 11:04:26 +08:00
重构初始化
This commit is contained in:
25
app/http/mer/validation/AuthValidator.php
Normal file
25
app/http/mer/validation/AuthValidator.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\mer\validation;
|
||||
|
||||
use support\validation\Validator;
|
||||
|
||||
/**
|
||||
* 商户登录参数校验器。
|
||||
*/
|
||||
class AuthValidator extends Validator
|
||||
{
|
||||
protected array $rules = [
|
||||
'merchant_no' => 'required|string|min:1|max:32',
|
||||
'password' => 'required|string|min:6|max:32',
|
||||
];
|
||||
|
||||
protected array $attributes = [
|
||||
'merchant_no' => '商户号',
|
||||
'password' => '登录密码',
|
||||
];
|
||||
|
||||
protected array $scenes = [
|
||||
'login' => ['merchant_no', 'password'],
|
||||
];
|
||||
}
|
||||
25
app/http/mer/validation/BalanceValidator.php
Normal file
25
app/http/mer/validation/BalanceValidator.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\mer\validation;
|
||||
|
||||
use support\validation\Validator;
|
||||
|
||||
/**
|
||||
* 商户余额查询参数校验器。
|
||||
*
|
||||
* 用于校验商户余额查询入参。
|
||||
*/
|
||||
class BalanceValidator extends Validator
|
||||
{
|
||||
protected array $rules = [
|
||||
'merchant_no' => 'required|string|min:1|max:64',
|
||||
];
|
||||
|
||||
protected array $attributes = [
|
||||
'merchant_no' => '商户号',
|
||||
];
|
||||
|
||||
protected array $scenes = [
|
||||
'show' => ['merchant_no'],
|
||||
];
|
||||
}
|
||||
60
app/http/mer/validation/MerchantPortalValidator.php
Normal file
60
app/http/mer/validation/MerchantPortalValidator.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\mer\validation;
|
||||
|
||||
use support\validation\Validator;
|
||||
|
||||
/**
|
||||
* 商户后台资料与安全页校验器。
|
||||
*/
|
||||
class MerchantPortalValidator extends Validator
|
||||
{
|
||||
protected array $rules = [
|
||||
'merchant_short_name' => 'sometimes|string|max:64',
|
||||
'contact_name' => 'sometimes|string|max:64',
|
||||
'contact_phone' => 'sometimes|string|max:32',
|
||||
'contact_email' => 'sometimes|email|max:128',
|
||||
'settlement_account_name' => 'sometimes|string|max:128',
|
||||
'settlement_account_no' => 'sometimes|string|max:128',
|
||||
'settlement_bank_name' => 'sometimes|string|max:128',
|
||||
'settlement_bank_branch' => 'sometimes|string|max:128',
|
||||
'current_password' => 'sometimes|string|min:6|max:32',
|
||||
'password' => 'sometimes|string|min:6|max:32',
|
||||
'password_confirm' => 'sometimes|string|min:6|max:32|same:password',
|
||||
'pay_type_id' => 'required|integer|min:1',
|
||||
'pay_amount' => 'required|integer|min:1',
|
||||
'stat_date' => 'sometimes|date',
|
||||
];
|
||||
|
||||
protected array $attributes = [
|
||||
'merchant_short_name' => '商户简称',
|
||||
'contact_name' => '联系人',
|
||||
'contact_phone' => '联系电话',
|
||||
'contact_email' => '联系邮箱',
|
||||
'settlement_account_name' => '结算账户名',
|
||||
'settlement_account_no' => '结算账号',
|
||||
'settlement_bank_name' => '开户行',
|
||||
'settlement_bank_branch' => '开户支行',
|
||||
'current_password' => '当前密码',
|
||||
'password' => '新密码',
|
||||
'password_confirm' => '确认密码',
|
||||
'pay_type_id' => '支付方式',
|
||||
'pay_amount' => '支付金额',
|
||||
'stat_date' => '统计日期',
|
||||
];
|
||||
|
||||
protected array $scenes = [
|
||||
'profileUpdate' => [
|
||||
'merchant_short_name',
|
||||
'contact_name',
|
||||
'contact_phone',
|
||||
'contact_email',
|
||||
'settlement_account_name',
|
||||
'settlement_account_no',
|
||||
'settlement_bank_name',
|
||||
'settlement_bank_branch',
|
||||
],
|
||||
'passwordUpdate' => ['current_password', 'password', 'password_confirm'],
|
||||
'routePreview' => ['pay_type_id', 'pay_amount', 'stat_date'],
|
||||
];
|
||||
}
|
||||
39
app/http/mer/validation/PayOrderValidator.php
Normal file
39
app/http/mer/validation/PayOrderValidator.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\mer\validation;
|
||||
|
||||
use support\validation\Validator;
|
||||
|
||||
/**
|
||||
* 支付订单列表参数校验器。
|
||||
*
|
||||
* 仅供商户后台使用。
|
||||
*/
|
||||
class PayOrderValidator extends Validator
|
||||
{
|
||||
protected array $rules = [
|
||||
'keyword' => 'sometimes|string|max:128',
|
||||
'merchant_id' => 'sometimes|integer|min:1',
|
||||
'pay_type_id' => 'sometimes|integer|min:1',
|
||||
'status' => 'sometimes|integer|in:0,1,2,3,4,5',
|
||||
'channel_mode' => 'sometimes|integer|in:0,1',
|
||||
'callback_status' => 'sometimes|integer|in:0,1,2',
|
||||
'page' => 'sometimes|integer|min:1',
|
||||
'page_size' => 'sometimes|integer|min:1|max:100',
|
||||
];
|
||||
|
||||
protected array $attributes = [
|
||||
'keyword' => '关键字',
|
||||
'merchant_id' => '商户ID',
|
||||
'pay_type_id' => '支付方式',
|
||||
'status' => '状态',
|
||||
'channel_mode' => '通道模式',
|
||||
'callback_status' => '回调状态',
|
||||
'page' => '页码',
|
||||
'page_size' => '每页条数',
|
||||
];
|
||||
|
||||
protected array $scenes = [
|
||||
'index' => ['keyword', 'merchant_id', 'pay_type_id', 'status', 'channel_mode', 'callback_status', 'page', 'page_size'],
|
||||
];
|
||||
}
|
||||
36
app/http/mer/validation/RefundActionValidator.php
Normal file
36
app/http/mer/validation/RefundActionValidator.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\mer\validation;
|
||||
|
||||
use support\validation\Validator;
|
||||
|
||||
/**
|
||||
* 退款操作参数校验器。
|
||||
*
|
||||
* 仅供商户后台的退款重试等操作使用。
|
||||
*/
|
||||
class RefundActionValidator extends Validator
|
||||
{
|
||||
protected array $rules = [
|
||||
'refund_no' => 'required|string|max:64',
|
||||
'processing_at' => 'sometimes|date_format:Y-m-d H:i:s',
|
||||
'failed_at' => 'sometimes|date_format:Y-m-d H:i:s',
|
||||
'last_error' => 'sometimes|string|max:512',
|
||||
'channel_refund_no' => 'sometimes|string|max:64',
|
||||
];
|
||||
|
||||
protected array $attributes = [
|
||||
'refund_no' => '退款单号',
|
||||
'processing_at' => '处理时间',
|
||||
'failed_at' => '失败时间',
|
||||
'last_error' => '错误信息',
|
||||
'channel_refund_no' => '渠道退款单号',
|
||||
];
|
||||
|
||||
protected array $scenes = [
|
||||
'retry' => ['refund_no', 'processing_at'],
|
||||
'mark_fail' => ['refund_no', 'failed_at', 'last_error'],
|
||||
'mark_processing' => ['refund_no', 'processing_at'],
|
||||
'mark_success' => ['refund_no', 'channel_refund_no'],
|
||||
];
|
||||
}
|
||||
37
app/http/mer/validation/RefundOrderValidator.php
Normal file
37
app/http/mer/validation/RefundOrderValidator.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\mer\validation;
|
||||
|
||||
use support\validation\Validator;
|
||||
|
||||
/**
|
||||
* 退款订单列表参数校验器。
|
||||
*
|
||||
* 仅供商户后台使用。
|
||||
*/
|
||||
class RefundOrderValidator extends Validator
|
||||
{
|
||||
protected array $rules = [
|
||||
'keyword' => 'sometimes|string|max:128',
|
||||
'merchant_id' => 'sometimes|integer|min:1',
|
||||
'pay_type_id' => 'sometimes|integer|min:1',
|
||||
'status' => 'sometimes|integer|in:0,1,2,3,4',
|
||||
'channel_mode' => 'sometimes|integer|in:0,1',
|
||||
'page' => 'sometimes|integer|min:1',
|
||||
'page_size' => 'sometimes|integer|min:1|max:100',
|
||||
];
|
||||
|
||||
protected array $attributes = [
|
||||
'keyword' => '关键字',
|
||||
'merchant_id' => '商户ID',
|
||||
'pay_type_id' => '支付方式',
|
||||
'status' => '退款状态',
|
||||
'channel_mode' => '通道模式',
|
||||
'page' => '页码',
|
||||
'page_size' => '每页条数',
|
||||
];
|
||||
|
||||
protected array $scenes = [
|
||||
'index' => ['keyword', 'merchant_id', 'pay_type_id', 'status', 'channel_mode', 'page', 'page_size'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user