Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver source not found. Please update the package #31

Closed
yavand opened this issue Dec 23, 2019 · 8 comments
Closed

Driver source not found. Please update the package #31

yavand opened this issue Dec 23, 2019 · 8 comments
Labels
invalid This doesn't seem right

Comments

@yavand
Copy link

yavand commented Dec 23, 2019

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.

@khanzadimahdi
Copy link
Member

hi, what kind of error happened in your project? copy and paste your error here.

@khanzadimahdi
Copy link
Member

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.

@khanzadimahdi
Copy link
Member

in your config/payment.php you will see new gateway drivers and configs.
enjoy it.

@khanzadimahdi khanzadimahdi pinned this issue Dec 24, 2019
@yavand
Copy link
Author

yavand commented Dec 24, 2019

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.");
        }
    }

@khanzadimahdi
Copy link
Member

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 ?

@khanzadimahdi khanzadimahdi added the invalid This doesn't seem right label Dec 24, 2019
@yavand
Copy link
Author

yavand commented Dec 24, 2019

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"

@khanzadimahdi
Copy link
Member

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.

  • step1: composer remove shetabit/payment
  • step2: composer require shetabit/payment

@khanzadimahdi
Copy link
Member

For persian users:

اگه پکیج رو قبلا استفاده میکردین و الان اپدیت کردین فایل config/payment.php رو پاک کنید و بعدش وندور پابلیش بزنید درست میشه. به دلیل این هست که فایل کانفیگ توی ورژن جدید ساختارش تغییر کرده و هنوز پابلیش نکردین.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants