• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

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

Undefined array key "sort"

Bug Report
4
6
438
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.
  • B
    babarali last edited by 18 Jan 2024, 06:29

    whenever i add a custom payment method in bagisto2 it return "Undefined array key "sort"". i follow the proper procedure that mentioned in bagisto documentation.
    doc link given below
    https://devdocs.bagisto.com/2.x/advanced/create-payment-method.html#introductioner.png

    michal.webixa 1 Reply Last reply 18 Jan 2024, 08:48 Reply Quote 0
    • michal.webixa
      michal.webixa @babarali last edited by 18 Jan 2024, 08:48

      @babarali Could you show us content of your config files?

      1 Reply Last reply Reply Quote 0
      • B
        babarali last edited by 18 Jan 2024, 10:13

        <?php

        return [
        [
        'key' => 'sales.paymentmethods.paymob',
        'name' => 'Paymob',
        'sort' => 1,
        'fields' => [
        [
        'name' => 'title',
        'title' => 'admin::app.admin.system.title',
        'type' => 'text',
        'validation' => 'required',
        'channel_based' => false,
        'locale_based' => true,
        ],
        [
        'name' => 'description',
        'title' => 'admin::app.admin.system.description',
        'type' => 'textarea',
        'channel_based' => false,
        'locale_based' => true,
        ],
        [
        'name' => 'public-key',
        'title' => 'paymob::app.admin.system.public-key',
        'type' => 'text',
        'validation' => 'required',
        'channel_based' => false,
        'locale_based' => true,
        ],
        [
        'name' => 'secret-key',
        'title' => 'paymob::app.admin.system.secret-key',
        'type' => 'text',
        'validation' => 'required',
        'channel_based' => false,
        'locale_based' => true,
        ],
        [
        'name' => 'integration-ids',
        'title' => 'paymob::app.admin.system.integration-ids',
        'type' => 'text',
        'validation' => 'required',
        'channel_based' => false,
        'locale_based' => true,
        'info' => 'Add the Payment methods ID(s) that exist in Paymob account separated by comma , separator. (Example: 123456,98765,45678)'
        ],
        [
        'name' => 'hmac',
        'title' => 'paymob::app.admin.system.hmac',
        'type' => 'text',
        'validation' => 'required',
        'channel_based' => false,
        'locale_based' => true
        ],
        [
        'name' => 'paymobcallback',
        'title' => 'paymob::app.admin.system.callback-url',
        'type' => 'text',
        'validation' => 'required',
        'channel_based' => false,
        'locale_based' => true,
        'default' => config('app.url') . '/paymob/callback',
        'info' => 'Please add above URL in Paymob Merchant account for both callback and response URLs Settings for each payment method.'

                ],
                [
                    'name' => 'debug-log',
                    'title' => 'paymob::app.admin.system.debug-log',
                    'type' => 'boolean',
                    'channel_based' => false,
                    'locale_based' => true,
                    'info' => 'Log file will be saved in ' . storage_path() . '/logs/'
                ],
                [
                    'name' => 'active',
                    'title' => 'paymob::app.admin.system.paymobstatus',
                    'type' => 'boolean',
                    'validation' => 'required',
                    'channel_based' => false,
                    'locale_based' => true
                ],
                [
                    'name' => 'sort',
                    'title' => 'Sort Order',
                    'type' => 'select',
                    'options' => [
                        [
                            'title' => '1',
                            'value' => 1,
                        ],
                        [
                            'title' => '2',
                            'value' => 2,
                        ],
                        [
                            'title' => '3',
                            'value' => 3,
                        ],
                        [
                            'title' => '4',
                            'value' => 4,
                        ],
                        [
                            'title' => '5',
                            'value' => 5,
                        ],
                    ],
                ],
            ]
        ]
        

        ];

        @michal-webixa This working fine in bagisto1.x but in bagisto2.x return the error that I mentioned above.

        ashish2409 1 Reply Last reply 6 Feb 2024, 06:33 Reply Quote 0
        • 19 days later
        • ashish2409
          ashish2409 @babarali last edited by 6 Feb 2024, 06:33

          @babarali

          Hello There,

          Please add sort key number 5 as Sort Key 1-4 are already being used in Bagisto Payment Methods. We are also updating our Documentation so that such issue does not appear.
          Really appreciated for your query.

          I hope this will help to resolve your query.

          M 1 Reply Last reply 12 Mar 2024, 19:43 Reply Quote 0
          • about a month later
          • M
            mrvx @ashish2409 last edited by 12 Mar 2024, 19:43

            @ashish2409 Same problem here.
            I added custom payment method, but gives Undefined array key "sort". I tried to switch different numbers in key sort.

            M 1 Reply Last reply 12 Mar 2024, 19:51 Reply Quote 0
            • M
              mrvx @mrvx last edited by 12 Mar 2024, 19:51

              @mrvx this is my code ?php

              return [
              [
              'key' => 'sales.paymentmethods.everypay',
              'name' => 'Everypay',
              'sort' => 5,
              'fields' => [
              [
              'name' => 'title',
              'title' => 'admin::app.admin.system.title',
              'type' => 'text',
              'validation' => 'required',
              'channel_based' => false,
              'locale_based' => true,
              ], [
              'name' => 'description',
              'title' => 'admin::app.admin.system.description',
              'type' => 'textarea',
              'channel_based' => false,
              'locale_based' => true,
              ], [
              'name' => 'active',
              'title' => 'admin::app.admin.system.status',
              'type' => 'boolean',
              'validation' => 'required',
              'channel_based' => false,
              'locale_based' => true,
              ]
              ]
              ]
              ];

              1 Reply Last reply Reply Quote 0
              4 out of 6
              • First post
                4/6
                Last post