@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | * @param Money $amount Amount. |
155 | 155 | * @param string $merchant_return_url Merchant return URL. |
156 | 156 | */ |
157 | - public function __construct( $merchant_order_id, $amount, $merchant_return_url ) { |
|
158 | - $this->timestamp = date( DATE_ATOM ); |
|
157 | + public function __construct($merchant_order_id, $amount, $merchant_return_url) { |
|
158 | + $this->timestamp = date(DATE_ATOM); |
|
159 | 159 | $this->merchant_order_id = $merchant_order_id; |
160 | 160 | $this->amount = $amount; |
161 | 161 | $this->merchant_return_url = $merchant_return_url; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @param string $description Description. |
168 | 168 | */ |
169 | - public function set_description( $description ) { |
|
169 | + public function set_description($description) { |
|
170 | 170 | $this->description = $description; |
171 | 171 | } |
172 | 172 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * |
176 | 176 | * @param string $language Language. |
177 | 177 | */ |
178 | - public function set_language( $language ) { |
|
178 | + public function set_language($language) { |
|
179 | 179 | $this->language = $language; |
180 | 180 | } |
181 | 181 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @param string|null $payment_brand Payment brand. |
186 | 186 | */ |
187 | - public function set_payment_brand( $payment_brand ) { |
|
187 | + public function set_payment_brand($payment_brand) { |
|
188 | 188 | $this->payment_brand = $payment_brand; |
189 | 189 | } |
190 | 190 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * |
194 | 194 | * @param string $payment_brand_force Payment brand force. |
195 | 195 | */ |
196 | - public function set_payment_brand_force( $payment_brand_force ) { |
|
196 | + public function set_payment_brand_force($payment_brand_force) { |
|
197 | 197 | $this->payment_brand_force = $payment_brand_force; |
198 | 198 | } |
199 | 199 | |
@@ -204,12 +204,12 @@ discard block |
||
204 | 204 | * |
205 | 205 | * @return void |
206 | 206 | */ |
207 | - public function set_order_items( Items $items ) { |
|
207 | + public function set_order_items(Items $items) { |
|
208 | 208 | $order_items = new OrderItems(); |
209 | 209 | |
210 | 210 | $items = $items->getIterator(); |
211 | 211 | |
212 | - while ( $items->valid() ) { |
|
212 | + while ($items->valid()) { |
|
213 | 213 | $item = $items->current(); |
214 | 214 | |
215 | 215 | // New order item. |
@@ -220,14 +220,14 @@ discard block |
||
220 | 220 | 'quantity' => $item->get_quantity(), |
221 | 221 | 'amount' => new Money( |
222 | 222 | $this->amount->get_currency(), |
223 | - Util::amount_to_cents( $item->get_price() ) |
|
223 | + Util::amount_to_cents($item->get_price()) |
|
224 | 224 | ), |
225 | 225 | 'category' => ProductCategories::DIGITAL, |
226 | 226 | ) |
227 | 227 | ); |
228 | 228 | |
229 | 229 | // Add order item. |
230 | - $order_items->add_item( $order_item ); |
|
230 | + $order_items->add_item($order_item); |
|
231 | 231 | |
232 | 232 | $items->next(); |
233 | 233 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | * |
241 | 241 | * @param Address $shipping_detail Shipping address details. |
242 | 242 | */ |
243 | - public function set_shipping_detail( Address $shipping_detail ) { |
|
243 | + public function set_shipping_detail(Address $shipping_detail) { |
|
244 | 244 | $this->shipping_detail = $shipping_detail; |
245 | 245 | } |
246 | 246 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * |
250 | 250 | * @param Address $billing_detail Billing address details. |
251 | 251 | */ |
252 | - public function set_billing_detail( Address $billing_detail ) { |
|
252 | + public function set_billing_detail(Address $billing_detail) { |
|
253 | 253 | $this->billing_detail = $billing_detail; |
254 | 254 | } |
255 | 255 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | * |
259 | 259 | * @param CustomerInformation $customer_information Customer information. |
260 | 260 | */ |
261 | - public function set_customer_information( CustomerInformation $customer_information ) { |
|
261 | + public function set_customer_information(CustomerInformation $customer_information) { |
|
262 | 262 | $this->customer_information = $customer_information; |
263 | 263 | } |
264 | 264 | |
@@ -274,21 +274,21 @@ discard block |
||
274 | 274 | 'description' => $this->description, |
275 | 275 | ); |
276 | 276 | |
277 | - if ( null !== $this->order_items ) { |
|
277 | + if (null !== $this->order_items) { |
|
278 | 278 | $data['orderItems'] = $this->order_items->get_json(); |
279 | 279 | } |
280 | 280 | |
281 | 281 | $data['amount'] = $this->amount->get_json(); |
282 | 282 | |
283 | - if ( null !== $this->shipping_detail ) { |
|
283 | + if (null !== $this->shipping_detail) { |
|
284 | 284 | $data['shippingDetail'] = $this->shipping_detail->get_json(); |
285 | 285 | } |
286 | 286 | |
287 | - if ( null !== $this->billing_detail ) { |
|
287 | + if (null !== $this->billing_detail) { |
|
288 | 288 | $data['billingDetail'] = $this->billing_detail->get_json(); |
289 | 289 | } |
290 | 290 | |
291 | - if ( null !== $this->customer_information ) { |
|
291 | + if (null !== $this->customer_information) { |
|
292 | 292 | $data['customerInformation'] = $this->customer_information->get_json(); |
293 | 293 | } |
294 | 294 | |
@@ -320,28 +320,28 @@ discard block |
||
320 | 320 | // Optional fields. |
321 | 321 | $optional = array(); |
322 | 322 | |
323 | - if ( null !== $this->order_items ) { |
|
323 | + if (null !== $this->order_items) { |
|
324 | 324 | $optional['order_items'] = $this->order_items->get_signature_data(); |
325 | 325 | } |
326 | 326 | |
327 | - if ( null !== $this->shipping_detail ) { |
|
327 | + if (null !== $this->shipping_detail) { |
|
328 | 328 | $optional['shipping_detail'] = $this->shipping_detail->get_signature_data(); |
329 | 329 | } |
330 | 330 | |
331 | 331 | $optional['payment_brand'] = $this->payment_brand; |
332 | 332 | $optional['payment_brand_force'] = $this->payment_brand_force; |
333 | 333 | |
334 | - if ( null !== $this->customer_information ) { |
|
334 | + if (null !== $this->customer_information) { |
|
335 | 335 | $optional['customer_information'] = $this->customer_information->get_signature_data(); |
336 | 336 | } |
337 | 337 | |
338 | - if ( null !== $this->billing_detail ) { |
|
338 | + if (null !== $this->billing_detail) { |
|
339 | 339 | $optional['billing_detail'] = $this->billing_detail->get_signature_data(); |
340 | 340 | } |
341 | 341 | |
342 | 342 | // Remove empty optional fields. |
343 | - $optional = array_filter( $optional ); |
|
343 | + $optional = array_filter($optional); |
|
344 | 344 | |
345 | - return array_merge( $fields, $optional ); |
|
345 | + return array_merge($fields, $optional); |
|
346 | 346 | } |
347 | 347 | } |