Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Custom validation in custom payment method in admin

    Modules
    3
    4
    749
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Khushbu last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • sanjay-webkul
        sanjay-webkul last edited by

        @Khushbu said in Custom validation in custom payment method in admin:

        file

        Hi @Khushbu
        Which version of bagisto are you using?

        1 Reply Last reply Reply Quote 0
        • K
          Khushbu last edited by

          It's v1.3.2

          1 Reply Last reply Reply Quote 0
          • devansh-webkul
            devansh-webkul last edited by

            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#L10

            And 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

            1 Reply Last reply Reply Quote 0
            • First post
              Last post