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