Forums

Stripe payment processing

My webhook through Stripe was working perfectly during test mode, but once I pushed it live I'm having 301 errors again. The webhook keeps trying to redirect to HTTP instead of HTTPS and I'm not sure how to fix that. I do have an auto-renew certificate through Let's Encrypt, I have force HTTPS turned on, and the entirety of my site runs under HTTPS, just not my webhook. Any suggestions?

I think I have (temporarily, at the very least) fixed the issue. I had to create an A record with my domain registrar (Google Domains) using the IP address for my PythonAnywhere install. I'm hoping these are static IP addresses, otherwise I will have to do this again when the IP address refreshes. I got my IP address by going to the console and typing curl https://4.icanhazip.com and using that in my domain's A record.

If that fixed your issue, then you were probably directing your webhooks through a redirection service instead of directly to your web app.

I didn't have any redirection service set up; the request path is and has always gone straight through Google Domains. I believe the only reason I was having a redirection issue is due to the fact that I only had a CNAME record set up for my domain, not an A record. Adding the A record resolved the problem.