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

Commit

Permalink
Removes support for full card lookup as Moneris recommends against us…
Browse files Browse the repository at this point in the history
…ing this feature since it can cause PCI compliance headaches
  • Loading branch information
coconutcraig committed Jul 19, 2019
1 parent fb28db8 commit e2d0c14
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ $response = $vault->tokenize($response->transaction);

### Peek Into The Vault

If you have the need to look up the masked credit card number, or perhaps the full credit card number, you can peek into the Vault.
If you have the need to look up the masked credit card number you can peek into the Vault.

```php
$card = CreditCard::create('4242424242424242', '2012');
Expand All @@ -353,8 +353,6 @@ $response = $vault->peek($key);
$receipt = $response->receipt();

$masked = $receipt->read('data')['masked_pan'];

$full = $receipt->read('data')['pan'];
```

### Retrieve Expiring Cards
Expand Down Expand Up @@ -552,4 +550,4 @@ Moneris API is open-sourced software licensed under the [MIT license](https://op
[link-travis]: https://travis-ci.org/craigpaul/moneris-api
[link-downloads]: https://packagist.org/packages/craigpaul/moneris-api
[link-author]: https://github.com/craigpaul
[link-contributors]: ../../contributors
[link-contributors]: ../../contributors
5 changes: 2 additions & 3 deletions src/Vault.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@ public function expiring()
* profile associated with a given data key.
*
* @param string $key
* @param bool $full
*
* @return \CraigPaul\Moneris\Response
*/
public function peek($key = '', $full = false)
public function peek($key = '')
{
$params = [
'type' => $full ? 'res_lookup_full' : 'res_lookup_masked',
'type' => 'res_lookup_masked',
'data_key' => $key,
];

Expand Down
18 changes: 1 addition & 17 deletions tests/VaultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,6 @@ public function it_can_peek_into_the_vault_and_retrieve_a_masked_credit_card_fro
$this->assertEquals($end, substr($receipt->read('data')['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()
{
$response = $this->vault->add($this->card);
$key = $response->receipt()->read('key');

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

$this->assertTrue($response->successful);
$this->assertNotNull($receipt->read('key'));
$this->assertEquals('12', $receipt->read('data')['expiry_date']['month']);
$this->assertEquals('20', $receipt->read('data')['expiry_date']['year']);
$this->assertEquals($this->visa, $receipt->read('data')['pan']);
}

/** @test */
public function it_can_retrieve_all_expiring_credit_cards_from_the_moneris_vault()
{
Expand Down Expand Up @@ -488,4 +472,4 @@ public function it_can_capture_a_pre_authorized_credit_card_stored_in_the_moneri
$this->assertTrue($response->successful);
$this->assertEquals(true, $receipt->read('complete'));
}
}
}

0 comments on commit e2d0c14

Please sign in to comment.