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 functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 21, 2016
1 parent 445ed72 commit c38a72b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Vault.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,25 @@ public static function create(string $id, string $token, string $environment)
{
return new static($id, $token, $environment);
}

/**
* @param string $key
* @param \CraigPaul\Moneris\CreditCard $card
*
* @return \CraigPaul\Moneris\Response
*/
public function update(string $key, CreditCard $card)
{
$params = [
'type' => 'res_update_cc',
'data_key' => $key,
'crypt_type' => $card->crypt,
'pan' => $card->number,
'expdate' => $card->expiry,
];

$transaction = $this->transaction($params);

return $this->process($transaction);
}
}

0 comments on commit c38a72b

Please sign in to comment.