codenteq / iyzico-payment-gateway

The Laravel eCommerce Iyzico Payment Gateway
https://codenteq.com
MIT License
9 stars 5 forks source link

Call to a member function toArray() on null #5

Closed AlaaL closed 10 months ago

AlaaL commented 10 months ago

Hi, I am using bagisto 1.4.5 and your extension after checkout and payment in iyzico sandbox, i get this error in the image below

image

ahmetarsiv commented 10 months ago

Hello @AlaaL, with the release of Bagisto v2.0, some routes have been updated. You need to update the payment_methods line to paymentmethods in the src/Config/system.php file. The same process should be applied to src/Providers/IyzicoServiceProvider.php, where you need to update the payment_methods line to paymentmethods.

src/Config/system.php

$this->mergeConfigFrom(
   +    'key'    => 'sales.paymentmethods.iyzico',
   -      'key'    => 'sales.payment_methods.iyzico',
);

src/Providers/IyzicoServiceProvider.php

$this->mergeConfigFrom(
   +    dirname(__DIR__) . '/Config/paymentmethods.php', 'paymentmethods'
   -     dirname(__DIR__) . '/Config/paymentmethods.php', 'payment_methods'
);

This method will work with your Bagisto version.