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

The magic method Instamojo\Instamojo::__wakeup() must have public visibility #65

Open
karthick003 opened this issue Jul 30, 2022 · 2 comments

Comments

@karthick003
Copy link

i am trying to integrate in laravel 9 ,php version 8.1.0.
i have installed the wrapper through composer require instamojo/instamojo-php
then in controller
public function pay(Request $request){

 $api = new \Instamojo\Instamojo(
        config('services.instamojo.api_key'),
        config('services.instamojo.auth_token'),
        config('services.instamojo.url')
    );

try {
    $response = $api->paymentRequestCreate(array(
        "purpose" => "FIFA 16",
        "amount" => $request->amount,
        "buyer_name" => "$request->name",
        "send_email" => true,
        "email" => "$request->email",
        "phone" => "$request->mobile_number",
        "redirect_url" => "http://127.0.0.1:8000/pay-success"
        ));
        
        header('Location: ' . $response['longurl']);
        exit();
}catch (Exception $e) {
    print('Error: ' . $e->getMessage());
}

}

after the running the project getting error : The magic method Instamojo\Instamojo::__wakeup() must have public visibility
Screenshot_1

@Bhavesh-kapoor
Copy link

Go to your vendor/instmoja/instmoja-php/src/instamozo.php and make it public from private
as like this public function __wakeup() {}

@Karthik-hebbar
Copy link

Go to your vendor/instmoja/instmoja-php/src/instamozo.php and make it public from private as like this public function __wakeup() {}

i am also stuck with the error but it is private for a reason(i don't know why) right, and also, i think manually changing things in vendor folder is bad habit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants