| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | defined( 'ABSPATH' ) || exit; |
| 3 | 3 | |
| 4 | 4 | // phpcs:disable WordPress.Files.FileName |
| 5 | 5 | |
| 6 | -define( 'WC_VIPPS_RECURRING_VERSION', '2.2.11' ); | |
| 6 | +define( 'WC_VIPPS_RECURRING_VERSION', '2.2.18' ); | |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Polyfills |
| 10 | 10 | */ |
| @@ -47,9 +47,18 @@ | ||
| 47 | 47 | /* |
| 48 | 48 | * Amount of days to retry a payment when creating a charge in the Vipps/MobilePay API |
| 49 | 49 | */ |
| 50 | 50 | if ( ! defined( 'WC_VIPPS_RECURRING_RETRY_DAYS' ) ) { |
| 51 | - define( 'WC_VIPPS_RECURRING_RETRY_DAYS', 2 ); | |
| 51 | + $wc_vipps_recurring_retry_days = 2; | |
| 52 | + $wc_vipps_recurring_wcs_retries_enabled = 'yes' === get_option( 'woocommerce_subscriptions_enable_retry', 'no' ); | |
| 53 | + | |
| 54 | + if ( apply_filters( 'wcs_is_retry_enabled', $wc_vipps_recurring_wcs_retries_enabled ) ) { | |
| 55 | + $wc_vipps_recurring_retry_days = 0; | |
| 56 | + } | |
| 57 | + | |
| 58 | + define( 'WC_VIPPS_RECURRING_RETRY_DAYS', $wc_vipps_recurring_retry_days ); | |
| 59 | + unset( $wc_vipps_recurring_retry_days ); | |
| 60 | + unset( $wc_vipps_recurring_wcs_retries_enabled ); | |
| 52 | 61 | } |
| 53 | 62 | |
| 54 | 63 | /* |
| 55 | 64 | * Whether to put the plugin into test mode. This is only useful for developers. |
| @@ -55,8 +64,12 @@ | ||
| 55 | 64 | * Whether to put the plugin into test mode. This is only useful for developers. |
| 56 | 65 | */ |
| 57 | 66 | if ( ! defined( 'WC_VIPPS_RECURRING_TEST_MODE' ) ) { |
| 58 | 67 | define( 'WC_VIPPS_RECURRING_TEST_MODE', false ); |
| 68 | +} | |
| 69 | + | |
| 70 | +if ( ! defined( 'WC_VIPPS_RECURRING_ALLOW_CHECKOUT_OPTION' ) ) { | |
| 71 | + define( 'WC_VIPPS_RECURRING_ALLOW_CHECKOUT_OPTION', false ); | |
| 59 | 72 | } |
| 60 | 73 | |
| 61 | 74 | WC_Vipps_Recurring::register_hooks(); |
| 62 | 75 | if ( get_option( WC_Vipps_Recurring_Helper::OPTION_CHECKOUT_ENABLED, false ) ) { |