API payment gateway issue on callback
-
Im having the same issue here, I have created a gateway payment everything works but cant seem to get the call back working… it allway returns “1”, (I know this means it doesnt find it or doesnt exist)
The payment is done from the ATM and when it’s payed the atm company will execute my callback url: example: https://www.xpto.com/wc-api/WC_Multibanco/?orderid=123&blabla=adb
For simple porpose the code:
add_action('plugins_loaded', 'woocommerce_multibanco_init', 0); if (!class_exists('WC_Payment_Gateway')) { return; } class WC_Multibanco extends WC_Payment_Gateway { /** @var string Access key for MB */ var $chave_anti_phishing; public function __construct() { global $woocommerce; //I HAVE HAVE HIDDEN ALL THE OTHER FIELDS ON PORPOSE $this->return_url = str_replace('https:', 'http:', add_query_arg('wc-api', 'WC_Multibanco', home_url('/'))); // Payment listener/API hook add_action('woocommerce_api_wc_multibanco', array($this, 'check_mb_response')); } /** * MB response function. * * @access public * @return void */ public function check_mb_response() { global $woocommerce; echo "WORKING CALLBACK"; } } function add_multibanco_gateway($methods) { $methods[] = 'WC_Multibanco'; return $methods; } add_filter('woocommerce_payment_gateways', 'add_multibanco_gateway'); }
Please help…
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘API payment gateway issue on callback’ is closed to new replies.