Support » Plugin: WooCommerce » 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:

    For simple porpose the code:

    add_action('plugins_loaded', 'woocommerce_multibanco_init', 0);
        if (!class_exists('WC_Payment_Gateway')) {
        class WC_Multibanco extends WC_Payment_Gateway {
            /** @var string Access key for MB */
            var $chave_anti_phishing;
            public function __construct() {
                global $woocommerce;
                $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)
  • I have exactly the same error. I’m glad I came here to find out “1” means cannot be found.

    My class is class WC_Gateway_PayNow extends WC_Payment_Gateway {}

    add_action does this add_action( 'woocommerce_api_wc_gateway_paynow', array( $this, 'check_ipn_response' ) );

    This function exists: function check_ipn_response() {}

    What might I be doing wrong?

    You should make a new class outside of the payment class, and name it in your url, for example:

    class callback_function{
    	public function __construct(){

    and, write this as your callback url:

    i dont know if its the way that is supposed to be, but it worked for me …

    try this
    function add_multibanco_gateway($methods) {
    $methods[] = ‘wc_multibanco’;
    return $methods;

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘API payment gateway issue on callback’ is closed to new replies.