-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avs validation #1
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
/** | ||
* @category Hps | ||
* @package Hps_Transit | ||
* @copyright Copyright (c) 2015 Heartland Payment Systems (https://www.magento.com) | ||
* @license https://github.com/hps/transit-magento-extension/blob/master/LICENSE Custom License | ||
*/ | ||
|
||
class Hps_Transit_Model_Source_AvsResultCodes | ||
{ | ||
public function toOptionArray() | ||
{ | ||
return array( | ||
array( | ||
'value' => 'A', | ||
'label' => 'Address matches, zip No Match' | ||
), | ||
array( | ||
'value' => 'N', | ||
'label' => 'Neither address or zip code match' | ||
), | ||
array( | ||
'value' => 'R', | ||
'label' => 'Retry - system unable to respond' | ||
), | ||
array( | ||
'value' => 'U', | ||
'label' => 'Visa / Discover card AVS not supported' | ||
), | ||
array( | ||
'value' => 'S', | ||
'label' => 'Master / Amex card AVS not supported' | ||
), | ||
array( | ||
'value' => 'Z', | ||
'label' => 'Visa / Discover card 9-digit zip code match, address no match' | ||
), | ||
array( | ||
'value' => 'W', | ||
'label' => 'Master / Amex card 9-digit zip code match, address no match' | ||
), | ||
array( | ||
'value' => 'Y', | ||
'label' => 'Visa / Discover card 5-digit zip code and address match' | ||
), | ||
array( | ||
'value' => 'X', | ||
'label' => 'Master / Amex card 5-digit zip code and address match' | ||
), | ||
array( | ||
'value' => 'G', | ||
'label' => 'Address not verified for International transaction' | ||
), | ||
array( | ||
'value' => 'B', | ||
'label' => 'Address match, Zip not verified' | ||
), | ||
array( | ||
'value' => 'C', | ||
'label' => 'Address and zip mismatch' | ||
), | ||
array( | ||
'value' => 'D', | ||
'label' => 'Address and zip match' | ||
), | ||
array( | ||
'value' => 'I', | ||
'label' => 'AVS not verified for International transaction' | ||
), | ||
array( | ||
'value' => 'M', | ||
'label' => 'Street address and postal code matches' | ||
), | ||
array( | ||
'value' => 'P', | ||
'label' => 'Address and Zip not verified' | ||
) | ||
); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be using the individual AVS result codes instead of the gateway's general response code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @slogsdon from the available transit documents which you already shared, I found only these 2 result codes related to AVS/CVV, is there any other document available for the result codes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're performing the comparison against the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok.. updated the result codes |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* @category Hps | ||
* @package Hps_Transit | ||
* @copyright Copyright (c) 2015 Heartland Payment Systems (https://www.magento.com) | ||
* @license https://github.com/hps/transit-magento-extension/blob/master/LICENSE Custom License | ||
*/ | ||
|
||
class Hps_Transit_Model_Source_CvvResultCodes | ||
{ | ||
public function toOptionArray() | ||
{ | ||
return array( | ||
array( | ||
'value' => 'N', | ||
'label' => 'Not Matching' | ||
), | ||
array( | ||
'value' => 'P', | ||
'label' => 'Not Processed' | ||
), | ||
array( | ||
'value' => 'S', | ||
'label' => 'Result not present' | ||
), | ||
array( | ||
'value' => 'U', | ||
'label' => 'Issuer not certified' | ||
), | ||
array( | ||
'value' => '?', | ||
'label' => 'CVV unrecognized' | ||
) | ||
); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be using the individual CVV result codes instead of the gateway's general response code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok.. updated the result codes |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the code inside the if statement will never be run because response code different than '00' throw an exception. An exception is thrown in checkResponse function (https://github.com/hps/php-sdk/blob/962f6826c5938ec9b7c13dbad911970c019057da/src/Gateways/TransITConnector.php#L573).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slogsdon shall we update the PHP SDK to allow the AVS failure code and handle this in plugin side