I'm trying to write my own payment gateway for WooCommerce and it's going pretty well. Now my payment provider can do a callback to verify the payment status, so i created a callback function.
add_action('woocommerce_api_'.strtolower(get_class($this)), array(&$this, 'callback'));
public function callback()
{
mail('[email protected]', 'callback ideal', print_r($_REQUEST,true) . print_r($_SERVER,true));
echo '+';
return '+';
}
When i call the callback URL, i recieve the email that's in the callback function, however the output the callback gives is always 1.
I did some googling on what the 1 means, it means the callback doesn't end or isn't called at all.
In my case it does get called, since i recieve the email. Could someone point me in the right direction ? I must be missing something.
Update:
When i kill the script with an exit in the callback function, i can see the output. But this probably isn't the appropriate solution