From 0c3e61fb2b0f30fae71b8dce2e523f056bc0d516 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 7 Aug 2017 17:16:16 +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 7d1e9158da2f..5e5558c8cb8d 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,