From 4a930e790c746e79152a1ebd18ff1a955b0cb7a0 Mon Sep 17 00:00:00 2001 From: Craig Paul Date: Fri, 21 Oct 2016 12:49:21 -0600 Subject: [PATCH] Adds delete credit card test --- tests/VaultTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/VaultTest.php b/tests/VaultTest.php index 034b93b..cbf01a0 100644 --- a/tests/VaultTest.php +++ b/tests/VaultTest.php @@ -76,4 +76,20 @@ public function it_can_update_a_credit_card_in_the_moneris_vault_and_returns_a_d $this->assertEquals($key, $receipt->DataKey); $this->assertEquals('2112', $response->transaction->params['expdate']); } + + /** @test */ + public function it_can_delete_a_credit_card_from_the_moneris_vault_and_returns_a_data_key_for_storage() + { + $card = CreditCard::create($this->visa, '2012'); + + $response = $this->vault->add($card); + $key = $response->receipt()->DataKey; + + $response = $this->vault->delete($key); + $receipt = $response->receipt(); + + $this->assertTrue($response->successful); + $this->assertNotNull($receipt->DataKey); + $this->assertEquals($key, $receipt->DataKey); + } } \ No newline at end of file