getMessage() ); } } /** * A renewal was paid. * * The renewal order also moves to a paid status, so the status hook will * reach the same order and compute the same event id. Both are registered * because a gateway that marks a renewal paid without a status transition * would otherwise be missed, and the queue's unique event id means two * triggers still produce one conversion. * * @param WC_Subscription $subscription The subscription. * @param WC_Order $last_order The renewal order. * @return void */ public static function on_renewal_paid( $subscription, $last_order = null ) { try { if ( ! is_a( $last_order, 'WC_Order' ) ) { return; } Affiliatant_Reporter::report_sale( $last_order ); } catch ( \Throwable $e ) { Affiliatant_Sender::log( 'Reporting a subscription renewal failed: ' . $e->getMessage() ); } } }