Closed yavand closed 4 years ago
hi, what kind of error happened in your project? copy and paste your error here.
i got it. in new major update we have changed the payment.php
configs. please remove your payment configs from config/payment.php
and re-publish it using php artisan vendor:publish
command.
in your config/payment.php
you will see new gateway drivers and configs.
enjoy it.
hi, I updated my payment.php
file according to your comment, but error still persist.
Shetabit \ Payment \ Exceptions \ DriverNotFoundException Driver source not found. Please update the package.
protected function validateDriver()
{
if (empty($this->driver)) {
throw new DriverNotFoundException('Driver not selected or default driver does not exist.');
}
if (empty($this->config['drivers'][$this->driver]) || empty($this->config['map'][$this->driver])) {
throw new DriverNotFoundException('Driver not found in config file. Try updating the package.');
}
if (!class_exists($this->config['map'][$this->driver])) {
throw new DriverNotFoundException('Driver source not found. Please update the package.');
}
$reflect = new \ReflectionClass($this->config['map'][$this->driver]);
if (!$reflect->implementsInterface(DriverInterface::class)) {
throw new \Exception("Driver must be an instance of Contracts\DriverInterface.");
}
}
please send map
section from your config/payment.php
here.
it must be like the below:
'map' => [
'asanpardakht' => \Shetabit\Payment\Drivers\Asanpardakht\Asanpardakht::class,
'behpardakht' => \Shetabit\Payment\Drivers\Behpardakht\Behpardakht::class,
'idpay' => \Shetabit\Payment\Drivers\Idpay\Idpay::class,
'irankish' => \Shetabit\Payment\Drivers\Irankish\Irankish::class,
'nextpay' => \Shetabit\Payment\Drivers\Nextpay\Nextpay::class,
'parsian' => \Shetabit\Payment\Drivers\Parsian\Parsian::class,
'payir' => \Shetabit\Payment\Drivers\Payir\Payir::class,
'payping' => \Shetabit\Payment\Drivers\Payping\Payping::class,
'paystar' => \Shetabit\Payment\Drivers\Paystar\Paystar::class,
'poolam' => \Shetabit\Payment\Drivers\Poolam\Poolam::class,
'sadad' => \Shetabit\Payment\Drivers\Sadad\Sadad::class,
'saman' => \Shetabit\Payment\Drivers\Saman\Saman::class,
'yekpay' => \Shetabit\Payment\Drivers\Yekpay\Yekpay::class,
'zarinpal' => \Shetabit\Payment\Drivers\Zarinpal\Zarinpal::class,
]
is it the same ?
map section of config/payment.php
'map' => [
'zarinpal' => \Shetabit\Payment\Drivers\Zarinpal::class,
'irankish' => \Shetabit\Payment\Drivers\Irankish::class,
'saman' => \Shetabit\Payment\Drivers\Saman::class,
]
package version: "shetabit/payment": "^1.1"
ok. remove the payment.php
and re publish it as i told you.
publish it by running : php artisan vendor:publish
or update package to 2.1.2
. remove the package and install it again.
composer remove shetabit/payment
composer require shetabit/payment
For persian users:
Hi, I use this package to handle my payments using zaripal gateway. I got this error recently while I didn't make any changes in my codebase. please help me why this exception was happened? Thanks.