@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @param MeprTransaction $txn MemberPress transaction object. |
| 65 | 65 | */ |
| 66 | - public function __construct( MeprTransaction $transaction ) { |
|
| 66 | + public function __construct(MeprTransaction $transaction) { |
|
| 67 | 67 | parent::__construct(); |
| 68 | 68 | |
| 69 | 69 | $this->transaction = $transaction; |
| 70 | 70 | $this->user = $transaction->user(); |
| 71 | 71 | $this->subscription = $transaction->subscription(); |
| 72 | - $this->recurring = ( $transaction->subscription() && $transaction->subscription()->txn_count > 1 ); |
|
| 72 | + $this->recurring = ($transaction->subscription() && $transaction->subscription()->txn_count > 1); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | $items = new Items(); |
| 128 | 128 | |
| 129 | 129 | $item = new Item(); |
| 130 | - $item->setNumber( $this->get_order_id() ); |
|
| 131 | - $item->setDescription( $this->get_description() ); |
|
| 132 | - $item->setPrice( $this->transaction->total ); |
|
| 133 | - $item->setQuantity( 1 ); |
|
| 130 | + $item->setNumber($this->get_order_id()); |
|
| 131 | + $item->setDescription($this->get_description()); |
|
| 132 | + $item->setPrice($this->transaction->total); |
|
| 133 | + $item->setQuantity(1); |
|
| 134 | 134 | |
| 135 | - $items->addItem( $item ); |
|
| 135 | + $items->addItem($item); |
|
| 136 | 136 | |
| 137 | 137 | return $items; |
| 138 | 138 | } |
@@ -208,9 +208,9 @@ discard block |
||
| 208 | 208 | * @return string|null |
| 209 | 209 | */ |
| 210 | 210 | public function get_address() { |
| 211 | - $value = $this->user->address( 'one', false ); |
|
| 211 | + $value = $this->user->address('one', false); |
|
| 212 | 212 | |
| 213 | - if ( false === $value ) { |
|
| 213 | + if (false === $value) { |
|
| 214 | 214 | return null; |
| 215 | 215 | } |
| 216 | 216 | |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | * @return string|null |
| 226 | 226 | */ |
| 227 | 227 | public function get_city() { |
| 228 | - $value = $this->user->address( 'city', false ); |
|
| 228 | + $value = $this->user->address('city', false); |
|
| 229 | 229 | |
| 230 | - if ( false === $value ) { |
|
| 230 | + if (false === $value) { |
|
| 231 | 231 | return null; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | * @return string|null |
| 243 | 243 | */ |
| 244 | 244 | public function get_zip() { |
| 245 | - $value = $this->user->address( 'zip', false ); |
|
| 245 | + $value = $this->user->address('zip', false); |
|
| 246 | 246 | |
| 247 | - if ( false === $value ) { |
|
| 247 | + if (false === $value) { |
|
| 248 | 248 | return null; |
| 249 | 249 | } |
| 250 | 250 | |
@@ -259,9 +259,9 @@ discard block |
||
| 259 | 259 | * @return string|null |
| 260 | 260 | */ |
| 261 | 261 | public function get_country() { |
| 262 | - $value = $this->user->address( 'country', false ); |
|
| 262 | + $value = $this->user->address('country', false); |
|
| 263 | 263 | |
| 264 | - if ( false === $value ) { |
|
| 264 | + if (false === $value) { |
|
| 265 | 265 | return null; |
| 266 | 266 | } |
| 267 | 267 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $mepr_options = MeprOptions::fetch(); |
| 280 | 280 | |
| 281 | 281 | // @link https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/models/MeprOptions.php#L768-782 |
| 282 | - return $mepr_options->thankyou_page_url( 'trans_num=' . $this->transaction->id ); |
|
| 282 | + return $mepr_options->thankyou_page_url('trans_num=' . $this->transaction->id); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /** |
@@ -319,36 +319,36 @@ discard block |
||
| 319 | 319 | public function get_subscription() { |
| 320 | 320 | $product = $this->transaction->product(); |
| 321 | 321 | |
| 322 | - if ( $product->is_one_time_payment() ) { |
|
| 322 | + if ($product->is_one_time_payment()) { |
|
| 323 | 323 | return false; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | $mp_subscription = $this->transaction->subscription(); |
| 327 | 327 | |
| 328 | - if ( ! $mp_subscription ) { |
|
| 328 | + if ( ! $mp_subscription) { |
|
| 329 | 329 | return false; |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | $frequency = ''; |
| 333 | 333 | |
| 334 | - if ( $mp_subscription->limit_cycles ) { |
|
| 334 | + if ($mp_subscription->limit_cycles) { |
|
| 335 | 335 | $frequency = $mp_subscription->limit_cycles; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | $subscription = new Subscription(); |
| 339 | 339 | $subscription->frequency = $frequency; |
| 340 | 340 | $subscription->interval = $product->period; |
| 341 | - $subscription->interval_period = Core_Util::to_period( $product->period_type ); |
|
| 341 | + $subscription->interval_period = Core_Util::to_period($product->period_type); |
|
| 342 | 342 | $subscription->description = sprintf( |
| 343 | 343 | 'Order #%s - %s', |
| 344 | 344 | $this->get_source_id(), |
| 345 | 345 | $this->get_description() |
| 346 | 346 | ); |
| 347 | 347 | |
| 348 | - $subscription->set_amount( new Money( |
|
| 348 | + $subscription->set_amount(new Money( |
|
| 349 | 349 | $this->transaction->total, |
| 350 | 350 | $this->get_currency_alphabetic_code() |
| 351 | - ) ); |
|
| 351 | + )); |
|
| 352 | 352 | |
| 353 | 353 | return $subscription; |
| 354 | 354 | } |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | public function get_subscription_source_id() { |
| 363 | 363 | $subscription = $this->get_subscription(); |
| 364 | 364 | |
| 365 | - if ( ! $subscription ) { |
|
| 365 | + if ( ! $subscription) { |
|
| 366 | 366 | return false; |
| 367 | 367 | } |
| 368 | 368 | |