shetabit / payment

simple laravel payment package , supports multiple drivers
MIT License
833 stars 141 forks source link

Call to undefined method Illuminate\\View\\Compilers\\BladeCompiler::render() #289

Closed salvatormundiz closed 7 months ago

salvatormundiz commented 1 year ago

"Angular/framework": "15" "laravel/framework": "^7.0", "shetabit/payment": "^4.1",

this is my controller:

     try {
            $price = Meeting_fee::where("doctor_id", $request->DrId)->first();
            $price = $price->price;

            $invoice = new Invoice();
            $invoice->amount($price);
            $invoice->detail("detail", "هزینه جلسه مشاوره");

            $user = Auth::user();
            $paymentId = md5(uniqid());
            $transactions = $user->transactions()->create([
                'paid' => $invoice->getAmount(),
                'invoice_details' => $invoice,
                'payment_id' => $paymentId
            ]);

            $callbackUrl = route('meetingPaymentResult', with([
                'price' => $price,
                'payment_id' => $paymentId,
                "time_id" => $request->TimeId,
                "DrId" => $request->DrId,
                "connection" => $request->connection,
                "reservedDate" => $request->meetingReserveddate,
                "spid" => $request->spId
            ]));
            $payment = Payment::callbackUrl($callbackUrl);
            $payment->config('description', "هزینه جلسه مشاوره");

            $payment->purchase($invoice, function ($driver, $transactionId) use ($transactions) {
                $transactions->transaction_id = $transactionId;
                $transactions->save();

            });
            return $payment->pay()->render();

        } catch (PurchaseFailedException|Exception|SoapFault $e) {
            $transactions->transaction_result = $e;
            $transactions->status = Transaction::STATUS_FAILED;
            $transactions->save();
        }

I received this response:

{
    "message": "Call to undefined method Illuminate\\View\\Compilers\\BladeCompiler::render()",
    "exception": "Error",
    "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Support\\Facades\\Facade.php",
    "line": 261,
    "trace": [
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\shetabit\\payment\\src\\Provider\\PaymentServiceProvider.php",
            "line": 73,
            "function": "__callStatic",
            "class": "Illuminate\\Support\\Facades\\Facade",
            "type": "::"
        },
        {
            "function": "Shetabit\\Payment\\Provider\\{closure}",
            "class": "Shetabit\\Payment\\Provider\\PaymentServiceProvider",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\shetabit\\multipay\\src\\RedirectionForm.php",
            "line": 176,
            "function": "call_user_func_array"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\app\\Http\\Controllers\\WalletController.php",
            "line": 64,
            "function": "render",
            "class": "Shetabit\\Multipay\\RedirectionForm",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php",
            "line": 54,
            "function": "payInvoice",
            "class": "App\\Http\\Controllers\\WalletController",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php",
            "line": 45,
            "function": "callAction",
            "class": "Illuminate\\Routing\\Controller",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php",
            "line": 239,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\ControllerDispatcher",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php",
            "line": 196,
            "function": "runController",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 685,
            "function": "run",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 128,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php",
            "line": 41,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php",
            "line": 59,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Auth\\Middleware\\Authenticate.php",
            "line": 44,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Auth\\Middleware\\Authenticate",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 687,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 662,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 628,
            "function": "runRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
            "line": 617,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
            "line": 165,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 128,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode.php",
            "line": 63,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\fideloper\\proxy\\src\\TrustProxies.php",
            "line": 57,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Fideloper\\Proxy\\TrustProxies",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
            "line": 140,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
            "line": 109,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\public\\index.php",
            "line": 55,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "C:\\wamp64\\www\\lotusty_stable\\server.php",
            "line": 21,
            "function": "require_once"
        }
    ]
}
amidesfahani commented 1 year ago

Error Call to undefined method Illuminate\View\Compilers\BladeCompiler::render()

render does not exists in BladeCompiler class

Laravel 8

amidesfahani commented 1 year ago

use version 4.2.0

https://github.com/shetabit/payment/compare/v4.2.1...master

khanzadimahdi commented 1 year ago

این مشکل احتمالا به خاطر مرج شدن PR های اخیر رخ داده. این تابع در ورژن های جدید لاراول موجود هست اما در ورژن های قدیمی تر احتمالا موجود نیست.