I have build a custom webshop using PHP and typescript with React, and to process payments I am using Mollie.
I have tested everything locally and on the server (shared webhosting) and it all works. But when I make a payment in either live or test mode Mollie prompts that it failed to call the webhook. This is what I see in my dashboard:
Failed to call webhook (Got HTTP/1.1 405 Method Not Allowed instead of 20x)
I tried to call the webhook from Postman and a simple HTML form:
<form method="POST" action="http://shop.example.com/webhooks/webhook.php">
PaymentID: <input type='text' name='id'/>
<input type='submit' value='send'/>
</form>
From both Postman and the HTML form I get a positive response 200 OK
, also the payment gets processed correctly. I know this because the database gets updated to verify the order and I get a confirmation email. Which are actions performed in the webhook script. So the script works correctly.
Sometimes I either see this message in chrome:
ERR_SSL_UNRECOGNIZED_NAME_ALERT
I think that this issue is caused by the fact that I don't have a SSL certificate for my domain, but can't find anything about this online. Also the shop is hosted on a subdomain shop.website.org/
.
Can anyone verify that this issue is caused by the lack of a SSL certificate or that something else might cause this problem?
Solved this problem!
Mollie requires a SSL certificate, it won't call your Webhook over http only https.