diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index 6d0be72..1050a7f 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -89,4 +89,21 @@ public function it_can_validate_an_api_response_from_a_proper_transaction() $this->assertTrue($response->successful); } + + /** @test */ + public function it_can_receive_a_receipt_from_a_properly_processed_transaction() + { + $response = Processor::process($this->transaction); + + /** @var \CraigPaul\Moneris\Response $response */ + $response = $response->validate(); + $receipt = $response->receipt(); + + $this->assertNotNull($receipt); + $this->assertEquals(SimpleXMLElement::class, get_class($receipt)); + $this->assertEquals($this->params['order_id'], $receipt->ReceiptId); + $this->assertObjectHasAttribute('TransID', $receipt); + $this->assertObjectHasAttribute('ReferenceNum', $receipt); + $this->assertObjectHasAttribute('Complete', $receipt); + } } \ No newline at end of file