Skip to content

Commit

Permalink
Merge pull request #506 from mayocca/master
Browse files Browse the repository at this point in the history
Fix invoice client for alphanumeric external references and add missing resource fields
  • Loading branch information
rhames07 authored Apr 8, 2024
2 parents a12d7a3 + 32a1430 commit e03a173
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/MercadoPago/Resources/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ class Invoice extends MPResource
public ?string $reason;

/** The external reference for the invoice. */
public ?int $external_reference;
public ?string $external_reference;

/** The currency ID. */
public ?string $currency_id;

/** The transaction amount. */
public ?float $transaction_amount;

/** The date for the next retry attempt. */
public ?string $next_retry_date;

/** The debit date and time for the invoice. */
public ?string $debit_date;

/** The payment method ID. */
public ?string $payment_method_id;

/** The retry attempt count. */
public ?int $retry_attempt;

Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Resources/Invoice/InvoiceSearchResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class InvoiceSearchResult
public ?string $reason;

/** The external reference for the invoice. */
public ?int $external_reference;
public ?string $external_reference;

/** The currency ID. */
public ?string $currency_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testGetSuccess(): void
$this->assertSame("2022-01-01T11:12:25.892-04:00", $invoice->last_modified);
$this->assertSame("2c938084726fca480172750000000000", $invoice->preapproval_id);
$this->assertSame("Yoga classes", $invoice->reason);
$this->assertSame(23546246234, $invoice->external_reference);
$this->assertSame("YG-23546246234", $invoice->external_reference);
$this->assertSame("ARS", $invoice->currency_id);
$this->assertSame(10.0, $invoice->transaction_amount);
$this->assertSame("2022-01-01T11:12:25.892-04:00", $invoice->debit_date);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"last_modified": "2022-01-01T11:12:25.892-04:00",
"preapproval_id": "2c938084726fca480172750000000000",
"reason": "Yoga classes",
"external_reference": 23546246234,
"external_reference": "YG-23546246234",
"currency_id": "ARS",
"transaction_amount": 10,
"debit_date": "2022-01-01T11:12:25.892-04:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"last_modified": "2022-01-01T11:12:25.892-04:00",
"preapproval_id": "2c938084726fca480172750000000000",
"reason": "Yoga classes",
"external_reference": 23546246234,
"external_reference": "YG-23546246234",
"currency_id": "ARS",
"transaction_amount": 10,
"debit_date": "2022-01-01T11:12:25.892-04:00",
Expand Down

0 comments on commit e03a173

Please sign in to comment.