Undefined array key "sort"
-
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#introduction -
@babarali Could you show us content of your config files?
-
<?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.
-
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.
-
@ashish2409 Same problem here.
I added custom payment method, but gives Undefined array key "sort". I tried to switch different numbers in key sort. -
@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,
]
]
]
];