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

Commit

Permalink
Adds avs vault pre auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 23, 2016
1 parent 38a2185 commit c1d4b1c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/VaultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,28 @@ public function it_can_submit_a_cvd_secured_pre_authorization_request_for_a_cred
$this->assertEquals($key, $receipt->DataKey);
$this->assertEquals('true', $receipt->Complete);
}

/** @test */
public function it_can_submit_an_avs_secured_pre_authorization_request_for_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->preauth($params);
$receipt = $response->receipt();

$this->assertTrue($response->successful);
$this->assertEquals($key, $receipt->DataKey);
$this->assertEquals('true', $receipt->Complete);
}
}

0 comments on commit c1d4b1c

Please sign in to comment.