Closed PikaMug closed 3 years ago
Some closing notes:
The paypal integration is working fine And there is no way to update webhook yet within NamelessMC so only way to modify is from Paypal developer portal
The paypal integration is working fine And there is no way to update webhook yet within NamelessMC so only way to modify is from Paypal developer portal
Current PayPal integration works fine if the server environment supports the getallheaders
method, which not all do (Nginx, PHP-FPM, FastCGI). This PR will resolve those situations without modifying behavior of already supported environments.
Of course control over the webhook is limited but there's no way to specify SDK type in the Developer Portal as far as I could tell. You can set the events tracked, but as far as specifying PHP over Python there's no obvious configuration.
This PR is live on my website. Feel free to reach out to me on the NamelessMC discord if you'd like to take a peek.
Thank you for this!
This PR is two-part. First is the solution to the current problem mentioned in #43:
According to this SO post, the
getallheaders
method does not exist in all environments. I'm using Pebblehost (a NamelessMC partner), so I hope you agree this solution is desirable. However, it's still not enough to get PayPal integration working.It turns out that the PayPal headers are also invalid. For example, instead of expected
PAYPAL-CERT-URL
the webhook returnsHTTP_PAYPAL_CERT_URL
instead. I suspect this is because PayPal thinks we're using the Python SDK, but I couldn't find a way to specify otherwise (and besides v1 is deprecated). I hope you'll find the solution in my final commit acceptable.