1 | <?php |
||
34 | class CheckedAddresses extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb |
||
35 | { |
||
36 | /** |
||
37 | * Shop helper object |
||
38 | * |
||
39 | * @var \Payone\Core\Helper\Shop |
||
40 | */ |
||
41 | protected $shopHelper; |
||
42 | |||
43 | /** |
||
44 | * All parameters used for the address hash |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $aHashParams = [ |
||
49 | 'firstname', |
||
50 | 'lastname', |
||
51 | 'company', |
||
52 | 'street', |
||
53 | 'zip', |
||
54 | 'city', |
||
55 | 'country', |
||
56 | 'state', |
||
57 | ]; |
||
58 | |||
59 | /** |
||
60 | * Class constructor |
||
61 | * |
||
62 | * @param \Magento\Framework\Model\ResourceModel\Db\Context $context |
||
63 | * @param \Payone\Core\Helper\Shop $shopHelper |
||
64 | * @param string $connectionName |
||
65 | */ |
||
66 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * Initialize connection and table |
||
77 | * |
||
78 | * @return void |
||
79 | */ |
||
80 | protected function _construct() |
||
84 | |||
85 | /** |
||
86 | * Get address array for hash creation |
||
87 | * |
||
88 | * @param AddressInterface $oAddress |
||
89 | * @return array |
||
90 | */ |
||
91 | protected function getAddressArray(AddressInterface $oAddress) |
||
104 | |||
105 | /** |
||
106 | * Generate a unique hash of an address |
||
107 | * |
||
108 | * @param AddressInterface $oAddress |
||
109 | * @param array $aResponse |
||
110 | * @return string |
||
111 | */ |
||
112 | protected function getHashFromAddress(AddressInterface $oAddress, $aResponse = false) |
||
131 | |||
132 | /** |
||
133 | * Save Api-log entry to database |
||
134 | * |
||
135 | * @param AddressInterface $oAddress |
||
136 | * @param array $aResponse |
||
137 | * @param bool $blIsBonicheck |
||
138 | * @return $this |
||
139 | */ |
||
140 | public function addCheckedAddress(AddressInterface $oAddress, $aResponse, $blIsBonicheck = false) |
||
152 | |||
153 | /** |
||
154 | * Check and return if this exact address has been checked before |
||
155 | * |
||
156 | * @param AddressInterface $oAddress |
||
157 | * @param bool $blIsBonicheck |
||
158 | * @return bool |
||
159 | */ |
||
160 | public function wasAddressCheckedBefore(AddressInterface $oAddress, $blIsBonicheck = false) |
||
195 | } |
||
196 |