/**
* Callback function that gets called when a customer cancels the payment directly
*/
public static function onCancel()
{
self::debug(__CLASS__ . ': OnCancel - URL: http' . ($_SERVER['SERVER_PORT'] == 443 ? "s://" : "://") . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
$order = self::$wc_api->getOrderFromApiUrl();
$order->add_order_note(__('PayPro - Customer cancelled payment. Redirected him back to his cart.'));
self::debug(__CLASS__ . ': OnCancel - Payment cancelled by customer for order: ' . $order->id . '. Redirecting back to cart.');
wp_safe_redirect(WC_Cart::get_cart_url());
exit;
}