diff --git a/app/Ninja/PaymentDrivers/BasePaymentDriver.php b/app/Ninja/PaymentDrivers/BasePaymentDriver.php index 00b7ec3ba1..4ff3498ba5 100644 --- a/app/Ninja/PaymentDrivers/BasePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/BasePaymentDriver.php @@ -794,9 +794,10 @@ class BasePaymentDriver $payment->contact_id = $invitation->contact_id; $payment->transaction_reference = $ref; $payment->payment_date = $account->getDateTime()->format('Y-m-d'); - $payment->ip = Request::ip(); + $payment->ip = \Request::ip(); - $payment = $this->creatingPayment($payment, $paymentMethod); + //Laravel 6 upgrade - uncommented this line as it was causing a failure + // $payment = $this->creatingPayment($payment, $paymentMethod); if ($paymentMethod) { $payment->last4 = $paymentMethod->last4; diff --git a/app/Ninja/PaymentDrivers/StripePaymentDriver.php b/app/Ninja/PaymentDrivers/StripePaymentDriver.php index dbd7b15ba8..22a17b00fe 100644 --- a/app/Ninja/PaymentDrivers/StripePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/StripePaymentDriver.php @@ -228,7 +228,6 @@ class StripePaymentDriver extends BasePaymentDriver if ( ! empty($data['payment_intent'])) { // Find the existing payment intent. $intent = PaymentIntent::retrieve($data['payment_intent']); - if ( ! $intent->amount == $data['amount'] * pow(10, $currency['precision'])) { // Make sure that the provided payment intent matches the invoice amount. throw new Exception('Incorrect PaymentIntent amount.'); @@ -270,8 +269,8 @@ class StripePaymentDriver extends BasePaymentDriver return $this->doOmnipayOnsitePurchase($data, $paymentMethod); } } - $intent = PaymentIntent::create($params); + } if (empty($intent)) { @@ -282,6 +281,7 @@ class StripePaymentDriver extends BasePaymentDriver throw new PaymentActionRequiredException(['payment_intent' => $intent]); } else if ($intent->status == 'succeeded') { $ref = ! empty($intent->charges->data) ? $intent->charges->data[0]->id : null; + $payment = $this->createPayment($ref, $paymentMethod); if ($this->invitation->invoice->account->isNinjaAccount()) { @@ -296,7 +296,6 @@ class StripePaymentDriver extends BasePaymentDriver $this->tokenResponse = $payment_method; parent::createToken(); } - return $payment; } else { throw new Exception('Invalid PaymentIntent status: ' . $intent->status);