Solution to my problem: in includes/modules/payment/as2checkout.php I had to change HTTPS_SERVER to HTTP_SERVER (around line 181), as we aren't using SSL for this site.