/**
  * Send a reset link to the given user.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postEmail(Request $request)
 {
     $this->validate($request, ['email' => 'required|email']);
     try {
         if (($user_sentry = Sentry::findUserByLogin($request->email)) != null) {
             RegistrationController::enviarActivationReminderCode($user_sentry, 'reminder');
             list($type, $msg) = ['mensaje', 'passwords.sent'];
         } else {
             list($type, $msg) = ['error', 'passwords.user'];
         }
     } catch (UserNotFoundException $e) {
         list($type, $msg) = ['error', 'passwords.user'];
     }
     return redirect()->back()->with([$type => trans($msg)]);
     //        $response = Password::sendResetLink($request->only('email'), function (Message $message) {
     //                    $message->subject($this->getEmailSubject());
     //                });
     //
     //        switch ($response) {
     //            case Password::RESET_LINK_SENT:
     //                list($type, $msg) = ['mensaje', 'passwords.sent'];
     //
     //            case Password::INVALID_USER:
     //                list($type, $msg) = ['error', 'passwords.user'];
     //        }
 }
 /**
  * 退款
  *
  * @param Deal $payDeal 支付交易
  *
  * @return bool
  */
 public static function refund(Deal $payDeal)
 {
     $state = RegistrationController::xxPay($payDeal->payee_account, $payDeal->payer_account, $payDeal->fee);
     //TODO 待优化
     if ($state == 1) {
         $refundDeal = new Deal();
         $refundDeal->registration_id = $payDeal->registration_id;
         $refundDeal->fee = $payDeal->fee;
         $refundDeal->payer_account = $payDeal->payee_account;
         $refundDeal->payee_account = $payDeal->payer_account;
         $refundDeal->type = '退款';
         if ($refundDeal->save()) {
             return true;
         }
     }
     return false;
 }