Custom validation in custom payment method in admin
-
I am creating custom payment method for which i want to use custom validator in system.php file. Below is example code.
'name' => 'field2', 'title' => 'custompay::app.admin.system.field2', 'type' => 'file', 'validation' => 'CustomRuleClass', 'channel_based' => false, 'locale_based' => true,
Here CustomRuleClass is Rule class i have created in my new package folder. How can i use it system.php file for validation?
-
@Khushbu said in Custom validation in custom payment method in admin:
file
Hi @Khushbu
Which version of bagisto are you using? -
It's v1.3.2
-
Hi @Khushbu,
I can only suggest you the path on this so that you will get an idea of how the actual configuration works.
Now, this is the place where validations are fetching,
https://github.com/bagisto/bagisto/blob/2dbb988388bc480af4bc8e880caed500772cfbc7/packages/Webkul/Admin/src/Resources/views/configuration/field-type.blade.php#L10And these validations are bound with Vue validations. So you need to handle this also.
And this is the method which you can override,
https://github.com/bagisto/bagisto/blob/2dbb988388bc480af4bc8e880caed500772cfbc7/packages/Webkul/Core/src/Traits/CoreConfigField.php#L32