@@ -120,14 +120,14 @@ discard block |
||
120 | 120 | */ |
121 | 121 | protected function initRequest() |
122 | 122 | { |
123 | - $this->addParameter('mid', $this->shopHelper->getConfigParam('mid'));// PayOne Merchant ID |
|
124 | - $this->addParameter('portalid', $this->shopHelper->getConfigParam('portalid'));// PayOne Portal ID |
|
125 | - $this->addParameter('key', md5($this->shopHelper->getConfigParam('key')));// PayOne Portal Key |
|
126 | - $this->addParameter('encoding', $this->environmentHelper->getEncoding());// Encoding |
|
127 | - $this->addParameter('integrator_name', 'Magento2');// Shop-system |
|
128 | - $this->addParameter('integrator_version', $this->shopHelper->getMagentoVersion());// Shop version |
|
129 | - $this->addParameter('solution_name', 'fatchip');// Company developing the module |
|
130 | - $this->addParameter('solution_version', PayoneConfig::MODULE_VERSION);// Module version |
|
123 | + $this->addParameter('mid', $this->shopHelper->getConfigParam('mid')); // PayOne Merchant ID |
|
124 | + $this->addParameter('portalid', $this->shopHelper->getConfigParam('portalid')); // PayOne Portal ID |
|
125 | + $this->addParameter('key', md5($this->shopHelper->getConfigParam('key'))); // PayOne Portal Key |
|
126 | + $this->addParameter('encoding', $this->environmentHelper->getEncoding()); // Encoding |
|
127 | + $this->addParameter('integrator_name', 'Magento2'); // Shop-system |
|
128 | + $this->addParameter('integrator_version', $this->shopHelper->getMagentoVersion()); // Shop version |
|
129 | + $this->addParameter('solution_name', 'fatchip'); // Company developing the module |
|
130 | + $this->addParameter('solution_version', PayoneConfig::MODULE_VERSION); // Module version |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | public function addParameter($sKey, $sValue, $blAddAsNullIfEmpty = false) |
142 | 142 | { |
143 | 143 | if ($blAddAsNullIfEmpty === true && empty($sValue)) { |
144 | - $sValue = 'NULL';// add value as string NULL - needed in certain situations |
|
144 | + $sValue = 'NULL'; // add value as string NULL - needed in certain situations |
|
145 | 145 | } |
146 | 146 | $this->aParameters[$sKey] = $sValue; |
147 | 147 | } |
@@ -251,8 +251,8 @@ discard block |
||
251 | 251 | return $sRequestUrl; |
252 | 252 | } |
253 | 253 | |
254 | - $aResponse = $this->apiHelper->sendApiRequest($sRequestUrl);// send request to PAYONE |
|
255 | - $this->apiLog->addApiLogEntry($this, $aResponse, $aResponse['status']);// log request to db |
|
254 | + $aResponse = $this->apiHelper->sendApiRequest($sRequestUrl); // send request to PAYONE |
|
255 | + $this->apiLog->addApiLogEntry($this, $aResponse, $aResponse['status']); // log request to db |
|
256 | 256 | return $aResponse; |
257 | 257 | } |
258 | 258 | } |
@@ -48,10 +48,10 @@ |
||
48 | 48 | { |
49 | 49 | $this->addParameter('request', 'genericpayment'); |
50 | 50 | $this->addParameter('mode', $oPayment->getOperationMode()); |
51 | - $this->addParameter('aid', $this->shopHelper->getConfigParam('aid'));// ID of PayOne Sub-Account |
|
51 | + $this->addParameter('aid', $this->shopHelper->getConfigParam('aid')); // ID of PayOne Sub-Account |
|
52 | 52 | $this->addParameter('clearingtype', 'wlt'); |
53 | 53 | $this->addParameter('wallettype', 'PPE'); |
54 | - $this->addParameter('amount', number_format($oQuote->getGrandTotal(), 2, '.', '')*100); |
|
54 | + $this->addParameter('amount', number_format($oQuote->getGrandTotal(), 2, '.', '') * 100); |
|
55 | 55 | $this->addParameter('currency', $oQuote->getQuoteCurrencyCode()); |
56 | 56 | $this->addParameter('narrative_text', 'Test'); |
57 | 57 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $sPre = ''; |
79 | 79 | if ($blIsShipping === true) { |
80 | - $sPre = 'shipping_';// add shipping prefix for shipping addresses |
|
80 | + $sPre = 'shipping_'; // add shipping prefix for shipping addresses |
|
81 | 81 | } |
82 | 82 | $this->addParameter($sPre.'firstname', $oAddress->getFirstname()); |
83 | 83 | $this->addParameter($sPre.'lastname', $oAddress->getLastname()); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | $aStreet = $oAddress->getStreet(); |
89 | - $sStreet = is_array($aStreet) ? implode(' ', $aStreet) : $aStreet;// street may be an array |
|
89 | + $sStreet = is_array($aStreet) ? implode(' ', $aStreet) : $aStreet; // street may be an array |
|
90 | 90 | $this->addParameter($sPre.'street', trim($sStreet)); |
91 | 91 | $this->addParameter($sPre.'zip', $oAddress->getPostcode()); |
92 | 92 | $this->addParameter($sPre.'city', $oAddress->getCity()); |
@@ -77,8 +77,8 @@ |
||
77 | 77 | $oCustomer = $oQuote->getCustomer(); |
78 | 78 | |
79 | 79 | $this->addParameter('request', 'managemandate'); // Request method |
80 | - $this->addParameter('mode', $oPayment->getOperationMode());// PayOne Portal Operation Mode (live or test) |
|
81 | - $this->addParameter('aid', $this->shopHelper->getConfigParam('aid'));// ID of PayOne Sub-Account |
|
80 | + $this->addParameter('mode', $oPayment->getOperationMode()); // PayOne Portal Operation Mode (live or test) |
|
81 | + $this->addParameter('aid', $this->shopHelper->getConfigParam('aid')); // ID of PayOne Sub-Account |
|
82 | 82 | $this->addParameter('clearingtype', 'elv'); |
83 | 83 | |
84 | 84 | $this->addParameter('customerid', $oCustomer->getId()); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | array $meta = [], |
71 | 71 | array $data = [] |
72 | 72 | ) { |
73 | - $this->databaseHelper = $databaseHelper;// needs to be in front of constructor, doesnt work otherwise for no apparent reason |
|
73 | + $this->databaseHelper = $databaseHelper; // needs to be in front of constructor, doesnt work otherwise for no apparent reason |
|
74 | 74 | parent::__construct($name, $primaryFieldName, $requestFieldName, $reporting, $searchCritBuilder, $request, $filterBuilder, $meta, $data); |
75 | 75 | } |
76 | 76 |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function getInstructions() |
237 | 237 | { |
238 | - return trim($this->getConfigData('instructions'));// return description text |
|
238 | + return trim($this->getConfigData('instructions')); // return description text |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | { |
248 | 248 | $sRequestType = $this->getAuthorizationMode(); |
249 | 249 | if ($sRequestType == PayoneConfig::REQUEST_TYPE_PREAUTHORIZATION) { |
250 | - return AbstractMethod::ACTION_AUTHORIZE;// only create order |
|
250 | + return AbstractMethod::ACTION_AUTHORIZE; // only create order |
|
251 | 251 | } elseif ($sRequestType == PayoneConfig::REQUEST_TYPE_AUTHORIZATION) { |
252 | - return AbstractMethod::ACTION_AUTHORIZE_CAPTURE;// create order and capture |
|
252 | + return AbstractMethod::ACTION_AUTHORIZE_CAPTURE; // create order and capture |
|
253 | 253 | } |
254 | 254 | } |
255 | 255 | |
@@ -262,9 +262,9 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function authorize(InfoInterface $payment, $amount) |
264 | 264 | { |
265 | - $oReturn = parent::authorize($payment, $amount);// execute Magento parent authorization |
|
266 | - $this->sendPayoneAuthorization($payment, $amount);// send auth request to PAYONE |
|
267 | - return $oReturn;// return magento parent auth value |
|
265 | + $oReturn = parent::authorize($payment, $amount); // execute Magento parent authorization |
|
266 | + $this->sendPayoneAuthorization($payment, $amount); // send auth request to PAYONE |
|
267 | + return $oReturn; // return magento parent auth value |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | /** |
@@ -276,9 +276,9 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public function refund(InfoInterface $payment, $amount) |
278 | 278 | { |
279 | - $oReturn = parent::refund($payment, $amount);// execute Magento parent refund |
|
280 | - $this->sendPayoneDebit($payment, $amount);// send debit request to PAYONE |
|
281 | - return $oReturn;// return magento parent refund value |
|
279 | + $oReturn = parent::refund($payment, $amount); // execute Magento parent refund |
|
280 | + $this->sendPayoneDebit($payment, $amount); // send debit request to PAYONE |
|
281 | + return $oReturn; // return magento parent refund value |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
@@ -290,13 +290,13 @@ discard block |
||
290 | 290 | */ |
291 | 291 | public function capture(InfoInterface $payment, $amount) |
292 | 292 | { |
293 | - $oReturn = parent::capture($payment, $amount);// execute Magento parent capture |
|
293 | + $oReturn = parent::capture($payment, $amount); // execute Magento parent capture |
|
294 | 294 | if ($payment->getParentTransactionId()) {// does the order already have a transaction? |
295 | - $this->sendPayoneCapture($payment, $amount);// is probably admin invoice capture |
|
295 | + $this->sendPayoneCapture($payment, $amount); // is probably admin invoice capture |
|
296 | 296 | } else { |
297 | - $this->sendPayoneAuthorization($payment, $amount);// is probably frontend checkout capture |
|
297 | + $this->sendPayoneAuthorization($payment, $amount); // is probably frontend checkout capture |
|
298 | 298 | } |
299 | - return $oReturn;// return magento parent capture value |
|
299 | + return $oReturn; // return magento parent capture value |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -311,12 +311,12 @@ discard block |
||
311 | 311 | $iAllowSpecific = $this->shopHelper->getConfigParam('allowspecific'); |
312 | 312 | $aAvailableCountries = explode(',', $this->shopHelper->getConfigParam('specificcountry')); |
313 | 313 | if ($this->hasCustomConfig()) {// check for non-global configuration |
314 | - $iAllowSpecific = $this->getCustomConfigParam('allowspecific');// only specific countries allowed? |
|
315 | - $aAvailableCountries = explode(',', $this->getCustomConfigParam('specificcountry'));// get allowed countries |
|
314 | + $iAllowSpecific = $this->getCustomConfigParam('allowspecific'); // only specific countries allowed? |
|
315 | + $aAvailableCountries = explode(',', $this->getCustomConfigParam('specificcountry')); // get allowed countries |
|
316 | 316 | } |
317 | 317 | if ($iAllowSpecific == 1 && !in_array($country, $aAvailableCountries)) {// only specific but not included |
318 | - return false;// cant use for given country |
|
318 | + return false; // cant use for given country |
|
319 | 319 | } |
320 | - return true;// can use for given country |
|
320 | + return true; // can use for given country |
|
321 | 321 | } |
322 | 322 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | protected function sendPayoneAuthorization(InfoInterface $payment, $amount) |
112 | 112 | { |
113 | 113 | $oOrder = $payment->getOrder(); |
114 | - $this->checkoutSession->unsPayoneRedirectUrl();// remove redirect url from session |
|
114 | + $this->checkoutSession->unsPayoneRedirectUrl(); // remove redirect url from session |
|
115 | 115 | $aResponse = $this->authorizationRequest->sendRequest($this, $oOrder, $amount); |
116 | 116 | $this->handleResponse($aResponse); |
117 | 117 | if ($aResponse['status'] == 'ERROR') {// request returned an error |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function getPaymentSpecificParameters(Order $oOrder) |
156 | 156 | { |
157 | - return [];// filled in child classes |
|
157 | + return []; // filled in child classes |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function getSubTypeSpecificParameters(Order $oOrder) |
274 | 274 | { |
275 | - return [];// filled in child classes |
|
275 | + return []; // filled in child classes |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -116,7 +116,7 @@ |
||
116 | 116 | * Returns formatted birthday if possible |
117 | 117 | * |
118 | 118 | * @param DataObject $data |
119 | - * @return string|bool |
|
119 | + * @return string|false |
|
120 | 120 | */ |
121 | 121 | protected function getFormattedBirthday(DataObject $data) |
122 | 122 | { |
@@ -116,7 +116,7 @@ |
||
116 | 116 | * Returns formatted birthday if possible |
117 | 117 | * |
118 | 118 | * @param DataObject $data |
119 | - * @return string|bool |
|
119 | + * @return string|false |
|
120 | 120 | */ |
121 | 121 | protected function getFormattedBirthday(DataObject $data) |
122 | 122 | { |