Skip to content

Commit

Permalink
fix: não sobrescreve paymentMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewalkermo committed May 20, 2024
1 parent 670bf6a commit 8ba341d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Gateways/IuguGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 8ba341d

Please sign in to comment.