@@ -40,8 +40,8 @@ |
||
40 | 40 | * @param string $type Pronamic payment line type. |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - public static function transform( $type ) { |
|
44 | - switch ( $type ) { |
|
43 | + public static function transform($type) { |
|
44 | + switch ($type) { |
|
45 | 45 | case PaymentLineType::DIGITAL: |
46 | 46 | return self::DIGITAL; |
47 | 47 | case PaymentLineType::DISCOUNT: |
@@ -26,14 +26,14 @@ |
||
26 | 26 | * @param PronamicMoney|null $pronamic_money Pronamic money to convert. |
27 | 27 | * @return Money |
28 | 28 | */ |
29 | - public static function transform( PronamicMoney $pronamic_money = null ) { |
|
30 | - if ( null === $pronamic_money ) { |
|
29 | + public static function transform(PronamicMoney $pronamic_money = null) { |
|
30 | + if (null === $pronamic_money) { |
|
31 | 31 | return null; |
32 | 32 | } |
33 | 33 | |
34 | 34 | $money = new Money( |
35 | 35 | $pronamic_money->get_currency()->get_alphabetic_code(), |
36 | - intval( $pronamic_money->get_cents() ) |
|
36 | + intval($pronamic_money->get_cents()) |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | return $money; |
@@ -154,7 +154,7 @@ 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 ) { |
|
157 | + public function __construct($merchant_order_id, $amount, $merchant_return_url) { |
|
158 | 158 | $this->timestamp = new DateTime(); |
159 | 159 | $this->merchant_order_id = $merchant_order_id; |
160 | 160 | $this->amount = $amount; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @param DateTime $timestamp Timestamp. |
168 | 168 | */ |
169 | - public function set_timestamp( DateTime $timestamp ) { |
|
169 | + public function set_timestamp(DateTime $timestamp) { |
|
170 | 170 | $this->timestamp = $timestamp; |
171 | 171 | } |
172 | 172 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * |
176 | 176 | * @param string $description Description. |
177 | 177 | */ |
178 | - public function set_description( $description ) { |
|
178 | + public function set_description($description) { |
|
179 | 179 | $this->description = $description; |
180 | 180 | } |
181 | 181 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @param string $language Language. |
186 | 186 | */ |
187 | - public function set_language( $language ) { |
|
187 | + public function set_language($language) { |
|
188 | 188 | $this->language = $language; |
189 | 189 | } |
190 | 190 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * |
194 | 194 | * @param string|null $payment_brand Payment brand. |
195 | 195 | */ |
196 | - public function set_payment_brand( $payment_brand ) { |
|
196 | + public function set_payment_brand($payment_brand) { |
|
197 | 197 | $this->payment_brand = $payment_brand; |
198 | 198 | } |
199 | 199 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * |
203 | 203 | * @param string $payment_brand_force Payment brand force. |
204 | 204 | */ |
205 | - public function set_payment_brand_force( $payment_brand_force ) { |
|
205 | + public function set_payment_brand_force($payment_brand_force) { |
|
206 | 206 | $this->payment_brand_force = $payment_brand_force; |
207 | 207 | } |
208 | 208 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * |
223 | 223 | * @param OrderItems|null $order_items Order items. |
224 | 224 | */ |
225 | - public function set_order_items( OrderItems $order_items = null ) { |
|
225 | + public function set_order_items(OrderItems $order_items = null) { |
|
226 | 226 | $this->order_items = $order_items; |
227 | 227 | } |
228 | 228 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @param Address|null $shipping_detail Shipping address details. |
233 | 233 | */ |
234 | - public function set_shipping_detail( Address $shipping_detail = null ) { |
|
234 | + public function set_shipping_detail(Address $shipping_detail = null) { |
|
235 | 235 | $this->shipping_detail = $shipping_detail; |
236 | 236 | } |
237 | 237 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | * |
241 | 241 | * @param Address|null $billing_detail Billing address details. |
242 | 242 | */ |
243 | - public function set_billing_detail( Address $billing_detail = null ) { |
|
243 | + public function set_billing_detail(Address $billing_detail = null) { |
|
244 | 244 | $this->billing_detail = $billing_detail; |
245 | 245 | } |
246 | 246 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * |
250 | 250 | * @param CustomerInformation $customer_information Customer information. |
251 | 251 | */ |
252 | - public function set_customer_information( CustomerInformation $customer_information ) { |
|
252 | + public function set_customer_information(CustomerInformation $customer_information) { |
|
253 | 253 | $this->customer_information = $customer_information; |
254 | 254 | } |
255 | 255 | |
@@ -261,42 +261,42 @@ discard block |
||
261 | 261 | public function get_json() { |
262 | 262 | $object = (object) array(); |
263 | 263 | |
264 | - $object->timestamp = $this->timestamp->format( DATE_ATOM ); |
|
264 | + $object->timestamp = $this->timestamp->format(DATE_ATOM); |
|
265 | 265 | $object->merchantOrderId = $this->merchant_order_id; |
266 | 266 | |
267 | - if ( null !== $this->description ) { |
|
267 | + if (null !== $this->description) { |
|
268 | 268 | $object->description = $this->description; |
269 | 269 | } |
270 | 270 | |
271 | - if ( null !== $this->order_items ) { |
|
271 | + if (null !== $this->order_items) { |
|
272 | 272 | $object->orderItems = $this->order_items->get_json(); |
273 | 273 | } |
274 | 274 | |
275 | 275 | $object->amount = $this->amount->get_json(); |
276 | 276 | |
277 | - if ( null !== $this->shipping_detail ) { |
|
277 | + if (null !== $this->shipping_detail) { |
|
278 | 278 | $object->shippingDetail = $this->shipping_detail->get_json(); |
279 | 279 | } |
280 | 280 | |
281 | - if ( null !== $this->billing_detail ) { |
|
281 | + if (null !== $this->billing_detail) { |
|
282 | 282 | $object->billingDetail = $this->billing_detail->get_json(); |
283 | 283 | } |
284 | 284 | |
285 | - if ( null !== $this->customer_information ) { |
|
285 | + if (null !== $this->customer_information) { |
|
286 | 286 | $object->customerInformation = $this->customer_information->get_json(); |
287 | 287 | } |
288 | 288 | |
289 | - if ( null !== $this->language ) { |
|
289 | + if (null !== $this->language) { |
|
290 | 290 | $object->language = $this->language; |
291 | 291 | } |
292 | 292 | |
293 | 293 | $object->merchantReturnURL = $this->merchant_return_url; |
294 | 294 | |
295 | - if ( null !== $this->payment_brand ) { |
|
295 | + if (null !== $this->payment_brand) { |
|
296 | 296 | $object->paymentBrand = $this->payment_brand; |
297 | 297 | } |
298 | 298 | |
299 | - if ( null !== $this->payment_brand_force ) { |
|
299 | + if (null !== $this->payment_brand_force) { |
|
300 | 300 | $object->paymentBrandForce = $this->payment_brand_force; |
301 | 301 | } |
302 | 302 | |
@@ -309,8 +309,8 @@ discard block |
||
309 | 309 | * @param array $fields Fields. |
310 | 310 | * @return array |
311 | 311 | */ |
312 | - public function get_signature_fields( $fields = array() ) { |
|
313 | - $fields[] = $this->timestamp->format( DATE_ATOM ); |
|
312 | + public function get_signature_fields($fields = array()) { |
|
313 | + $fields[] = $this->timestamp->format(DATE_ATOM); |
|
314 | 314 | $fields[] = $this->merchant_order_id; |
315 | 315 | $fields[] = $this->amount->get_currency(); |
316 | 316 | $fields[] = $this->amount->get_amount(); |
@@ -318,28 +318,28 @@ discard block |
||
318 | 318 | $fields[] = $this->description; |
319 | 319 | $fields[] = $this->merchant_return_url; |
320 | 320 | |
321 | - if ( null !== $this->order_items ) { |
|
322 | - $fields = $this->order_items->get_signature_fields( $fields ); |
|
321 | + if (null !== $this->order_items) { |
|
322 | + $fields = $this->order_items->get_signature_fields($fields); |
|
323 | 323 | } |
324 | 324 | |
325 | - if ( null !== $this->shipping_detail ) { |
|
326 | - $fields = $this->shipping_detail->get_signature_fields( $fields ); |
|
325 | + if (null !== $this->shipping_detail) { |
|
326 | + $fields = $this->shipping_detail->get_signature_fields($fields); |
|
327 | 327 | } |
328 | 328 | |
329 | - if ( null !== $this->payment_brand ) { |
|
329 | + if (null !== $this->payment_brand) { |
|
330 | 330 | $fields[] = $this->payment_brand; |
331 | 331 | } |
332 | 332 | |
333 | - if ( null !== $this->payment_brand_force ) { |
|
333 | + if (null !== $this->payment_brand_force) { |
|
334 | 334 | $fields[] = $this->payment_brand_force; |
335 | 335 | } |
336 | 336 | |
337 | - if ( null !== $this->customer_information ) { |
|
338 | - $fields = $this->customer_information->get_signature_fields( $fields ); |
|
337 | + if (null !== $this->customer_information) { |
|
338 | + $fields = $this->customer_information->get_signature_fields($fields); |
|
339 | 339 | } |
340 | 340 | |
341 | - if ( null !== $this->billing_detail ) { |
|
342 | - $fields = $this->billing_detail->get_signature_fields( $fields ); |
|
341 | + if (null !== $this->billing_detail) { |
|
342 | + $fields = $this->billing_detail->get_signature_fields($fields); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | return $fields; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @param string $email_address E-mailadress of the consumer. |
62 | 62 | */ |
63 | - public function set_email_address( $email_address ) { |
|
63 | + public function set_email_address($email_address) { |
|
64 | 64 | $this->email_address = $email_address; |
65 | 65 | } |
66 | 66 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @param DateTimeInterface $date_of_birth Date of birth. |
71 | 71 | */ |
72 | - public function set_date_of_birth( DateTimeInterface $date_of_birth ) { |
|
72 | + public function set_date_of_birth(DateTimeInterface $date_of_birth) { |
|
73 | 73 | $this->date_of_birth = $date_of_birth; |
74 | 74 | } |
75 | 75 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @param string $gender Gender. |
80 | 80 | */ |
81 | - public function set_gender( $gender ) { |
|
81 | + public function set_gender($gender) { |
|
82 | 82 | $this->gender = $gender; |
83 | 83 | } |
84 | 84 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @param string $initials Initials. |
89 | 89 | */ |
90 | - public function set_initials( $initials ) { |
|
90 | + public function set_initials($initials) { |
|
91 | 91 | $this->initials = $initials; |
92 | 92 | } |
93 | 93 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param string $telephone_number Telephone number. |
98 | 98 | */ |
99 | - public function set_telephone_number( $telephone_number ) { |
|
99 | + public function set_telephone_number($telephone_number) { |
|
100 | 100 | $this->telephone_number = $telephone_number; |
101 | 101 | } |
102 | 102 | |
@@ -108,23 +108,23 @@ discard block |
||
108 | 108 | public function get_json() { |
109 | 109 | $object = (object) array(); |
110 | 110 | |
111 | - if ( null !== $this->email_address ) { |
|
111 | + if (null !== $this->email_address) { |
|
112 | 112 | $object->emailAddress = $this->email_address; |
113 | 113 | } |
114 | 114 | |
115 | - if ( null !== $this->date_of_birth ) { |
|
116 | - $object->dateOfBirth = $this->date_of_birth->format( 'd-m-Y' ); |
|
115 | + if (null !== $this->date_of_birth) { |
|
116 | + $object->dateOfBirth = $this->date_of_birth->format('d-m-Y'); |
|
117 | 117 | } |
118 | 118 | |
119 | - if ( null !== $this->gender ) { |
|
119 | + if (null !== $this->gender) { |
|
120 | 120 | $object->gender = $this->gender; |
121 | 121 | } |
122 | 122 | |
123 | - if ( null !== $this->initials ) { |
|
123 | + if (null !== $this->initials) { |
|
124 | 124 | $object->initials = $this->initials; |
125 | 125 | } |
126 | 126 | |
127 | - if ( null !== $this->telephone_number ) { |
|
127 | + if (null !== $this->telephone_number) { |
|
128 | 128 | $object->telephoneNumber = $this->telephone_number; |
129 | 129 | } |
130 | 130 | |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | * @param array $fields Fields. |
138 | 138 | * @return array |
139 | 139 | */ |
140 | - public function get_signature_fields( $fields = array() ) { |
|
140 | + public function get_signature_fields($fields = array()) { |
|
141 | 141 | $fields[] = $this->email_address; |
142 | - $fields[] = ( null === $this->date_of_birth ) ? null : $this->date_of_birth->format( 'd-m-Y' ); |
|
142 | + $fields[] = (null === $this->date_of_birth) ? null : $this->date_of_birth->format('d-m-Y'); |
|
143 | 143 | $fields[] = $this->gender; |
144 | 144 | $fields[] = $this->initials; |
145 | 145 | $fields[] = $this->telephone_number; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param Money $amount Amount. |
83 | 83 | * @param string $category Category. |
84 | 84 | */ |
85 | - public function __construct( $name, $quantity, Money $amount, $category ) { |
|
85 | + public function __construct($name, $quantity, Money $amount, $category) { |
|
86 | 86 | $this->name = $name; |
87 | 87 | $this->quantity = $quantity; |
88 | 88 | $this->amount = $amount; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @param string|null $id ID. |
105 | 105 | */ |
106 | - public function set_id( $id = null ) { |
|
106 | + public function set_id($id = null) { |
|
107 | 107 | $this->id = $id; |
108 | 108 | } |
109 | 109 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @param string $description Description. |
132 | 132 | */ |
133 | - public function set_description( $description ) { |
|
133 | + public function set_description($description) { |
|
134 | 134 | $this->description = $description; |
135 | 135 | } |
136 | 136 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @param Money|null $tax Tax. |
168 | 168 | */ |
169 | - public function set_tax( Money $tax = null ) { |
|
169 | + public function set_tax(Money $tax = null) { |
|
170 | 170 | $this->tax = $tax; |
171 | 171 | } |
172 | 172 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * |
194 | 194 | * @param int $vat_category VAT category. |
195 | 195 | */ |
196 | - public function set_vat_category( $vat_category ) { |
|
196 | + public function set_vat_category($vat_category) { |
|
197 | 197 | $this->vat_category = $vat_category; |
198 | 198 | } |
199 | 199 | |
@@ -205,26 +205,26 @@ discard block |
||
205 | 205 | public function get_json() { |
206 | 206 | $object = (object) array(); |
207 | 207 | |
208 | - if ( null !== $this->id ) { |
|
208 | + if (null !== $this->id) { |
|
209 | 209 | $object->id = $this->id; |
210 | 210 | } |
211 | 211 | |
212 | 212 | $object->name = $this->name; |
213 | 213 | |
214 | - if ( null !== $this->description ) { |
|
214 | + if (null !== $this->description) { |
|
215 | 215 | $object->description = $this->description; |
216 | 216 | } |
217 | 217 | |
218 | 218 | $object->quantity = $this->quantity; |
219 | 219 | $object->amount = $this->amount->get_json(); |
220 | 220 | |
221 | - if ( null !== $this->tax ) { |
|
221 | + if (null !== $this->tax) { |
|
222 | 222 | $object->tax = $this->tax->get_json(); |
223 | 223 | } |
224 | 224 | |
225 | 225 | $object->category = $this->category; |
226 | 226 | |
227 | - if ( null !== $this->vat_category ) { |
|
227 | + if (null !== $this->vat_category) { |
|
228 | 228 | $object->vatCategory = $this->vat_category; |
229 | 229 | } |
230 | 230 | |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | * @param array $data Data. |
238 | 238 | * @return array |
239 | 239 | */ |
240 | - public function get_signature_fields( $data = array() ) { |
|
241 | - if ( null !== $this->id ) { |
|
240 | + public function get_signature_fields($data = array()) { |
|
241 | + if (null !== $this->id) { |
|
242 | 242 | $data[] = $this->id; |
243 | 243 | } |
244 | 244 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $data[] = $this->amount->get_currency(); |
249 | 249 | $data[] = $this->amount->get_amount(); |
250 | 250 | |
251 | - if ( null === $this->tax ) { |
|
251 | + if (null === $this->tax) { |
|
252 | 252 | $data[] = null; |
253 | 253 | } else { |
254 | 254 | $data[] = $this->tax->get_currency(); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | $data[] = $this->category; |
259 | 259 | |
260 | - if ( null !== $this->vat_category ) { |
|
260 | + if (null !== $this->vat_category) { |
|
261 | 261 | $data[] = $this->vat_category; |
262 | 262 | } |
263 | 263 |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @param array $items Order items. |
32 | 32 | */ |
33 | - public function __construct( $items = null ) { |
|
34 | - if ( is_array( $items ) ) { |
|
35 | - foreach ( $items as $item ) { |
|
36 | - $this->add_item( $item ); |
|
33 | + public function __construct($items = null) { |
|
34 | + if (is_array($items)) { |
|
35 | + foreach ($items as $item) { |
|
36 | + $this->add_item($item); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | } |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | * @param string $category Category. |
48 | 48 | * @return OrderItem |
49 | 49 | */ |
50 | - public function new_item( $name, $quantity, Money $amount, $category ) { |
|
51 | - $item = new OrderItem( $name, $quantity, $amount, $category ); |
|
50 | + public function new_item($name, $quantity, Money $amount, $category) { |
|
51 | + $item = new OrderItem($name, $quantity, $amount, $category); |
|
52 | 52 | |
53 | - $this->add_item( $item ); |
|
53 | + $this->add_item($item); |
|
54 | 54 | |
55 | 55 | return $item; |
56 | 56 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @param OrderItem $item Order item. |
62 | 62 | */ |
63 | - public function add_item( OrderItem $item ) { |
|
63 | + public function add_item(OrderItem $item) { |
|
64 | 64 | $this->order_items[] = $item; |
65 | 65 | } |
66 | 66 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function get_json() { |
82 | 82 | $data = array_map( |
83 | - function( $item ) { |
|
83 | + function($item) { |
|
84 | 84 | return $item->get_json(); |
85 | 85 | }, |
86 | 86 | $this->get_order_items() |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | * @param array $fields Fields. |
96 | 96 | * @return array |
97 | 97 | */ |
98 | - public function get_signature_fields( $fields = array() ) { |
|
99 | - foreach ( $this->get_order_items() as $item ) { |
|
100 | - $fields = $item->get_signature_fields( $fields ); |
|
98 | + public function get_signature_fields($fields = array()) { |
|
99 | + foreach ($this->get_order_items() as $item) { |
|
100 | + $fields = $item->get_signature_fields($fields); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | return $fields; |