| @@ 109-120 (lines=12) @@ | ||
| 106 | * @param int $order_id |
|
| 107 | * @return array |
|
| 108 | */ |
|
| 109 | public function process_payment( $order_id, $retry = true, $force_save_source = false, $previous_error = false ) { |
|
| 110 | if ( $this->has_subscription( $order_id ) ) { |
|
| 111 | if ( $this->is_subs_change_payment() ) { |
|
| 112 | return $this->change_subs_payment_method( $order_id ); |
|
| 113 | } |
|
| 114 | ||
| 115 | // Regular payment with force customer enabled |
|
| 116 | return parent::process_payment( $order_id, $retry, true, $previous_error ); |
|
| 117 | } else { |
|
| 118 | return parent::process_payment( $order_id, $retry, $force_save_source, $previous_error ); |
|
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | /** |
|
| 123 | * Process the payment method change for subscriptions. |
|
| @@ 152-163 (lines=12) @@ | ||
| 149 | * @param int $order_id |
|
| 150 | * @return array |
|
| 151 | */ |
|
| 152 | public function process_payment( $order_id, $retry = true, $force_save_source = false, $previous_error = false ) { |
|
| 153 | if ( $this->has_subscription( $order_id ) ) { |
|
| 154 | if ( $this->is_subs_change_payment() ) { |
|
| 155 | return $this->change_subs_payment_method( $order_id ); |
|
| 156 | } |
|
| 157 | ||
| 158 | // Regular payment with force customer enabled |
|
| 159 | return parent::process_payment( $order_id, $retry, true, $previous_error ); |
|
| 160 | } else { |
|
| 161 | return parent::process_payment( $order_id, $retry, $force_save_source, $previous_error ); |
|
| 162 | } |
|
| 163 | } |
|
| 164 | ||
| 165 | /** |
|
| 166 | * Scheduled_subscription_payment function. |
|