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

Commit

Permalink
Updates card_verification validation to not require amount
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Jan 10, 2017
1 parent cb3b75e commit 714b162
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : [
Expand Down

0 comments on commit 714b162

Please sign in to comment.