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

Commit

Permalink
Adds update credit card test
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 21, 2016
1 parent c38a72b commit eb342d1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/VaultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,25 @@ public function it_can_add_a_credit_card_to_the_moneris_vault_and_returns_a_data
$this->assertTrue($response->successful);
$this->assertNotNull($receipt->DataKey);
}

/** @test */
public function it_can_update_a_credit_card_in_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;

$this->assertEquals('2012', $response->transaction->params['expdate']);

$card->expiry = '2112';

$response = $this->vault->update($key, $card);
$receipt = $response->receipt();

$this->assertTrue($response->successful);
$this->assertNotNull($receipt->DataKey);
$this->assertEquals($key, $receipt->DataKey);
$this->assertEquals('2112', $response->transaction->params['expdate']);
}
}

0 comments on commit eb342d1

Please sign in to comment.