DEFRA / waste-carriers-frontend

Waste Carrier Registrations Frontend Code
Other
1 stars 1 forks source link

Use CGI.escape for Worldpay urls #274

Closed Cruikshanks closed 4 years ago

Cruikshanks commented 4 years ago

https://eaflood.atlassian.net/browse/RUBY-729

Whilst working with Worlpay to move to their new hosted pages service, it was spotted that the urls the frontend tells Wordpay to redirect users back to when payment is complete were not being escpaed properly.

Worldpay advise that they are escaped to ensure there are no issues.

The waste-carriers-engine uses CGI.escape instead of URI::encode and we found in testing that it then matches what worldpay expect.

Cruikshanks commented 4 years ago

We know Hakiri fails, and I've only been caught out by Codeclimate because I touched a file with already poor code coverage.

Plus we are working on replacing this code anyway. So I intend to ignore those fails as part of this PR.

cintamani commented 4 years ago

Shall we listen to Codeclimate and add some test coverage there?

Cruikshanks commented 4 years ago

Shall we listen to Codeclimate and add some test coverage there?

Not sure I see the point. We've gone 4 years without it, and now we're in the final weeks of replacing the code. So I'm not sure there is value in me trying to up the coverage for something I'm hoping we'll have binned by Christmas!

But I can be persuaded if you think otherwise.