Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NotificationURL format is invalid" when using a local route #188

Closed
markmead opened this issue Jul 18, 2022 · 8 comments
Closed

"NotificationURL format is invalid" when using a local route #188

markmead opened this issue Jul 18, 2022 · 8 comments

Comments

@markmead
Copy link

markmead commented Jul 18, 2022

Hello there 👋

I'm trying to update to v3 making use of SagePay_Server but when I use a named/local route for notifyUrl I hit the following error:

3011 : The NotificationURL format is invalid.

Here's the code that is causing the issue:

'notifyUrl' => route('payment.sagepay.notify'),

Results to something like http://localhost:12345/payment/notify.

Strangely (to me), if I pass in a route like http:://www.something123.test/ it works fine.

It's worth noting that I am using Lando.

@judgej
Copy link
Member

judgej commented Jul 18, 2022

Sage Pay will send a POST to the notify url. Make sure you don't have any CSRF security on that route. Laravel will use that by default, unless you explicitly disable it. Other frameworks are likely to do the same.

@judgej
Copy link
Member

judgej commented Jul 18, 2022

Though having read again, that's not the problem you are having!

The 3011 comes from the remote server. Could it be only accepting https?

@judgej
Copy link
Member

judgej commented Jul 18, 2022

Error documentation here https://www.opayo.co.uk/search/all?keyword=3011

@markmead
Copy link
Author

I think HTTP is fine, but this line is the answer.

The NotificationURL field must contain a Fully Qualified Domain Name

Thankfully, Lando provides a http://name.land.site/ URL, I'll give that a whirl.

@judgej
Copy link
Member

judgej commented Jul 19, 2022

Oh course, that makes sense. You can use a service such as https://ngrok.com/ to tunnel the notifications to your local machine, if you aren't working on a public domain.

@markmead
Copy link
Author

NGROK was the ticket, thanks a lot!

Now it's working I'm a little lost on how you handle where to redirect a user when they click "Cancel", I've looked through the README but I can't seem to find anything that answers this.

@markmead
Copy link
Author

Ignore me, it was an issue in the code, hah! Thanks for all the help!

@judgej
Copy link
Member

judgej commented Jul 19, 2022

No, it was a good question that others are bound to hit, and you stuck around to confirm what the fix was :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants