Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Whitelisted function does not run for some post requests

Hello everyone, I am integrating Paystack, a payment processor, with ERPNext.

What I have done
I created a whitelisted python function “verify_payment” that just logs whatever is sent to it via a http post request.
I used Postman to send a POST request with some sample data. I tried both raw json and form-data options
The function was able to log the data sent from Postman as I defined.

According to their documentation, Paystack will send a POST with the transaction data to the webhook URL I provided. https://paystack.com/docs/payments/webhooks/#receiving-an-event
So I saved the URL https://example.com/api/method/momo.momo.doctype.paystack_settings.paystack_settings.verify_payment in my Paystack account dashboard so that when there is a successful payment, the payment processor will notify me.

Issue
When I did a test payment to the payment processor, I got an email that the test payment was successful, but my python function didn’t output anything.

So I used postman to send two different post request again just to be sure the python function is working. The function run and logged the data correctly .

Debugging
So I created a NodeJS app with a POST endpoint which just logs the data sent to it, on the same google cloud instance with same domain name but different URL.
I saved this new URL in the Paystack webhook input.
I did a test payment and this time, it received Paystack’s payment response.

So my question then is.
Can someone please tell me why my python function receives the data from postman but not from Paystack, but my NodeJS app receives data from Paystack and Postman