diff --git a/includes/subscriptions/class-wc-payments-subscriptions-event-handler.php b/includes/subscriptions/class-wc-payments-subscriptions-event-handler.php index 03bc9acbe36..51c43a6693e 100644 --- a/includes/subscriptions/class-wc-payments-subscriptions-event-handler.php +++ b/includes/subscriptions/class-wc-payments-subscriptions-event-handler.php @@ -114,6 +114,7 @@ public function handle_invoice_paid( array $body ) { if ( is_wp_error( $order ) ) { throw new Rest_Request_Exception( __( 'Unable to generate renewal order for subscription on the "invoice.paid" event.', 'woocommerce-payments' ) ); } else { + $order->set_payment_method( WC_Payment_Gateway_WCPay::GATEWAY_ID ); $this->invoice_service->set_order_invoice_id( $order, $wcpay_invoice_id ); } } @@ -156,6 +157,7 @@ public function handle_invoice_payment_failed( array $body ) { if ( is_wp_error( $order ) ) { throw new Rest_Request_Exception( __( 'Unable to generate renewal order for subscription to record the incoming "invoice.payment_failed" event.', 'woocommerce-payments' ) ); } else { + $order->set_payment_method( WC_Payment_Gateway_WCPay::GATEWAY_ID ); $this->invoice_service->set_order_invoice_id( $order, $wcpay_invoice_id ); } }