@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @param MeprTransaction $txn MemberPress transaction object. |
56 | 56 | */ |
57 | - public function __construct( MeprTransaction $txn ) { |
|
57 | + public function __construct(MeprTransaction $txn) { |
|
58 | 58 | parent::__construct(); |
59 | 59 | |
60 | 60 | $this->txn = $txn; |
61 | 61 | $this->member = $this->txn->user(); |
62 | - $this->recurring = ( $txn->subscription() && $txn->subscription()->txn_count > 1 ); |
|
62 | + $this->recurring = ($txn->subscription() && $txn->subscription()->txn_count > 1); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | $items = new Items(); |
118 | 118 | |
119 | 119 | $item = new Item(); |
120 | - $item->setNumber( $this->get_order_id() ); |
|
121 | - $item->setDescription( $this->get_description() ); |
|
122 | - $item->setPrice( $this->txn->total ); |
|
123 | - $item->setQuantity( 1 ); |
|
120 | + $item->setNumber($this->get_order_id()); |
|
121 | + $item->setDescription($this->get_description()); |
|
122 | + $item->setPrice($this->txn->total); |
|
123 | + $item->setQuantity(1); |
|
124 | 124 | |
125 | - $items->addItem( $item ); |
|
125 | + $items->addItem($item); |
|
126 | 126 | |
127 | 127 | return $items; |
128 | 128 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @return string |
199 | 199 | */ |
200 | 200 | public function get_address() { |
201 | - return $this->member->attr( 'biz_address1' ); |
|
201 | + return $this->member->attr('biz_address1'); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @return string |
210 | 210 | */ |
211 | 211 | public function get_city() { |
212 | - return $this->member->attr( 'biz_city' ); |
|
212 | + return $this->member->attr('biz_city'); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * @return string |
221 | 221 | */ |
222 | 222 | public function get_zip() { |
223 | - return $this->member->attr( 'biz_postcode' ); |
|
223 | + return $this->member->attr('biz_postcode'); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $mepr_options = MeprOptions::fetch(); |
235 | 235 | |
236 | 236 | // @link https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/models/MeprOptions.php#L768-782 |
237 | - return $mepr_options->thankyou_page_url( 'trans_num=' . $this->txn->id ); |
|
237 | + return $mepr_options->thankyou_page_url('trans_num=' . $this->txn->id); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -274,36 +274,36 @@ discard block |
||
274 | 274 | public function get_subscription() { |
275 | 275 | $product = $this->txn->product(); |
276 | 276 | |
277 | - if ( $product->is_one_time_payment() ) { |
|
277 | + if ($product->is_one_time_payment()) { |
|
278 | 278 | return false; |
279 | 279 | } |
280 | 280 | |
281 | 281 | $mp_subscription = $this->txn->subscription(); |
282 | 282 | |
283 | - if ( ! $mp_subscription ) { |
|
283 | + if ( ! $mp_subscription) { |
|
284 | 284 | return false; |
285 | 285 | } |
286 | 286 | |
287 | 287 | $frequency = ''; |
288 | 288 | |
289 | - if ( $mp_subscription->limit_cycles ) { |
|
289 | + if ($mp_subscription->limit_cycles) { |
|
290 | 290 | $frequency = $mp_subscription->limit_cycles; |
291 | 291 | } |
292 | 292 | |
293 | 293 | $subscription = new Subscription(); |
294 | 294 | $subscription->frequency = $frequency; |
295 | 295 | $subscription->interval = $product->period; |
296 | - $subscription->interval_period = Core_Util::to_period( $product->period_type ); |
|
296 | + $subscription->interval_period = Core_Util::to_period($product->period_type); |
|
297 | 297 | $subscription->description = sprintf( |
298 | 298 | 'Order #%s - %s', |
299 | 299 | $this->get_source_id(), |
300 | 300 | $this->get_description() |
301 | 301 | ); |
302 | 302 | |
303 | - $subscription->set_amount( new Money( |
|
303 | + $subscription->set_amount(new Money( |
|
304 | 304 | $this->txn->total, |
305 | 305 | $this->get_currency_alphabetic_code() |
306 | - ) ); |
|
306 | + )); |
|
307 | 307 | |
308 | 308 | return $subscription; |
309 | 309 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | public function get_subscription_source_id() { |
318 | 318 | $subscription = $this->get_subscription(); |
319 | 319 | |
320 | - if ( ! $subscription ) { |
|
320 | + if ( ! $subscription) { |
|
321 | 321 | return false; |
322 | 322 | } |
323 | 323 |