woocommerce信用卡表格是这样添加的:https://docs.woocommerce.com/wc-apidocs/source-class-WC_Payment_Gateway_CC.html#50-98
public function payment_fields() {
$cc_form = new WC_Payment_Gateway_CC();
$cc_form->id = $this->id;
$cc_form->supports = $this->supports;
$cc_form->form();
}
但是我必须将信用卡详细信息传递给API才能获得响应
public function process_payment( $order_id ) {
global $woocommerce;
$customer_order = new WC_Order( $order_id );
$order_data = $customer_order->get_data();
$creditcardnumber = ??;
}
如何获得信用卡号和其他详细信息以便我可以发布?
对我有用:
WC()->checkout()->getValue('your-id-card-number')