【发布时间】:2019-07-01 09:39:13
【问题描述】:
我开发了自定义支付网关,它将使用从支付服务器获得的响应(如自定义 ID)保存信用卡信息。第二次登录时必须显示同一客户的保存信息。
1) 我第一次将客户 ID 发送到支付网关,它将发送网关客户 ID 并将其存储在数据库中 2) 同一用户第二次登录需要显示保存抄送信息。 我已经尝试过,但不确定这在 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>
}
【问题讨论】:
-
“无法在 show_form 中恢复”是什么意思?首先,您没有在 show_form() 函数中正确调用 get_post_meta。
标签: php wordpress woocommerce