From 714b1624ce802ca7a125bc0b56ee51aef65df261 Mon Sep 17 00:00:00 2001 From: Craig Paul Date: Mon, 9 Jan 2017 19:26:13 -0600 Subject: [PATCH] Updates card_verification validation to not require amount --- src/Transaction.php | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/Transaction.php b/src/Transaction.php index 109102a..18c26d9 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -251,6 +251,53 @@ public function valid() case 'res_get_expiring': break; case 'card_verification': + $errors[] = isset($params['order_id']) ? null : [ + 'field' => 'order_id', + 'code' => self::PARAMETER_NOT_SET, + 'title' => 'not_set' + ]; + + $errors[] = isset($params['pan']) ? null : [ + 'field' => 'credit_card', + 'code' => self::PARAMETER_NOT_SET, + 'title' => 'not_set' + ]; + + $errors[] = isset($params['expdate']) ? null : [ + 'field' => 'expdate', + 'code' => self::PARAMETER_NOT_SET, + 'title' => 'not_set' + ]; + + if ($this->gateway->avs) { + $errors[] = isset($params['avs_street_number']) ? null : [ + 'field' => 'avs_street_number', + 'code' => self::PARAMETER_NOT_SET, + 'title' => 'not_set' + ]; + + $errors[] = isset($params['avs_street_name']) ? null : [ + 'field' => 'avs_street_name', + 'code' => self::PARAMETER_NOT_SET, + 'title' => 'not_set' + ]; + + $errors[] = isset($params['avs_zipcode']) ? null : [ + 'field' => 'avs_zipcode', + 'code' => self::PARAMETER_NOT_SET, + 'title' => 'not_set' + ]; + } + + if ($this->gateway->cvd) { + $errors[] = isset($params['cvd']) ? null : [ + 'field' => 'cvd', + 'code' => self::PARAMETER_NOT_SET, + 'title' => 'not_set' + ]; + } + + break; case 'preauth': case 'purchase': $errors[] = isset($params['order_id']) ? null : [