I'm using Sagepay payment gateway with woocommerce. When an order is processed, Sagepay returns the CardType value and it is visible in the Order Note that is created. I need to get this value.
I was hoping I could get it using wc_get_order but I can't find it.
Can anyone point me in the right direction?
Found it!
It is in the _sageresult field in the wp_postmeta table.
$notes=get_post_meta($order_id,'_sageresult',true);
echo $notes['CardType'];