Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
IAVSResponse.php
Go to the documentation of this file.
1 <?php
7 
11 
17 {
23  private static $iavs = 'iavs';
24 
28  private static $negativeResponseCode = 'y';
29 
33  public function validate(DataObject $response, Transparent $transparentModel)
34  {
35  $config = $transparentModel->getConfig();
36  // the IAVS configuration setting is not enabled
37  if (!$config->getValue('avs_international')) {
38  return true;
39  }
40 
41  if (strtolower((string) $response->getData(self::$iavs)) === self::$negativeResponseCode) {
42  $response->setRespmsg('International AVS indicator does not match.');
43  return false;
44  }
45 
46  return true;
47  }
48 }
$response
Definition: 404.php:11
$config
Definition: fraud_order.php:17
validate(DataObject $response, Transparent $transparentModel)