diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index e614a36aa54f..9d73671cbaf3 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -176,7 +176,9 @@ class PaymentController extends \BaseController public function show_payment($invitationKey) { // For PayPal Express we redirect straight to their site - if (Auth::user()->account->isGatewayConfigured(GATEWAY_PAYPAL_EXPRESS)) + $invitation = Invitation::with('invoice.client.account')->where('invitation_key', '=', $invitationKey)->firstOrFail(); + $account = $invitation->invoice->client->account; + if ($account->isGatewayConfigured(GATEWAY_PAYPAL_EXPRESS)) { return self::do_payment($invitationKey, false); }