Ecommerce Shopify WordPress Discussion

why Woocommerce Custom payment gateway ipn callback return -1 and cant handle?

With my plugin I generate a payment link that redirects the customer to the corresponding bank, according to a documentation that I found and that matches the response I have 3 url, x_url_callback, x_url_complete and x_url_failure included in the payment intent, once the payment is done I want to return to the ecommerce, but capturing the response, to know if the payment is canceled, complete, etc. for this I have been advised to use woocommerce_wc_api with a function called check_ipn_response, but it doesn't work for me, I should change these x_urls but I don't know for which ones. the url that appear is this: http://localhost:8000/?wc-api=WC_Plugin_Gateway?x_account_id=secret&x_amount=1230.0&x_currency=CLP&x_reference=57&x_result=failed&x_timestamp=2024-01-30T17:46:33Z&x_message=Cancelado%20por%20usuario&x_signature=secret the docs in woocommerce forums recommend use ipn callback like this class WC_Plugin_Gateway extends \WC_Payment_Gateway{ public function __construct(){ $this->notify_url = WC()->api_request_url('WC_Plugin_Gateway'); add_action('woocommerce_api_' . strtolower(get_class($this)), array($this, 'handle_callback')); } public function handle_callback() { header('HTTP/1.1 200 OK'); error_log("hi callback"); wp_die(); } } I send this data to our gateway endpoint and return other url to redirect to bank $new_data = array( "platform" => "woocommerce", "paymentMethod" => "webpay", "x_account_id" => $this->token_service, "x_amount" => round($monto), "x_currency" => get_woocommerce_currency(), "x_customer_email" => $email, "x_customer_first_name" => $nombre_customer, "x_customer_last_name" => $apellido, "x_customer_phone" => $telefono, "x_description" => $cadenaProductos, "x_reference" => $order_id, "x_shop_country" => !empty($shop_country) ? $shop_country : 'CL', "x_shop_name" => $nombreSitio, "x_url_callback" => $this->notify_url, "x_url_cancel" => $this->notify_url, "x_url_complete" => $this->notify_url, "secret" => $_ENV['SECRET'] ); My english is so bad, i hope you can help me, i am desperate look up by all internet I followed the woocommerce documentation where I did the same with paypal but it didn't work and I also followed these links
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.