Why can't mollie call webhook URL? - webhooks

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.

Related

I am having an issue with stripe checkout redirecting to the stripe payment page once deployed with Netlify

Hi I am trying to integrate stripe checkout into my webapp. Whenever I click on the "purchase button" which is supposed to redirect you to the stripe checkout page, I get this error VM97:1 Uncaught (in promise) SyntaxError: Unexpected token '<', "I have a Node.js & express backend that is handling the api call to stripe
However, in the localhost environment, I go through the same flow it works perfectly fine just as its expected to. It will open up the checkout page with the customers cart. I only get that error previously stated when deployed.
This is the api endpoint to handle the response
enter image description here
This is a call to the api in order to redirect to stripe
enter image description here
I made a few changes to the await function. I was thinking maybe the response was failing before it made it to the final ".then". Reason because the error is saying uncaught in promise.
Your code looks fine. The fact it was working on local but failed on deployed environment hints that your deployed environment doesn't have the correct Stripe Secret key, therefore it errored (500) while processing, causing client unable to process the response.
You would want to debug deeper on your server log to see the detailed error, and also check on your Stripe request log.

Cypress issue with connection to the site is not secure?

I'm testing the website which have request to optimizely api to do some checking.
It request to url like https://cdn.optimizely.com/datafiles/XXX.json I suppose that this site required secure network.
I tried to open the url in cypress chrome and I get this error
This page isn’t workingcdn.optimizely.com didn’t send any data.
ERR_EMPTY_RESPONSE
But when I tried with the same network in chrome, I get fine response.
I need to be able to load the url to test my site.
Is there any solution to this matter. Please advice.
The resource returns 403 status code, that most likely indicates you don't have sufficient rights to see it:
Your Chrome outside Cypress runs might be set up differently, might already have session cookies.
You most likely need to figure out how to log into some account on the site throught Cypress.
Since cypress will not load optimizely neither nor google-analytics or any . My work around solution is by using cy.intercept() function in before/beforeEach
The code looks something like
cy.intercept('https://cdn.optimizely.com/datafiles/XXX8.json', {
"version": "4"
}
Reference: cypress-example-recipes

Cannot load webpage from Postman because of javax.faces.ViewState?

I am trying to integrate a web application written by someone else with an API written by someone else. At the moment I am trying to test one of the webpages using Postman. When the webpage is loaded in a browser it works correctly. I have replicated all of the headers and body in Postman, however when I try to launch the webpage in Postman a HTTP 500 status code appears (internal server error).
I think the issue is with: javax.faces.ViewState, which is a body key/value pair. I initially do I get request to the webpage in Postman and get the viewstate:
I tried passing the value: xxxxxxxxxxxxxxxxxxxxxx;yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy in the body key/value pair, but still I get an internal server error. I have also checked that the JSESSIONID cookie is identical in the GET request and the POST request.
I have also noticed that if I access the webpage from a browser, then there is a colon instead of a semi colon in the value if that has any bearing.
Most of what I have tried so far was suggested in the answer to this question: How to programmatically send POST request to JSF page without using HTML form?
What am I doing wrong?

What is the need to verify reCaptcha in the server side?

I am implementing google reCaptcha. In the Google documentation, they say the way to do it. The documentation suggests server side validation of captcha. I wanted to know why we need to verify it in the server side as it is already verified in the UI side from the google server. Is it a suggested to implement captcha in the UI side alone with no validation in the server? What are the problems(if any) if done in UI alone.
a example would be: you're creating a register form and want to prevent bots to create a account on your site, you need to verify it serverside, because in the background you're sending a request which will look something like this:
POST /register 1.1 HTTP
Host: www.example.com
{"username":"example","email:"hey#gmail.de","captcha-token":"123984f729340fmu2q34f9"}
and if you dont send the captcha-token with the request or the server doesnt validate it, this bot could just spam this request without loading the frontend page. Please mind in head, that bots dont visit your "UI" (frontend page). Just verify everything serverside like text length, bad characters, rate limits...

Receiving "400 Bad Request" for /oauth/access_token

I have approved for public_content clientId. To get access token, I send a request to www.instagram.com:
GET /oauth/authorize?client_id=MyClientId&redirect_uri=MyRedirectURL&response_type=code&scope=likes+comments+public_content HTTP/1.1`
After authentication, the browser redirects me to MyRedirectURL and I can get the code from the URL.
With this code I send a request to api.instagram.com:
/oauth/access_token HTTP/1.1
client_id=MyClientId&client_secret=MyClientSecret&grant_type=authorization_code&redirect_uri=MyRedirectURL&code=CodeFromURL`
But sometimes I get response HTTP/1.1 400 Bad Request.
This situation continues for a few hours, and sometimes for a day. It is interesting that the problem is very unstable. I may have two client apps that make identical requests, and one app will work fine, while the other will fail at the same time. Looks like it is a problem somewhere in the Instagram infrastructure.
Instagram is no longer supporting custom schemas for your callback urls. That was my problem, I changed it to https and the problem was solved.
I think you should prefer this document of Instagram.
You may also receive responses with an HTTP response code of 400 (Bad
Request) if we detect spammy behavior by a person using your app.
These errors are unrelated to rate limiting.
It seems like , we can not use http://localhost/... in call back url. Instagram may have restricted it.
It worked for me, when I have added live Ip of my aws server. for example http://xx.xx.xx.xx/.. instead of localhost.

Resources