You’re saving the transaction details as a serialized object in post-meta and then you’re trying to search for a specific order ID. Your problem is here:
$data = get_post_meta( $ggowlccpy_order_id, $key = '_ggowlccpy_refund_details_get',
$single = false );
get_post_meta
requires a post ID but you’re passing it the order ID you want to search for.
How to search for the order ID? The problem is that it’s packed into a serialized object. One way would be to also store the order ID as a separate meta value so that you can search for it directly, e.g. (untested sorry)
add_post_meta( $post->ID, '_ggowlccpy_merchant_ref', $ggowlccpy_order_id);
$meta_query = new WP_Meta_Query(array(
meta_key = '_ggowlccpy_merchant_ref',
meta_value = $ggowlccpy_order_id,
compare="="));
$orders = $wpdb->get_results($meta_query->get_sql( 'post', $wpdb->posts, 'ID' ));
It won’t be possible to match the existing serialized value: you’re base64-encoding it to obscure the value in the database. (At least I guess this is to obscure it: you don’t generally need to base64-encode the output of PHP serialize value.) If this wasn’t base64-encoded then you could e.g. serialize the order ID and then search for _ggowlccpy_refund_details_get values that are LIKE (i.e. contain as a substring) the serialized order ID, then deserialize all of the results and check each one for merchant_ref = order ID until you find the correct one. However if you do need to query by this then I think a separate new post_meta value is easier and better.