init_hooks(); } if ( class_exists( 'WCS_Background_Repairer' ) ) { include_once __DIR__ . '/class-wc-payments-subscriptions-migrator.php'; self::$stripe_billing_migrator = new WC_Payments_Subscriptions_Migrator( $api_client, $token_service ); } } /** * Get the Event Handler class instance. * * @return WC_Payments_Subscriptions_Event_Handler */ public static function get_event_handler() { return self::$event_handler; } /** * Returns the the product service instance. * * @return WC_Payments_Product_Service The product service object. */ public static function get_product_service() { return self::$product_service; } /** * Returns the the invoice service instance. * * @return WC_Payments_Invoice_Service */ public static function get_invoice_service() { return self::$invoice_service; } /** * Returns the the subscription service instance. * * @return WC_Payments_Subscription_Service */ public static function get_subscription_service() { return self::$subscription_service; } /** * Returns the the Stripe Billing migrator instance. * * @return WC_Payments_Subscriptions_Migrator */ public static function get_stripe_billing_migrator() { return self::$stripe_billing_migrator; } /** * Determines if this is a duplicate/staging site. * * This function is a wrapper for WCS_Staging::is_duplicate_site(). * * @return bool Whether the site is a duplicate URL or not. */ public static function is_duplicate_site() { if ( class_exists( 'WC_Subscriptions' ) && version_compare( WC_Subscriptions::$version, '4.0.0', '<' ) && method_exists( 'WC_Subscriptions', 'is_duplicate_site' ) ) { return WC_Subscriptions::is_duplicate_site(); } return class_exists( 'WCS_Staging' ) && method_exists( 'WCS_Staging', 'is_duplicate_site' ) && WCS_Staging::is_duplicate_site(); } }