Problem with tokenization developing a custom gateway

Can someone here give why does it this work :

These are content from the above link :
Hello everyone and thanks so much in advance for your support,

I am trying to extend a custom payment gateway using tokenization for woocommerce but I am having a problem that may be too obvious but i’ve spent all afternoon trying to figure out with no luck.

So, I have developed a custom payment gateway fully funtional extending the WC_Payment_Gateway_CC with:

$this->supports = array( ‘default_credit_card_form’);

To retrive the credit card information withing the class I use:

$_POST[‘{payment method id}-card-number’];
$_POST[‘{payment method id}-card-expiry’];
$_POST[‘{payment method id}-card-cvc’];
I now want to extend it to use ‘tokenization’ so the first(and only) thing I did was changing the “supports” line to:

$this->supports = array( ‘default_credit_card_form’, ‘tokenization’ );

After I did that suddently the credit card information is no longer in the $_POST variable. The $_POST variable I get now is.

$[POST]:{“payment_method”:”{payment method id}”,”wc-{payment method id}-payment-token”:”new”,”woocommerce_pay”:”1″,”_wpnonce”:”d1d883779d”,”_wp_http_referer”:”/checkout/order-pay/77/?pay_for_order=true&key=wc_order_5ae638306f334″}

Does anyone how how do I get the credit card information from the form when ‘tokenization’ is supported?

Thanks againg for your help. I’ve spent a few hours reading through documentation and forums and have no idea what else to try.

Read more here:: Problem with tokenization developing a custom gateway

Leave a Reply

Your email address will not be published. Required fields are marked *