diff --git a/tests/VaultTest.php b/tests/VaultTest.php index cbf01a0..6519670 100644 --- a/tests/VaultTest.php +++ b/tests/VaultTest.php @@ -1,5 +1,6 @@ assertNotNull($receipt->DataKey); $this->assertEquals($key, $receipt->DataKey); } + + /** @test */ + public function it_can_tokenize_a_previous_transaction_to_add_the_transactions_credit_card_in_the_moneris_vault_and_returns_a_data_key_for_storage() + { + $gateway = Moneris::create($this->id, $this->token, ['environment' => Moneris::ENV_TESTING]); + + $response = $gateway->purchase([ + 'order_id' => uniqid('1234-56789', true), + 'amount' => '1.00', + 'credit_card' => $this->visa, + 'expdate' => '2012', + ]); + + $response = $this->vault->tokenize($response->transaction); + $receipt = $response->receipt(); + + $this->assertTrue($response->successful); + $this->assertNotNull($receipt->DataKey); + } } \ No newline at end of file