From d6c0e3e206386a33874125fbbb414e1c8a7f188e Mon Sep 17 00:00:00 2001 From: Craig Paul Date: Sat, 22 Oct 2016 20:07:43 -0600 Subject: [PATCH] Adds vault avs purchase test --- tests/VaultTest.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/VaultTest.php b/tests/VaultTest.php index 610fa22..97ad083 100644 --- a/tests/VaultTest.php +++ b/tests/VaultTest.php @@ -216,4 +216,28 @@ public function it_can_submit_a_cvd_secured_purchase_with_a_credit_card_stored_i $this->assertEquals($key, $receipt->DataKey); $this->assertEquals('true', $receipt->Complete); } + + /** @test */ + public function it_can_submit_an_avs_secured_purchase_with_a_credit_card_stored_in_the_moneris_vault() + { + $params = ['environment' => Moneris::ENV_TESTING, 'avs' => true]; + $vault = Moneris::create($this->id, $this->token, $params)->cards(); + + $response = $this->vault->add($this->card); + $key = $response->receipt()->DataKey; + + $params = array_merge($this->params, [ + 'data_key' => $key, + 'avs_street_number' => '123', + 'avs_street_name' => 'Fake Street', + 'avs_zipcode' => 'X0X0X0', + ]); + + $response = $vault->purchase($params); + $receipt = $response->receipt(); + + $this->assertTrue($response->successful); + $this->assertEquals($key, $receipt->DataKey); + $this->assertEquals('true', $receipt->Complete); + } } \ No newline at end of file