| @@ 336-345 (lines=10) @@ | ||
| 333 | * @param WC_Order $renewal_order The order which recorded the successful payment (to make up for the failed automatic payment). |
|
| 334 | * @return void |
|
| 335 | */ |
|
| 336 | public function update_failing_payment_method( $subscription, $renewal_order ) { |
|
| 337 | if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) { |
|
| 338 | update_post_meta( $subscription->id, '_stripe_customer_id', $renewal_order->stripe_customer_id ); |
|
| 339 | update_post_meta( $subscription->id, '_stripe_source_id', $renewal_order->stripe_source_id ); |
|
| 340 | ||
| 341 | } else { |
|
| 342 | update_post_meta( $subscription->get_id(), '_stripe_customer_id', $renewal_order->get_meta( '_stripe_customer_id', true ) ); |
|
| 343 | update_post_meta( $subscription->get_id(), '_stripe_source_id', $renewal_order->get_meta( '_stripe_source_id', true ) ); |
|
| 344 | } |
|
| 345 | } |
|
| 346 | ||
| 347 | /** |
|
| 348 | * Include the payment meta data required to process automatic recurring payments so that store managers can |
|
| @@ 344-353 (lines=10) @@ | ||
| 341 | * @param WC_Order $renewal_order The order which recorded the successful payment (to make up for the failed automatic payment). |
|
| 342 | * @return void |
|
| 343 | */ |
|
| 344 | public function update_failing_payment_method( $subscription, $renewal_order ) { |
|
| 345 | if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) { |
|
| 346 | update_post_meta( $subscription->id, '_stripe_customer_id', $renewal_order->stripe_customer_id ); |
|
| 347 | update_post_meta( $subscription->id, '_stripe_source_id', $renewal_order->stripe_source_id ); |
|
| 348 | ||
| 349 | } else { |
|
| 350 | update_post_meta( $subscription->get_id(), '_stripe_customer_id', $renewal_order->get_meta( '_stripe_customer_id', true ) ); |
|
| 351 | update_post_meta( $subscription->get_id(), '_stripe_source_id', $renewal_order->get_meta( '_stripe_source_id', true ) ); |
|
| 352 | } |
|
| 353 | } |
|
| 354 | ||
| 355 | /** |
|
| 356 | * Include the payment meta data required to process automatic recurring payments so that store managers can |
|