mollie / mollie-odoo

Mollie Payments plugin for Odoo - an open source CRM and ERP
29 stars 50 forks source link

[FIX] payment_mollie_official: allow spaces in SO sequences #32

Closed Yenthe666 closed 5 years ago

Yenthe666 commented 5 years ago

Before this fix you would get an internal server error when you would try to pay an order on an Odoo instance that has an order ID such as "SO 12345678" If you would try to pay for "SO 12345678" this controller call would fail and you would get back the following response from the Mollie API's: response: {'error': {'message': 'The redirect URL is invalid', 'field': 'redirectUrl', 'type': 'request'}} The space in "SO 12345678" was not readable by Mollie which caused Mollie to send back an invalid redirect URL. Technically the directURL is correct but the API's fail on spaces. This fix converts ' ' into '%20' - the computer equivalent of a space. This will allow Odoo users to use spaces in sequence names for orders without breaking the payment flows.

Yenthe666 commented 5 years ago

@martijnpolder yet another fix for you :)

Yenthe666 commented 5 years ago

Note to self: we have to check this later on in V12 too: https://github.com/mollie/mollie-odoo/blob/7cd20049293cd898ea03f2338d7de27d4c10aece/payment_mollie_official/controllers/main.py#L126-L128