I have developed custom payment gateway which will save the credit card info using response got from payment server like custom id. Have to show the saved information for the same customer while logged second time.
1) First time i will send the customer id to payment gateway it will send the gateway customer id and store it in database 2) The same user will logged second time need to show the save cc info. I have tried and not sure how this works in WooCommerce.
//Custom plugin gateway
function handler_response(){
//store the gateway custom id in database
add_post_meta($order->id,'_customer_id',$_POST['gateway_custom_id']); //this is wrong way to store. once i stored in database can't get back to check in show_form function
}
function show form(){
//get_post_meta('_customer_id')
// check condition if gateway customer id available or not and if it is avaiable show the saved cc info or if it is first time send the customer id to gateway
<form>
<input type="text" name="">//Show saved cc info here
</form>
}