Completed
Pull Request — master (#1)
by Florian
02:46
created
Helper/ConfigExport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,6 +177,6 @@
 block discarded – undo
177 177
         if ($this->getPaymentConfig('allowspecific', $sPaymentCode, $sStoreCode, true) == '1') {
178 178
             return $this->getPaymentConfig('specificcountry', $sPaymentCode, $sStoreCode, true);
179 179
         }
180
-        return '';// empty return value if all countries are available
180
+        return ''; // empty return value if all countries are available
181 181
     }
182 182
 }
Please login to merge, or discard this patch.
Helper/Database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -188,6 +188,6 @@
 block discarded – undo
188 188
         if ($iCount === null) {
189 189
             return 0;
190 190
         }
191
-        return $iCount+1;
191
+        return $iCount + 1;
192 192
     }
193 193
 }
Please login to merge, or discard this patch.
Setup/Tables/Transactionstatus.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
             'cardpan' => ['type' => Table::TYPE_TEXT, 'length' => 32, 'option' => []],
135 135
             'clearing_bankaccountholder' => ['type' => Table::TYPE_TEXT, 'length' => 255, 'option' => []],
136 136
             'clearing_bankaccount' => ['type' => Table::TYPE_TEXT, 'length' => 32, 'option' => []],
137
-            'clearing_bankcode' => ['type' => Table::TYPE_TEXT, 'length' => 32, 'option' => [],],
137
+            'clearing_bankcode' => ['type' => Table::TYPE_TEXT, 'length' => 32, 'option' => [], ],
138 138
             'clearing_bankname' => ['type' => Table::TYPE_TEXT, 'length' => 255, 'option' => []],
139 139
             'clearing_bankbic' => ['type' => Table::TYPE_TEXT, 'length' => 32, 'option' => []],
140 140
             'clearing_bankiban' => ['type' => Table::TYPE_TEXT, 'length' => 32, 'option' => []],
