@@ -50,7 +50,7 @@ |
||
50 | 50 | * |
51 | 51 | * @param \Magento\Backend\Block\Template\Context $context |
52 | 52 | * @param \Magento\Framework\Data\Form\Element\Factory $elementFactory |
53 | - * @param \Payone\Core\Model\Source\TransactionStatus $klarnaCountries |
|
53 | + * @param \Payone\Core\Model\Source\KlarnaCountry $klarnaCountries |
|
54 | 54 | * @param array $data |
55 | 55 | * @return void |
56 | 56 | */ |
@@ -66,7 +66,7 @@ |
||
66 | 66 | /** |
67 | 67 | * Returns the mandate text |
68 | 68 | * |
69 | - * @return string|bool |
|
69 | + * @return string|false |
|
70 | 70 | */ |
71 | 71 | public function getMandateText() |
72 | 72 | { |
@@ -43,7 +43,6 @@ |
||
43 | 43 | * |
44 | 44 | * @param \Magento\Framework\App\Action\Context $context |
45 | 45 | * @param \Magento\Checkout\Model\Session $checkoutSession |
46 | - * @param \Magento\Framework\Url\Helper\Data $urlHelper |
|
47 | 46 | * @return void |
48 | 47 | */ |
49 | 48 | public function __construct( |
@@ -78,7 +78,7 @@ |
||
78 | 78 | /** |
79 | 79 | * Redirect to payment-provider or to success page |
80 | 80 | * |
81 | - * @return void |
|
81 | + * @return \Magento\Framework\Controller\Result\Redirect |
|
82 | 82 | */ |
83 | 83 | public function execute() |
84 | 84 | { |
@@ -142,6 +142,7 @@ |
||
142 | 142 | /** |
143 | 143 | * Generate the request url out of the params and die api url |
144 | 144 | * |
145 | + * @param string $sApiUrl |
|
145 | 146 | * @return string |
146 | 147 | */ |
147 | 148 | public function getRequestUrl($aParameters, $sApiUrl) |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | foreach ($aResponse as $iLinenum => $sLine) {// go through line by line |
130 | 130 | $iPos = strpos($sLine, "="); |
131 | 131 | if ($iPos > 0) {// is a "=" as delimiter existing? |
132 | - $aOutput[substr($sLine, 0, $iPos)] = trim(substr($sLine, $iPos+1)); |
|
132 | + $aOutput[substr($sLine, 0, $iPos)] = trim(substr($sLine, $iPos + 1)); |
|
133 | 133 | } elseif (!empty($sLine)) {// is line not empty? |
134 | - $aOutput[$iLinenum] = $sLine;// add the line unedited |
|
134 | + $aOutput[$iLinenum] = $sLine; // add the line unedited |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | } |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | public function addPayoneOrderData(SalesOrder $oOrder, $aRequest, $aResponse) |
172 | 172 | { |
173 | 173 | if (isset($aResponse['txid'])) {// txid existing? |
174 | - $oOrder->setPayoneTxid($aResponse['txid']);// add txid to order entity |
|
174 | + $oOrder->setPayoneTxid($aResponse['txid']); // add txid to order entity |
|
175 | 175 | } |
176 | - $oOrder->setPayoneRefnr($aRequest['reference']);// add refnr to order entity |
|
177 | - $oOrder->setPayoneAuthmode($aRequest['request']);// add authmode to order entity |
|
178 | - $oOrder->setPayoneMode($aRequest['mode']);// add payone mode to order entity |
|
176 | + $oOrder->setPayoneRefnr($aRequest['reference']); // add refnr to order entity |
|
177 | + $oOrder->setPayoneAuthmode($aRequest['request']); // add authmode to order entity |
|
178 | + $oOrder->setPayoneMode($aRequest['mode']); // add payone mode to order entity |
|
179 | 179 | if (isset($aRequest['mandate_identification'])) {// mandate id existing in request? |
180 | 180 | $oOrder->setPayoneMandateId($aRequest['mandate_identification']); |
181 | 181 | } elseif (isset($aResponse['mandate_identification'])) {// mandate id existing in response? |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function isInvoiceDataNeeded(PayoneMethod $oPayment) |
193 | 193 | { |
194 | - $sType = $this->getConfigParam('request_type');// auth or preauth? |
|
195 | - $blInvoiceEnabled = (bool)$this->getConfigParam('transmit_enabled', 'invoicing');// invoicing enabled? |
|
194 | + $sType = $this->getConfigParam('request_type'); // auth or preauth? |
|
195 | + $blInvoiceEnabled = (bool)$this->getConfigParam('transmit_enabled', 'invoicing'); // invoicing enabled? |
|
196 | 196 | if ($oPayment->needsProductInfo() || ($sType == PayoneConfig::REQUEST_TYPE_AUTHORIZATION && $blInvoiceEnabled)) { |
197 | - return true;// invoice data needed |
|
197 | + return true; // invoice data needed |
|
198 | 198 | } |
199 | - return false;// invoice data not needed |
|
199 | + return false; // invoice data not needed |
|
200 | 200 | } |
201 | 201 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | * Get country name by its ISO2 abbreviation |
82 | 82 | * |
83 | 83 | * @param string $sCountryCode |
84 | - * @return string|bool |
|
84 | + * @return string|false |
|
85 | 85 | */ |
86 | 86 | public function getCountryNameByIso2($sCountryCode) |
87 | 87 | { |
@@ -102,7 +102,6 @@ |
||
102 | 102 | /** |
103 | 103 | * Get the region object for the state and country given by PayPal |
104 | 104 | * |
105 | - * @param array $aResponse |
|
106 | 105 | * @return Region|bool |
107 | 106 | */ |
108 | 107 | public function getRegion($sCountry, $sState) |
@@ -95,6 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * Return the order related to the given TransactionStatus |
97 | 97 | * |
98 | + * @param string $sTxid |
|
98 | 99 | * @return SalesOrder|null |
99 | 100 | */ |
100 | 101 | public function getOrderByTxid($sTxid) |
@@ -160,7 +161,6 @@ discard block |
||
160 | 161 | * Fill billing and shipping addresses with the needed information from the response |
161 | 162 | * |
162 | 163 | * @param Address $oAddress |
163 | - * @param array $aResponse |
|
164 | 164 | * @return Address |
165 | 165 | */ |
166 | 166 | public function fillSingleAddress(Address $oAddress, $sFirstname, $sLastname, $sStreet, $sCity, $sZip, $sCountry, $sState) |
@@ -129,8 +129,8 @@ |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | if (!empty($aRates)) {// more than one shipping method existing? |
132 | - ksort($aRates);// sort by price ascending |
|
133 | - return array_shift($aRates);// return the cheapest shipping-method |
|
132 | + ksort($aRates); // sort by price ascending |
|
133 | + return array_shift($aRates); // return the cheapest shipping-method |
|
134 | 134 | } |
135 | 135 | return false; |
136 | 136 | } |
@@ -181,7 +181,7 @@ |
||
181 | 181 | * |
182 | 182 | * @param double $dPrice price of any sort |
183 | 183 | * @param int $iDecimals number of digits behind the decimal point |
184 | - * @return double |
|
184 | + * @return string |
|
185 | 185 | */ |
186 | 186 | public function formatNumber($dPrice, $iDecimals = 2) |
187 | 187 | { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | if (!empty($sText)) { |
136 | 136 | $sText = str_replace(array_keys($aSubstitutionArray), array_values($aSubstitutionArray), $sText); |
137 | 137 | if ($iMaxLength !== false && strlen($sText) > $iMaxLength) { |
138 | - $sText = substr($sText, 0, $iMaxLength);// shorten text if too long |
|
138 | + $sText = substr($sText, 0, $iMaxLength); // shorten text if too long |
|
139 | 139 | } |
140 | 140 | return $sText; |
141 | 141 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function getInvoiceAppendix(SalesOrder $oOrder) |
152 | 152 | { |
153 | - $sText = $this->getConfigParam('invoice_appendix', 'invoicing');// get invoice appendix from config |
|
153 | + $sText = $this->getConfigParam('invoice_appendix', 'invoicing'); // get invoice appendix from config |
|
154 | 154 | $aSubstitutionArray = [ |
155 | 155 | '{{order_increment_id}}' => $oOrder->getIncrementId(), |
156 | 156 | '{{customer_id}}' => $oOrder->getCustomerId(), |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function getNarrativeText(SalesOrder $oOrder, PayoneMethod $oPayment) |
170 | 170 | { |
171 | - $sText = $this->getConfigParam($oPayment->getCode(), 'text');// get narrative text for payment from config |
|
171 | + $sText = $this->getConfigParam($oPayment->getCode(), 'text'); // get narrative text for payment from config |
|
172 | 172 | $aSubstitutionArray = [ |
173 | 173 | '{{order_increment_id}}' => $oOrder->getIncrementId(), |
174 | 174 | ]; |