Hi @shanemarsh28 – Have you followed the instructions here to setup the Webhook in Stripe?: https://docs.woocommerce.com/document/stripe/#section-3
Also, please make sure that you select Receive all events when you set up your webhook.
– Joey
Thread Starter
Shane
(@shanemarsh28)
Hi Joey,
Thank for your reply. The issue has nothing to do with Receive all events.
This line is the problem (as described above):
if ( ! empty( $request_headers['USER-AGENT'] ) && ! preg_match( '/Stripe/', $request_headers['USER-AGENT'] ) ) {
return false;
}
When this line is removed (as per my initial message), the webhook behaves correctly.
For confirmation of the issue, see this document from AWS: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html
Amazon say:
User-Agent: “CloudFront replaces the value of this header field with Amazon CloudFront. If you want CloudFront to cache your content based on the device the user is using, see Configuring Caching Based on the Device Type.”
We cannot disable this or work around it by altering the settings within the Cloudfront Distribution therefore we need you to be able to toggle this security test on or off from within your plugins settings. Commenting out the three lines is sufficient but it’s not a long term fix.
I hope this makes more sense.
Shane
-
This reply was modified 6 years ago by
Shane.
Plugin Support
dougaitken
(@dougaitken)
Automattic Happiness Engineer
Hey @shanemarsh28
Can I ask you to open up an Issue on GitHub with the details here, please? I’m unsure if we’d create a setting for specifically one CND but the development team can offer their advice around this.
Thanks,
Thread Starter
Shane
(@shanemarsh28)
Plugin Support
dougaitken
(@dougaitken)
Automattic Happiness Engineer
Hi @shanemarsh28
I’ll close off this forum thread and pass this to the development team for discussion. They will update that GitHub issue with any progress / thoughts.
Thanks,