Skip to content

Commit b08476c

Browse files
authored
Merge pull request #144 from Pramaganus/master
Add Invoice Query query date to the SDK
2 parents 427d911 + 442e0dc commit b08476c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Account/Entities/InvoiceQuery.php

+10
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ class InvoiceQuery
6161
*/
6262
public $status;
6363

64+
/**
65+
* @var \DateTime
66+
*/
67+
public $date;
68+
6469
/**
6570
* InvoiceQuery constructor.
6671
*
@@ -76,6 +81,10 @@ public function __construct($item = null)
7681
? DateTime::createFromFormat(DateTime::ISO8601, $item->resolution_date)
7782
: null;
7883

84+
$date = ($item->date != null)
85+
? DateTime::createFromFormat(DateTime::ISO8601, $item->date)
86+
: null;
87+
7988
$this->id = $item->id;
8089
$this->contactId = $item->contact_id;
8190
$this->amount = $item->amount;
@@ -86,6 +95,7 @@ public function __construct($item = null)
8695
$this->contactMethod = $item->contact_method;
8796
$this->resolution = $item->resolution;
8897
$this->resolutionDate = $resolutionDate;
98+
$this->date = $date;
8999
$this->status = $item->status;
90100
}
91101
}

tests/Account/InvoiceQueryTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public function get_invoice_query_by_id()
3535
"contact_method" => "email",
3636
"resolution" => "This issue was resolved.",
3737
"resolution_date" => '2019-10-25T00:00:00+01:00',
38-
"status" => "Submitted"
38+
"status" => "Submitted",
39+
"date" => "2019-11-07T10:56:54+00:00"
3940
],
4041
"meta" => []
4142
])),
@@ -61,6 +62,7 @@ public function get_invoice_query_by_id()
6162
$this->assertEquals("This issue was resolved.", $invoiceQuery->resolution);
6263
$this->assertInstanceOf(DateTime::class, $invoiceQuery->resolutionDate);
6364
$this->assertEquals("Submitted", $invoiceQuery->status);
65+
$this->assertInstanceOf(DateTime::class, $invoiceQuery->date);
6466
}
6567

6668
/**

0 commit comments

Comments
 (0)