Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Adds test for receipt method
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 21, 2016
1 parent 719ae5c commit 4329c15
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 4329c15

Please sign in to comment.