@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | -defined( 'ABSPATH' ) || exit; |
|
| 7 | +defined('ABSPATH') || exit; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Manual Payment Gateway class. |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @var array |
| 26 | 26 | */ |
| 27 | - protected $supports = array( 'subscription', 'addons', 'multiple_subscriptions' ); |
|
| 27 | + protected $supports = array('subscription', 'addons', 'multiple_subscriptions'); |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Payment method order. |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | public function __construct() { |
| 40 | 40 | parent::__construct(); |
| 41 | 41 | |
| 42 | - $this->title = __( 'Test Gateway', 'invoicing' ); |
|
| 43 | - $this->method_title = __( 'Test Gateway', 'invoicing' ); |
|
| 42 | + $this->title = __('Test Gateway', 'invoicing'); |
|
| 43 | + $this->method_title = __('Test Gateway', 'invoicing'); |
|
| 44 | 44 | |
| 45 | - add_filter( 'getpaid_daily_maintenance_should_expire_subscription', array( $this, 'maybe_renew_subscription' ), 10, 2 ); |
|
| 45 | + add_filter('getpaid_daily_maintenance_should_expire_subscription', array($this, 'maybe_renew_subscription'), 10, 2); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -54,19 +54,19 @@ discard block |
||
| 54 | 54 | * @param GetPaid_Payment_Form_Submission $submission Checkout submission. |
| 55 | 55 | * @return array |
| 56 | 56 | */ |
| 57 | - public function process_payment( $invoice, $submission_data, $submission ) { |
|
| 57 | + public function process_payment($invoice, $submission_data, $submission) { |
|
| 58 | 58 | |
| 59 | 59 | // Mark it as paid. |
| 60 | 60 | $invoice->mark_paid(); |
| 61 | 61 | |
| 62 | 62 | // (Maybe) activate subscriptions. |
| 63 | - $subscriptions = getpaid_get_invoice_subscriptions( $invoice ); |
|
| 63 | + $subscriptions = getpaid_get_invoice_subscriptions($invoice); |
|
| 64 | 64 | |
| 65 | - if ( ! empty( $subscriptions ) ) { |
|
| 66 | - $subscriptions = is_array( $subscriptions ) ? $subscriptions : array( $subscriptions ); |
|
| 65 | + if (!empty($subscriptions)) { |
|
| 66 | + $subscriptions = is_array($subscriptions) ? $subscriptions : array($subscriptions); |
|
| 67 | 67 | |
| 68 | - foreach ( $subscriptions as $subscription ) { |
|
| 69 | - if ( $subscription->exists() ) { |
|
| 68 | + foreach ($subscriptions as $subscription) { |
|
| 69 | + if ($subscription->exists()) { |
|
| 70 | 70 | $subscription->activate(); |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Send to the success page. |
| 77 | - wpinv_send_to_success_page( array( 'invoice_key' => $invoice->get_key() ) ); |
|
| 77 | + wpinv_send_to_success_page(array('invoice_key' => $invoice->get_key())); |
|
| 78 | 78 | |
| 79 | 79 | } |
| 80 | 80 | |
@@ -85,15 +85,15 @@ discard block |
||
| 85 | 85 | * @param bool $should_expire |
| 86 | 86 | * @param WPInv_Subscription $subscription |
| 87 | 87 | */ |
| 88 | - public function maybe_renew_subscription( $should_expire, $subscription ) { |
|
| 88 | + public function maybe_renew_subscription($should_expire, $subscription) { |
|
| 89 | 89 | |
| 90 | 90 | // Ensure its our subscription && it's active. |
| 91 | - if ( 'manual' != $subscription->get_gateway() || ! $subscription->has_status( 'active trialling' ) ) { |
|
| 91 | + if ('manual' != $subscription->get_gateway() || !$subscription->has_status('active trialling')) { |
|
| 92 | 92 | return $should_expire; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // If this is the last renewal, complete the subscription. |
| 96 | - if ( $subscription->is_last_renewal() ) { |
|
| 96 | + if ($subscription->is_last_renewal()) { |
|
| 97 | 97 | $subscription->complete(); |
| 98 | 98 | return false; |
| 99 | 99 | } |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | * @param GetPaid_Form_Item[] $items |
| 120 | 120 | * @return WPInv_Invoice |
| 121 | 121 | */ |
| 122 | - public function process_addons( $invoice, $items ) { |
|
| 122 | + public function process_addons($invoice, $items) { |
|
| 123 | 123 | |
| 124 | - foreach ( $items as $item ) { |
|
| 125 | - $invoice->add_item( $item ); |
|
| 124 | + foreach ($items as $item) { |
|
| 125 | + $invoice->add_item($item); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | $invoice->recalculate_total(); |