Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /../plugins/rm-payment.php

My guess is that you’re accessing $response as an array when it’s a \WP_Error. Check out the possible return values of wp_remote_post:

(array|WP_Error) The response or WP_Error on failure.

You should modify your code in a couple of ways:

$response = wp_remote_post( $remote_url, $request );

if ( is_wp_error( $response ) ) {
    // handle the error response here.
}

$body = wp_remote_retrieve_body( $response );

if( false !== strlen( $body ) ) {

This ensures you catch any \WP_Error returns and gets the body data using wp_remote_retrieve_body. You can also use wp_remote_retrieve_response_code( $response ) to get the HTTP status code (e.g. 200, 401, etc.)