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

Commit

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

/** @test */
public function it_can_capture_a_pre_authorized_credit_card_stored_in_the_moneris_vault()
{
$response = $this->vault->add($this->card);
$key = $response->receipt()->DataKey;

$params = array_merge($this->params, [
'data_key' => $key,
]);

$response = $this->vault->preauth($params);
$response = $this->vault->capture($response->transaction);
$receipt = $response->receipt();
$key = $receipt->DataKey;

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

0 comments on commit dc13140

Please sign in to comment.