当前位置: 首页>>代码示例>>PHP>>正文


PHP Invitation::with方法代码示例

本文整理汇总了PHP中app\models\Invitation::with方法的典型用法代码示例。如果您正苦于以下问题:PHP Invitation::with方法的具体用法?PHP Invitation::with怎么用?PHP Invitation::with使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Invitation的用法示例。


在下文中一共展示了Invitation::with方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sanitize

 public function sanitize()
 {
     $input = $this->all();
     $invitation = Invitation::with('invoice.invoice_items', 'invoice.client.currency', 'invoice.client.account.currency', 'invoice.client.account.account_gateways.gateway')->where('invitation_key', '=', $this->invitation_key)->firstOrFail();
     $input['invitation'] = $invitation;
     $input['gateway_type'] = session($invitation->id . 'gateway_type');
     $this->replace($input);
     return $this->all();
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:9,代码来源:CreateOnlinePaymentRequest.php

示例2: markBounced

 public function markBounced($messageId, $error)
 {
     $invitation = Invitation::with('user', 'invoice', 'contact')->whereMessageId($messageId)->first();
     if (!$invitation) {
         return false;
     }
     $invitation->email_error = $error;
     $invitation->save();
     $this->userMailer->sendEmailBounced($invitation);
     return true;
 }
开发者ID:magicians,项目名称:invoiceninja,代码行数:11,代码来源:EmailService.php

示例3: clientIndex

 public function clientIndex()
 {
     $invitationKey = Session::get('invitation_key');
     if (!$invitationKey) {
         return Redirect::to('/setup');
     }
     $invitation = Invitation::with('account')->where('invitation_key', '=', $invitationKey)->first();
     $color = $invitation->account->primary_color ? $invitation->account->primary_color : '#0b4d78';
     $data = ['color' => $color, 'hideLogo' => Session::get('white_label'), 'title' => trans('texts.invoices'), 'entityType' => ENTITY_INVOICE, 'columns' => Utils::trans(['invoice_number', 'invoice_date', 'invoice_total', 'balance_due', 'due_date'])];
     return View::make('public_list', $data);
 }
开发者ID:ricoa,项目名称:invoice-ninja,代码行数:11,代码来源:InvoiceController.php

示例4: offsite_payment

 public function offsite_payment()
 {
     $payerId = Request::query('PayerID');
     $token = Request::query('token');
     if (!$token) {
         $token = Session::pull('transaction_reference');
     }
     if (!$token) {
         return redirect(NINJA_WEB_URL);
     }
     $invitation = Invitation::with('invoice.client.currency', 'invoice.client.account.account_gateways.gateway')->where('transaction_reference', '=', $token)->firstOrFail();
     $invoice = $invitation->invoice;
     $accountGateway = $invoice->client->account->getGatewayByType(Session::get('payment_type'));
     $gateway = self::createGateway($accountGateway);
     try {
         if (method_exists($gateway, 'completePurchase')) {
             $details = self::getPaymentDetails($invitation);
             $response = $gateway->completePurchase($details)->send();
             $ref = $response->getTransactionReference();
             if ($response->isSuccessful()) {
                 $payment = self::createPayment($invitation, $ref, $payerId);
                 Session::flash('message', trans('texts.applied_payment'));
                 return Redirect::to('view/' . $invitation->invitation_key);
             } else {
                 $errorMessage = trans('texts.payment_error') . "\n\n" . $response->getMessage();
                 Session::flash('error', $errorMessage);
                 Utils::logError($errorMessage);
                 return Redirect::to('view/' . $invitation->invitation_key);
             }
         } else {
             $payment = self::createPayment($invitation, $token, $payerId);
             Session::flash('message', trans('texts.applied_payment'));
             return Redirect::to('view/' . $invitation->invitation_key);
         }
     } catch (\Exception $e) {
         $errorMessage = trans('texts.payment_error');
         Session::flash('error', $errorMessage);
         Utils::logError($errorMessage . "\n\n" . $e->getMessage());
         return Redirect::to('view/' . $invitation->invitation_key);
     }
 }
开发者ID:biggtfish,项目名称:invoiceNinja-1,代码行数:41,代码来源:PaymentController.php

示例5: offsite_payment

 public function offsite_payment()
 {
     $payerId = Request::query('PayerID');
     $token = Request::query('token');
     if (!$token) {
         $token = Session::pull('transaction_reference');
     }
     if (!$token) {
         return redirect(NINJA_WEB_URL);
     }
     $invitation = Invitation::with('invoice.client.currency', 'invoice.client.account.account_gateways.gateway')->where('transaction_reference', '=', $token)->firstOrFail();
     $invoice = $invitation->invoice;
     $accountGateway = $invoice->client->account->getGatewayByType(Session::get('payment_type'));
     $gateway = $this->paymentService->createGateway($accountGateway);
     // Check for Dwolla payment error
     if ($accountGateway->isGateway(GATEWAY_DWOLLA) && Input::get('error')) {
         $this->error('Dwolla', Input::get('error_description'), $accountGateway);
         return Redirect::to('view/' . $invitation->invitation_key);
     }
     try {
         if (method_exists($gateway, 'completePurchase')) {
             $details = $this->paymentService->getPaymentDetails($invitation);
             $response = $gateway->completePurchase($details)->send();
             $ref = $response->getTransactionReference();
             if ($response->isSuccessful()) {
                 $payment = $this->paymentService->createPayment($invitation, $ref, $payerId);
                 Session::flash('message', trans('texts.applied_payment'));
                 return Redirect::to('view/' . $invitation->invitation_key);
             } else {
                 $this->error('offsite', $response->getMessage(), $accountGateway);
                 return Redirect::to('view/' . $invitation->invitation_key);
             }
         } else {
             $payment = $this->paymentService->createPayment($invitation, $token, $payerId);
             Session::flash('message', trans('texts.applied_payment'));
             return Redirect::to('view/' . $invitation->invitation_key);
         }
     } catch (\Exception $e) {
         $this->error('Offsite-uncaught', false, $accountGateway, $e);
         return Redirect::to('view/' . $invitation->invitation_key);
     }
 }
开发者ID:jorisvandesande,项目名称:invoice-ninja,代码行数:42,代码来源:PaymentController.php

示例6: offsite_payment

 public function offsite_payment()
 {
     $payerId = Request::query('PayerID');
     $token = Request::query('token');
     if (!$token) {
         $token = Session::pull('transaction_reference');
     }
     if (!$token) {
         return redirect(NINJA_WEB_URL);
     }
     $invitation = Invitation::with('invoice.client.currency', 'invoice.client.account.account_gateways.gateway')->where('transaction_reference', '=', $token)->firstOrFail();
     $invoice = $invitation->invoice;
     $client = $invoice->client;
     $account = $client->account;
     if ($payerId) {
         $paymentType = PAYMENT_TYPE_PAYPAL;
     } else {
         $paymentType = Session::get($invitation->id . 'payment_type');
     }
     if (!$paymentType) {
         $this->error('No-Payment-Type', false, false);
         return Redirect::to($invitation->getLink());
     }
     $accountGateway = $account->getGatewayByType($paymentType);
     $gateway = $this->paymentService->createGateway($accountGateway);
     // Check for Dwolla payment error
     if ($accountGateway->isGateway(GATEWAY_DWOLLA) && Input::get('error')) {
         $this->error('Dwolla', Input::get('error_description'), $accountGateway);
         return Redirect::to($invitation->getLink());
     }
     // PayFast transaction referencce
     if ($accountGateway->isGateway(GATEWAY_PAYFAST) && Request::has('pt')) {
         $token = Request::query('pt');
     }
     try {
         if (method_exists($gateway, 'completePurchase') && !$accountGateway->isGateway(GATEWAY_TWO_CHECKOUT) && !$accountGateway->isGateway(GATEWAY_CHECKOUT_COM)) {
             $details = $this->paymentService->getPaymentDetails($invitation, $accountGateway);
             $response = $this->paymentService->completePurchase($gateway, $accountGateway, $details, $token);
             $ref = $response->getTransactionReference() ?: $token;
             if ($response->isCancelled()) {
                 // do nothing
             } elseif ($response->isSuccessful()) {
                 $payment = $this->paymentService->createPayment($invitation, $accountGateway, $ref, $payerId);
                 Session::flash('message', trans('texts.applied_payment'));
             } else {
                 $this->error('offsite', $response->getMessage(), $accountGateway);
             }
             return Redirect::to($invitation->getLink());
         } else {
             $payment = $this->paymentService->createPayment($invitation, $accountGateway, $token, $payerId);
             Session::flash('message', trans('texts.applied_payment'));
             return Redirect::to($invitation->getLink());
         }
     } catch (\Exception $e) {
         $this->error('Offsite-uncaught', false, $accountGateway, $e);
         return Redirect::to($invitation->getLink());
     }
 }
开发者ID:joshuadwire,项目名称:invoiceninja,代码行数:58,代码来源:PaymentController.php

示例7: offsitePayment

 /**
  * @param bool $invitationKey
  * @param mixed $gatewayTypeAlias
  * @return \Illuminate\Http\RedirectResponse
  */
 public function offsitePayment($invitationKey = false, $gatewayTypeAlias = false)
 {
     $invitationKey = $invitationKey ?: Session::get('invitation_key');
     $invitation = Invitation::with('invoice.invoice_items', 'invoice.client.currency', 'invoice.client.account.account_gateways.gateway')->where('invitation_key', '=', $invitationKey)->firstOrFail();
     if (!$gatewayTypeAlias) {
         $gatewayTypeId = Session::get($invitation->id . 'gateway_type');
     } elseif ($gatewayTypeAlias != GATEWAY_TYPE_TOKEN) {
         $gatewayTypeId = GatewayType::getIdFromAlias($gatewayTypeAlias);
     } else {
         $gatewayTypeId = $gatewayTypeAlias;
     }
     $paymentDriver = $invitation->account->paymentDriver($invitation, $gatewayTypeId);
     if ($error = Input::get('error_description') ?: Input::get('error')) {
         return $this->error($paymentDriver, $error);
     }
     try {
         if ($paymentDriver->completeOffsitePurchase(Input::all())) {
             Session::flash('message', trans('texts.applied_payment'));
         }
         return redirect()->to($invitation->getLink());
     } catch (Exception $exception) {
         return $this->error($paymentDriver, $exception);
     }
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:29,代码来源:OnlinePaymentController.php

示例8: approve

 public function approve($invitationKey)
 {
     $invitation = Invitation::with('invoice.invoice_items', 'invoice.invitations')->where('invitation_key', '=', $invitationKey)->firstOrFail();
     $invoice = $invitation->invoice;
     if ($invoice->is_quote && !$invoice->quote_invoice_id) {
         Event::fire(new QuoteApproved($invoice));
         Activity::approveQuote($invitation);
         $invoice = $this->invoiceRepo->cloneInvoice($invoice, $invoice->id);
         Session::flash('message', trans('texts.converted_to_invoice'));
         foreach ($invoice->invitations as $invitationClone) {
             if ($invitation->contact_id == $invitationClone->contact_id) {
                 $invitationKey = $invitationClone->invitation_key;
             }
         }
     }
     return Redirect::to("view/{$invitationKey}");
 }
开发者ID:biggtfish,项目名称:invoiceNinja-1,代码行数:17,代码来源:QuoteController.php

示例9: approve

 public function approve($invitationKey)
 {
     $invitation = Invitation::with('invoice.invoice_items', 'invoice.invitations')->where('invitation_key', '=', $invitationKey)->firstOrFail();
     $invoice = $invitation->invoice;
     $invitationKey = $this->invoiceService->approveQuote($invoice, $invitation);
     Session::flash('message', trans('texts.quote_is_approved'));
     return Redirect::to("view/{$invitationKey}");
 }
开发者ID:magicians,项目名称:invoiceninja,代码行数:8,代码来源:QuoteController.php


注:本文中的app\models\Invitation::with方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。