diff --git a/src/Gateway.php b/src/Gateway.php index 309a4c4..fc73319 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -150,4 +150,23 @@ protected function transaction(array $params = null) return $this->transaction; } + + /** + * Validate CVD and/or AVS prior to attempting a purchase. + * + * @param array $params + * + * @return \CraigPaul\Moneris\Response + */ + public function verify(array $params = []) + { + $params = array_merge($params, [ + 'type' => 'card_verification', + 'crypt_type' => Crypt::SSL_ENABLED_MERCHANT, + ]); + + $transaction = $this->transaction($params); + + return $this->process($transaction); + } } \ No newline at end of file diff --git a/src/Transaction.php b/src/Transaction.php index e202889..01c2e40 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -165,6 +165,7 @@ public function valid() if (isset($params['type'])) { switch ($params['type']) { + case 'card_verification': case 'preauth': case 'purchase': $errors[] = Validator::set($params, 'order_id') ? null : 'Order Id not provided.';