Discussions

Ask a Question
Back to All

Inconsistent urlencoding of the redirect_url in the create_payment API

Hi,
I've successfully integrated Satispay as a custom payment gateway in Snipcart, however I'm facing a minor glitch due to a small difference in how urlencoding and decoding are performed by the regular web payment "modal" and the mobile app.

Our redirect_url contains a query parameter (redir) that points to another url with some hash parameters (let's say, https://foo.bar/pippo#/checkout).

When I try and cancel the payment from a regular web browser, I'm redirected to url "A":

A) /payments/satispay/result?external_code=63e4d8454fc6a60293532f41&lang=it&redir=https%3A%2F%2Ffoo.bar%2Fpippo%23%2Fcheckout

The hash parameter is correctly encoded and can be used as part of the "redir" url.

However, if I do the same from a web browser, the Satispay application kicks in and when I cancel the payment I'm being sent to "B":

B) /payments/satispay/result?external_code=63e4414f4fc6a60293532f40&lang=it&redir=https://foo.bar/pippo#/checkout

The hash portion of the url doesn't belong to the redir parameter anymore and this is causing us minor issues.

Can this thing be addressed in future releases of the app?

Thank you