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

Commit

Permalink
Adds vault pre authorization functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 23, 2016
1 parent d6c0e3e commit faa56b3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public function valid()
$errors[] = Validator::set($params, 'data_key') ? null : 'Data key not provided.';

break;
case 'res_preauth_cc':
case 'res_purchase_cc':
$errors[] = Validator::set($params, 'data_key') ? null : 'Data key not provided.';
$errors[] = Validator::set($params, 'order_id') ? null : 'Order id not provided.';
Expand Down
19 changes: 19 additions & 0 deletions src/Vault.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,25 @@ public function peek(string $key, bool $full = false)
return $this->process($transaction);
}

/**
* Pre-authorize a purchase.
*
* @param array $params
*
* @return \CraigPaul\Moneris\Response
*/
public function preauth(array $params = [])
{
$params = array_merge($params, [
'type' => 'res_preauth_cc',
'crypt_type' => Crypt::SSL_ENABLED_MERCHANT,
]);

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

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

/**
* Make a purchase.
*
Expand Down

0 comments on commit faa56b3

Please sign in to comment.