挂钩:payment.gateway.config_schema
Last updated on Jun 24, 2026 01:54
## 概述
类型: 过滤器
位置: app/Http/Controllers/Api/V1/PaymentGatewayController.php
扩展或修改支付网关配置表单架构。用于将自定义字段添加到管理面板中的网关设置。
## 参数
| 参数 | 类型 | 描述 |
|---|---|---|
$schema |
array | 当前配置架构 |
$gateway |
object | 支付网关实例 |
## 返回
必须返回“数组”。
使用示例
Hook::addFilter('payment.gateway.config_schema', function ($schema, $gateway) {
if ($gateway->code === 'bank_transfer') {
$schema['branch_code'] = [
'type' => 'text',
'label' => 'Branch Code',
'required' => false,
];
}
return $schema;
});