|
@@ 698-705 (lines=8) @@
|
| 695 |
|
* @param WC_Order $order The renewal order. |
| 696 |
|
* @param stdClass $intent The Payment Intent object. |
| 697 |
|
*/ |
| 698 |
|
protected function handle_intent_verification_success( $order, $intent ) { |
| 699 |
|
parent::handle_intent_verification_success( $order, $intent ); |
| 700 |
|
|
| 701 |
|
if ( isset( $_GET['early_renewal'] ) ) { // wpcs: csrf ok. |
| 702 |
|
wcs_update_dates_after_early_renewal( wcs_get_subscription( $order->get_meta( '_subscription_renewal' ) ), $order ); |
| 703 |
|
wc_add_notice( __( 'Your early renewal order was successful.', 'woocommerce-gateway-stripe' ), 'success' ); |
| 704 |
|
} |
| 705 |
|
} |
| 706 |
|
|
| 707 |
|
/** |
| 708 |
|
* During early renewals, instead of failing the renewal order, delete it and let Subs redirect to the checkout. |
|
@@ 713-720 (lines=8) @@
|
| 710 |
|
* @param WC_Order $order The renewal order. |
| 711 |
|
* @param stdClass $intent The Payment Intent object (unused). |
| 712 |
|
*/ |
| 713 |
|
protected function handle_intent_verification_failure( $order, $intent ) { |
| 714 |
|
if ( isset( $_GET['early_renewal'] ) ) { |
| 715 |
|
$order->delete( true ); |
| 716 |
|
wc_add_notice( __( 'Payment authorization for the renewal order was unsuccessful, please try again.', 'woocommerce-gateway-stripe' ), 'error' ); |
| 717 |
|
$renewal_url = wcs_get_early_renewal_url( wcs_get_subscription( $order->get_meta( '_subscription_renewal' ) ) ); |
| 718 |
|
wp_redirect( $renewal_url ); exit; |
| 719 |
|
} |
| 720 |
|
} |
| 721 |
|
} |
| 722 |
|
|