Commit 9bebb7e5 authored by SadeghPM's avatar SadeghPM

Send Password to user

parent 130a64ad
......@@ -2,6 +2,7 @@
namespace Dpsoft\Mehr4Payment\Controller\Wizard;
use Dpsoft\Mehr\Notifications\PasswordChangedNotification;
use Dpsoft\Mehr4Payment\Invoice;
use Dpsoft\Mehr4Payment\Requests\UserUpdateRequest;
use Dpsoft\Mehr\Models\Course;
......@@ -11,15 +12,20 @@ class ReceiptController
public function __invoke(UserUpdateRequest $request)
{
$user = auth('web')->user();
$needPassword = empty($user->email);
$user->name = \request('name');
$user->email = \request('email');
$user->address = \request('address');
$user->postal_code = $request->get('postal_code');
$user->save();
$invoice=Invoice::createOrUpdateByUser(Course::find(\request('course')),auth('web')->user());
$payments_url=\Mehr4Payment::getGatewayProviders($invoice);
if ($needPassword) {
$user->notify(new PasswordChangedNotification($user->mobile));
}
return \Mehr4Payment::ok(compact('user','invoice','payments_url'));
$invoice = Invoice::createOrUpdateByUser(Course::find(\request('course')), auth('web')->user());
$payments_url = \Mehr4Payment::getGatewayProviders($invoice);
return \Mehr4Payment::ok(compact('user', 'invoice', 'payments_url'));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment