Print value of an array or variable in a payment plugin

Those are values you’ll need to write to the log in order to view them.

In order to do that, make sure you’ve got debugging turned on in your wp-config.php:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );

Then, use the following utility function to write your values to the log. You could just use error_log( $value ), bu this utility will handle dealing with arrays/objects without having to worry about formatting arrays for the log file:

function write_log( $log )  {
    if ( is_array( $log ) || is_object( $log ) ) {
        error_log( print_r( $log, true ) );
    } else {
        error_log( $log );
    }
}

Now instead of var_dump(), you can call write_log() to dump your result to /wp-content/error.log:

write_log($response);
write_log($response_body);

(There was a similar type of question yesterday, if you want to see some additional detail.)