Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-paypal
Model
Payflow
Service
Response
Validator
AVSResponse.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Paypal\Model\Payflow\Service\Response\Validator
;
7
8
use
Magento\Framework\DataObject
;
9
use
Magento\Paypal\Model\Payflow\Service\Response\ValidatorInterface
;
10
use
Magento\Paypal\Model\Payflow\Transparent
;
11
15
class
AVSResponse
implements
ValidatorInterface
16
{
22
const
AVSADDR
=
'avsaddr'
;
23
29
const
AVSZIP
=
'avszip'
;
30
41
const
IAVS
=
'iavs'
;
42
44
const
RESPONSE_YES
=
'y'
;
45
46
const
RESPONSE_NO
=
'n'
;
47
48
const
RESPONSE_NOT_SUPPORTED
=
'x'
;
52
const
CONFIG_ON
= 1;
53
54
const
CONFIG_OFF
= 0;
58
protected
$avsCheck
= [
59
'avsaddr'
=>
'avs_street'
,
60
'avszip'
=>
'avs_zip'
,
61
];
62
66
protected
$errorsMessages
= [
67
'avs_street'
=>
'AVS address does not match.'
,
68
'avs_zip'
=>
'AVS zip does not match.'
,
69
];
70
78
public
function
validate
(
DataObject
$response
,
Transparent
$transparentModel)
79
{
80
$config
= $transparentModel->
getConfig
();
81
foreach
($this->avsCheck as $fieldName => $settingName) {
82
if
(
$config
->getValue($settingName) == static::CONFIG_ON
83
&& strtolower((
string
)
$response
->getData($fieldName)) === static::RESPONSE_NO
84
) {
85
$response
->setRespmsg($this->errorsMessages[$settingName]);
86
return
false
;
87
}
88
}
89
90
return
true
;
91
}
92
}
$response
$response
Definition:
404.php:11
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\AVSADDR
const AVSADDR
Definition:
AVSResponse.php:22
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\$avsCheck
$avsCheck
Definition:
AVSResponse.php:58
Magento\Paypal\Model\Payflowpro\getConfig
getConfig()
Definition:
Payflowpro.php:571
$config
$config
Definition:
fraud_order.php:17
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\RESPONSE_NOT_SUPPORTED
const RESPONSE_NOT_SUPPORTED
Definition:
AVSResponse.php:48
Magento\Paypal\Model\Payflow\Service\Response\Validator
Definition:
AVSResponse.php:6
Magento\Framework\DataObject
Definition:
DataObject.php:15
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\CONFIG_ON
const CONFIG_ON
Definition:
AVSResponse.php:52
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\IAVS
const IAVS
Definition:
AVSResponse.php:41
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\RESPONSE_YES
const RESPONSE_YES
Definition:
AVSResponse.php:44
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\CONFIG_OFF
const CONFIG_OFF
Definition:
AVSResponse.php:54
Magento\Paypal\Model\Payflow\Service\Response\ValidatorInterface
Definition:
ValidatorInterface.php:14
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\AVSZIP
const AVSZIP
Definition:
AVSResponse.php:29
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse
Definition:
AVSResponse.php:15
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\$errorsMessages
$errorsMessages
Definition:
AVSResponse.php:66
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\validate
validate(DataObject $response, Transparent $transparentModel)
Definition:
AVSResponse.php:78
Magento\Paypal\Model\Payflow\Transparent
Definition:
Transparent.php:29
Magento\Paypal\Model\Payflow\Service\Response\Validator\AVSResponse\RESPONSE_NO
const RESPONSE_NO
Definition:
AVSResponse.php:46
Magento\Framework\DataObject
Definition:
Cache.php:6