From b013e1c7d1e9c2ee56c0bed165acd33725abd2cb Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 7 Aug 2017 17:15:54 +0300 Subject: [PATCH] Fix for PayPal 'item amounts do not match' --- app/Ninja/PaymentDrivers/BasePaymentDriver.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Ninja/PaymentDrivers/BasePaymentDriver.php b/app/Ninja/PaymentDrivers/BasePaymentDriver.php index 09853abe0b02..ecf5edbcf6df 100644 --- a/app/Ninja/PaymentDrivers/BasePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/BasePaymentDriver.php @@ -348,6 +348,11 @@ class BasePaymentDriver $total = 0; foreach ($invoice->invoice_items as $invoiceItem) { + // Some gateways require quantity is an integer + if (floatval($invoiceItem->qty) != intval($invoiceItem->qty)) { + return null; + } + $item = new Item([ 'name' => $invoiceItem->product_key, 'description' => $invoiceItem->notes,