如何获取woocommerce信用卡表格数据?

问题描述 投票:0回答:1

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 = ??;
    }

如何获得信用卡号和其他详细信息以便我可以发布?

html wordpress post woocommerce payment-gateway
1个回答
0
投票

对我有用:

WC()->checkout()->getValue('your-id-card-number')
© www.soinside.com 2019 - 2024. All rights reserved.