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

Commit

Permalink
Adds full lookup test
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 21, 2016
1 parent 47fe252 commit 4a7947b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/VaultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,21 @@ public function it_can_peek_into_the_vault_and_retrieve_a_masked_credit_card_fro
$this->assertEquals($beginning, substr($receipt->ResolveData->masked_pan, 0, 4));
$this->assertEquals($end, substr($receipt->ResolveData->masked_pan, -4, 4));
}

/** @test */
public function it_can_peek_into_the_vault_and_retrieve_a_full_credit_card_from_the_moneris_vault_with_a_valid_data_key()
{
$card = CreditCard::create($this->visa, '2012');

$response = $this->vault->add($card);
$key = $response->receipt()->DataKey;

$response = $this->vault->peek($key, true);
$receipt = $response->receipt();

$this->assertTrue($response->successful);
$this->assertNotNull($receipt->DataKey);
$this->assertEquals('2012', $receipt->ResolveData->expdate);
$this->assertEquals($this->visa, $receipt->ResolveData->pan);
}
}

0 comments on commit 4a7947b

Please sign in to comment.