From 8d1a1f8a6915cac1f883b2ee97621e1ff5c33537 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 5 Aug 2022 11:54:48 +0700 Subject: [PATCH] Fix the nagative amount item --- modules/gateways/xendit/lib/Link.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gateways/xendit/lib/Link.php b/modules/gateways/xendit/lib/Link.php index d11fe25..3b9e6a0 100644 --- a/modules/gateways/xendit/lib/Link.php +++ b/modules/gateways/xendit/lib/Link.php @@ -17,6 +17,10 @@ protected function extractItems(\WHMCS\Billing\Invoice $invoice): array { $items = array(); foreach ($invoice->items()->get() as $item) { + if ($item->amount < 0) { + continue; + } + $items[] = [ 'quantity' => 1, 'name' => $item->description,