renew( $order, $container ); }, 10, 2 ); add_action( 'woocommerce_scheduled_subscription_payment_' . CreditCardGateway::ID, function ( $amount, $order ) use ( $container ) { $this->renew( $order, $container ); }, 10, 2 ); } /** * Handles a Subscription product renewal. * * @param \WC_Order $order WooCommerce order. * @param ContainerInterface|null $container The container. * @return void */ protected function renew( $order, $container ) { if ( ! is_a( $order, \WC_Order::class ) ) { return; } $handler = $container->get( 'subscription.renewal-handler' ); $handler->renew( $order ); } /** * Returns the key for the module. * * @return string|void */ public function getKey() { } }