-
Notifications
You must be signed in to change notification settings - Fork 5
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
Undefined variable: user #3
Comments
Thanks for you'r contribution, First to use pay method, don't forget to use HasKnet trait inside User model <?php
namespace App;
use Asciisd\Knet\HasKnet;
class User extends Authenticatable {
use HasKnet;
} for second question, the pay method not static, so to call it you should get user instance first, for example if you are inside controller you can do this :- public function update(Request $request, $id)
{
$payment = $request->user()->pay($request->amount, [
'udf1' => $request->user()->name,
'udf2' => $request->user()->email,
]);
} |
Thanks very much, but it redirect to KPAYTEST page not KPAY, so i have to make some change in knet.php file , by change another thing, do you know what's the parameters for KPAYTEST like (tranportal id - password & resource key) so i can make testing. |
just change .env file keys,
|
to get parameters, you should ask your bank to send you test parameters. |
Thanks very much Amr great work,I have another questions but i will open another posts |
Hi,
and thank you for great work.
I'm trying to call (pay) function in controller, but i get this error when set your example code:
Undefined variable: user
and when try to create user variable by using this code :
$user = Auth::user();
i get this error:
Call to undefined method App\User::pay()
So, how can get ($user) variable ?
The text was updated successfully, but these errors were encountered: