From 8ba341d6a78b80a22e5c45b0f364bccb2ad48f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Walker?= Date: Mon, 20 May 2024 18:10:16 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20n=C3=A3o=20sobrescreve=20paymentMethod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Gateways/IuguGateway.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Gateways/IuguGateway.php b/src/Gateways/IuguGateway.php index 6090e4e..ee1b478 100644 --- a/src/Gateways/IuguGateway.php +++ b/src/Gateways/IuguGateway.php @@ -400,9 +400,12 @@ private function parseInvoice($iuguInvoice, ?Invoice $invoice = null): Invoice $invoice->createdAt = new Carbon($iuguInvoice->created_at_iso); $invoice->paidAmount = $iuguInvoice->paid_cents; $invoice->refundedAmount = $iuguInvoice->refunded_cents; - $invoice->paymentMethod = $this->iuguToMultiPaymentPaymentMethod($iuguInvoice->payment_method); $invoice->expiresAt = !empty($iuguInvoice->due_date) ? new Carbon($iuguInvoice->due_date) : null; + if (empty($invoice->paymentMethod)) { + $invoice->paymentMethod = $this->iuguToMultiPaymentPaymentMethod($iuguInvoice->payment_method); + } + if (empty($invoice->customer)) { $invoice->customer = new Customer(); }