| @@ 160-171 (lines=12) @@ | ||
| 157 | * @param int $order_id |
|
| 158 | * @return array |
|
| 159 | */ |
|
| 160 | public function process_payment( $order_id, $retry = true, $force_save_source = false, $previous_error = false ) { |
|
| 161 | if ( $this->has_subscription( $order_id ) ) { |
|
| 162 | if ( $this->is_subs_change_payment() ) { |
|
| 163 | return $this->change_subs_payment_method( $order_id ); |
|
| 164 | } |
|
| 165 | ||
| 166 | // Regular payment with force customer enabled |
|
| 167 | return parent::process_payment( $order_id, $retry, true, $previous_error ); |
|
| 168 | } else { |
|
| 169 | return parent::process_payment( $order_id, $retry, $force_save_source, $previous_error ); |
|
| 170 | } |
|
| 171 | } |
|
| 172 | ||
| 173 | /** |
|
| 174 | * Process the payment method change for subscriptions. |
|
| @@ 181-192 (lines=12) @@ | ||
| 178 | * @param int $order_id |
|
| 179 | * @return array |
|
| 180 | */ |
|
| 181 | public function process_payment( $order_id, $retry = true, $force_save_source = false, $previous_error = false, $use_order_source = false ) { |
|
| 182 | if ( $this->has_subscription( $order_id ) ) { |
|
| 183 | if ( $this->is_subs_change_payment() ) { |
|
| 184 | return $this->change_subs_payment_method( $order_id ); |
|
| 185 | } |
|
| 186 | ||
| 187 | // Regular payment with force customer enabled |
|
| 188 | return parent::process_payment( $order_id, $retry, true, $previous_error, $use_order_source ); |
|
| 189 | } else { |
|
| 190 | return parent::process_payment( $order_id, $retry, $force_save_source, $previous_error, $use_order_source ); |
|
| 191 | } |
|
| 192 | } |
|
| 193 | ||
| 194 | /** |
|
| 195 | * Overloads WC_Stripe_Payment_Gateway::generate_create_intent_request() in order to |
|