Please login to merge, or discard this patch.
Model/Entities/TransactionStatus.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         $sRequest = $this->getData($sKey);
76 76
         if ($sRequest) {
77 77
             if (Toolkit::isUTF8($sRequest)) {
78
-                $sRequest = utf8_decode($sRequest);// needed for unserializing the array
78
+                $sRequest = utf8_decode($sRequest); // needed for unserializing the array
79 79
             }
80 80
             $aRequest = unserialize($sRequest);
81 81
             if (is_array($aRequest)) {
Please login to merge, or discard this patch.
Model/ResourceModel/TransactionStatus.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
         $aRequest = $oContext->getRequest()->getPostValue();
109 109
         $sRawStatus = serialize($aRequest);
110 110
         if (!Toolkit::isUTF8($sRawStatus)) {
111
-            $sRawStatus = utf8_encode($sRawStatus);// needed for serializing the array
111
+            $sRawStatus = utf8_encode($sRawStatus); // needed for serializing the array
112 112
         }
113 113
         $sOrderId = $oOrder !== null ? $oOrder->getIncrementId() : '';
114 114
         $this->getConnection()->insert(
Please login to merge, or discard this patch.
Model/PayoneConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@
 block discarded – undo
58 58
     const TRANSACTIONSTATUS_REMINDER = 'reminder';
59 59
     const TRANSACTIONSTATUS_VAUTHORIZATION = 'vauthorization';
60 60
     const TRANSACTIONSTATUS_VSETTLEMENT = 'vsettlement';
61
-    const TRANSACTIONSTATUS_TRANSFER= 'transfer';
62
-    const TRANSACTIONSTATUS_INVOICE= 'invoice';
61
+    const TRANSACTIONSTATUS_TRANSFER = 'transfer';
62
+    const TRANSACTIONSTATUS_INVOICE = 'invoice';
63 63
 
64 64
     /* Payment method codes */
65 65
     const METHOD_CREDITCARD = 'payone_creditcard';
Please login to merge, or discard this patch.
Model/Api/Request/Debit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,19 +86,19 @@
 block discarded – undo
86 86
         $oOrder = $oPaymentInfo->getOrder();
87 87
         $iTxid = $oPaymentInfo->getParentTransactionId();
88 88
         if (strpos($iTxid, '-') !== false) {
89
-            $iTxid = substr($iTxid, 0, strpos($iTxid, '-'));// clean the txid from the magento-suffixes
89
+            $iTxid = substr($iTxid, 0, strpos($iTxid, '-')); // clean the txid from the magento-suffixes
90 90
         }
91 91
 
92 92
         $this->setOrderId($oOrder->getRealOrderId());
93 93
 
94 94
         $this->addParameter('request', 'debit'); // Request method
95
-        $this->addParameter('mode', $oPayment->getOperationMode());// PayOne Portal Operation Mode (live or test)
95
+        $this->addParameter('mode', $oPayment->getOperationMode()); // PayOne Portal Operation Mode (live or test)
96 96
         $this->addParameter('txid', $iTxid); // PayOne Transaction ID
97 97
         $this->addParameter('sequencenumber', $this->databaseHelper->getSequenceNumber($iTxid));
98 98
 
99 99
         // Total order sum in smallest currency unit
100
-        $this->addParameter('amount', number_format((-1 * $dAmount), 2, '.', '')*100);
101
-        $this->addParameter('currency', $oOrder->getOrderCurrencyCode());// Currency
100
+        $this->addParameter('amount', number_format((-1 * $dAmount), 2, '.', '') * 100);
101
+        $this->addParameter('currency', $oOrder->getOrderCurrencyCode()); // Currency
102 102
         $this->addParameter('transactiontype', 'GT');
103 103
 
104 104
         $sRefundAppendix = $this->getRefundAppendix($oOrder, $oPayment);
Please login to merge, or discard this patch.
Model/Api/Request/Getfile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
                 'content' => http_build_query($this->aParameters),
66 66
             ],
67 67
         ];
68
-        $oContext  = stream_context_create($aOptions);
68
+        $oContext = stream_context_create($aOptions);
69 69
         $sMandate = file_get_contents($this->sApiUrl, false, $oContext);
70 70
         if ($sMandate !== false) {
71 71
             $sReturn = $sMandate;
Please login to merge, or discard this patch.
Model/Api/Request/Authorization.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -116,20 +116,20 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function sendRequest(PayoneMethod $oPayment, Order $oOrder, $dAmount)
118 118
     {
119
-        $this->setOrderId($oOrder->getRealOrderId());// save order id to object for later use
119
+        $this->setOrderId($oOrder->getRealOrderId()); // save order id to object for later use
120 120
 
121
-        $this->addParameter('request', $oPayment->getAuthorizationMode());// add request type
122
-        $this->addParameter('mode', $oPayment->getOperationMode());// add mode ( live or test )
123
-        $this->addParameter('customerid', $oOrder->getCustomerId());// add customer id
124
-        $this->addParameter('aid', $this->shopHelper->getConfigParam('aid'));// add sub account id
125
-        $this->setAuthorizationParameters($oPayment, $oOrder, $dAmount);// set authorization params
121
+        $this->addParameter('request', $oPayment->getAuthorizationMode()); // add request type
122
+        $this->addParameter('mode', $oPayment->getOperationMode()); // add mode ( live or test )
123
+        $this->addParameter('customerid', $oOrder->getCustomerId()); // add customer id
124
+        $this->addParameter('aid', $this->shopHelper->getConfigParam('aid')); // add sub account id
125
+        $this->setAuthorizationParameters($oPayment, $oOrder, $dAmount); // set authorization params
126 126
         if ($oPayment->hasCustomConfig()) {// if payment type doesnt use the global settings
127
-            $this->addCustomParameters($oPayment);// add custom connection settings
127
+            $this->addCustomParameters($oPayment); // add custom connection settings
128 128
         }
129 129
 
130
-        $aResponse = $this->send();// send request to PAYONE Server API
130
+        $aResponse = $this->send(); // send request to PAYONE Server API
131 131
 
132
-        $this->apiHelper->addPayoneOrderData($oOrder, $this->getParameters(), $aResponse);// add payone data to order
132
+        $this->apiHelper->addPayoneOrderData($oOrder, $this->getParameters(), $aResponse); // add payone data to order
133 133
 
134 134
         return $aResponse;
135 135
     }
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
      */
144 144
     protected function setUserParameters(PayoneMethod $oPayment, Order $oOrder)
145 145
     {
146
-        $oQuote = $this->checkoutSession->getQuote();// get quote from session
147
-        $oCustomer = $oQuote->getCustomer();// get customer object from quote
146
+        $oQuote = $this->checkoutSession->getQuote(); // get quote from session
147
+        $oCustomer = $oQuote->getCustomer(); // get customer object from quote
148 148
         $this->addUserDataParameters($oOrder->getBillingAddress(), $oPayment, $oCustomer->getGender(), $oOrder->getCustomerEmail(), $oCustomer->getDob());
149 149
 
150 150
         $oShipping = $oOrder->getShippingAddress(); // get shipping address from order
151 151
         if ($oShipping) {// shipping address existing?
152
-            $this->addAddress($oShipping, true);// add regular shipping address
152
+            $this->addAddress($oShipping, true); // add regular shipping address
153 153
         } elseif ($oPayment->getCode() == PayoneConfig::METHOD_PAYPAL && $this->shopHelper->getConfigParam('bill_as_del_address', PayoneConfig::METHOD_PAYPAL, 'payone_payment')) {
154
-            $this->addAddress($oOrder->getBillingAddress(), true);// add billing address as shipping address
154
+            $this->addAddress($oOrder->getBillingAddress(), true); // add billing address as shipping address
155 155
         }
156 156
     }
157 157
 
@@ -165,22 +165,22 @@  discard block
 block discarded – undo
165 165
      */
166 166
     protected function setAuthorizationParameters(PayoneMethod $oPayment, Order $oOrder, $dAmount)
167 167
     {
168
-        $sRefNr = $this->shopHelper->getConfigParam('ref_prefix').$oOrder->getIncrementId();// ref_prefix to prevent duplicate refnumbers in testing environments
169
-        $sRefNr = $oPayment->formatReferenceNumber($sRefNr);// some payment methods have refnr regulations
170
-        $this->addParameter('reference', $sRefNr);// add ref-nr to request
171
-        $this->addParameter('amount', number_format($dAmount, 2, '.', '')*100);// add price to request
172
-        $this->addParameter('currency', $oOrder->getOrderCurrencyCode());// add currency to request
168
+        $sRefNr = $this->shopHelper->getConfigParam('ref_prefix').$oOrder->getIncrementId(); // ref_prefix to prevent duplicate refnumbers in testing environments
169
+        $sRefNr = $oPayment->formatReferenceNumber($sRefNr); // some payment methods have refnr regulations
170
+        $this->addParameter('reference', $sRefNr); // add ref-nr to request
171
+        $this->addParameter('amount', number_format($dAmount, 2, '.', '') * 100); // add price to request
172
+        $this->addParameter('currency', $oOrder->getOrderCurrencyCode()); // add currency to request
173 173
         if ($this->shopHelper->getConfigParam('transmit_ip') == '1') {// is IP transmission needed?
174
-            $sIp = $this->environmentHelper->getRemoteIp();// get remote IP
174
+            $sIp = $this->environmentHelper->getRemoteIp(); // get remote IP
175 175
             if ($sIp != '') {// is IP not empty
176
-                $this->addParameter('ip', $sIp);// add IP address to the request
176
+                $this->addParameter('ip', $sIp); // add IP address to the request
177 177
             }
178 178
         }
179
-        $this->setUserParameters($oPayment, $oOrder);// add user data - addresses etc.
180
-        $this->setPaymentParameters($oPayment, $oOrder);// add payment specific parameters
179
+        $this->setUserParameters($oPayment, $oOrder); // add user data - addresses etc.
180
+        $this->setPaymentParameters($oPayment, $oOrder); // add payment specific parameters
181 181
 
182 182
         if ($this->apiHelper->isInvoiceDataNeeded($oPayment)) {//
183
-            $this->invoiceGenerator->addProductInfo($this, $oOrder);// add invoice parameters
183
+            $this->invoiceGenerator->addProductInfo($this, $oOrder); // add invoice parameters
184 184
         }
185 185
     }
186 186
 
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
      */
194 194
     protected function setPaymentParameters(PayoneMethod $oPayment, Order $oOrder)
195 195
     {
196
-        $this->addParameter('clearingtype', $oPayment->getClearingtype());// add payment type to request
196
+        $this->addParameter('clearingtype', $oPayment->getClearingtype()); // add payment type to request
197 197
         $sNarrativeText = $this->toolkitHelper->getNarrativeText($oOrder, $oPayment);
198 198
         if (!empty($sNarrativeText)) {// narrative text existing?
199
-            $this->addParameter('narrative_text', $sNarrativeText);// add narrative text parameter
199
+            $this->addParameter('narrative_text', $sNarrativeText); // add narrative text parameter
200 200
         }
201
-        $aPaymentParams = $oPayment->getPaymentSpecificParameters($oOrder);// get payment params specific to the payment type
202
-        $this->aParameters = array_merge($this->aParameters, $aPaymentParams);// merge payment params with other params
201
+        $aPaymentParams = $oPayment->getPaymentSpecificParameters($oOrder); // get payment params specific to the payment type
202
+        $this->aParameters = array_merge($this->aParameters, $aPaymentParams); // merge payment params with other params
203 203
         if ($oPayment->needsRedirectUrls() === true) {// does the used payment type need redirect urls?
204
-            $this->addRedirectUrls($oPayment);// add needed redirect urls
204
+            $this->addRedirectUrls($oPayment); // add needed redirect urls
205 205
         }
206 206
     }
207 207
 
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
     protected function addCustomParameters(PayoneMethod $oPayment)
215 215
     {
216 216
         foreach ($this->aCustomParamMap as $sParamName => $sConfigName) {// add all custom parameters
217
-            $sCustomConfig = $oPayment->getCustomConfigParam($sConfigName);// get custom config param
217
+            $sCustomConfig = $oPayment->getCustomConfigParam($sConfigName); // get custom config param
218 218
             if (!empty($sCustomConfig)) {// only add if the param is configured
219
-                $this->addParameter($sParamName, $sCustomConfig);// add custom param to request
219
+                $this->addParameter($sParamName, $sCustomConfig); // add custom param to request
220 220
             }
221 221
         }
222 222
     }
Please login to merge, or discard this patch.