diff --git a/addons/payment_mollie/models/payment_transaction.py b/addons/payment_mollie/models/payment_transaction.py index 3ce46f89c7d..2571f18eaa9 100644 --- a/addons/payment_mollie/models/payment_transaction.py +++ b/addons/payment_mollie/models/payment_transaction.py @@ -38,7 +38,14 @@ class PaymentTransaction(models.Model): # The acquirer reference is set now to allow fetching the payment status after redirection self.acquirer_reference = payment_data.get('id') - return {'api_url': payment_data['_links']['checkout']['href']} + # Extract the checkout URL from the payment data and add it with its query parameters to the + # rendering values. Passing the query parameters separately is necessary to prevent them + # from being stripped off when redirecting the user to the checkout URL, which can happen + # when only one payment method is enabled on Mollie and query parameters are provided. + checkout_url = payment_data['_links']['checkout']['href'] + parsed_url = urls.url_parse(checkout_url) + url_params = urls.url_decode(parsed_url.query) + return {'api_url': checkout_url, 'url_params': url_params} def _mollie_prepare_payment_request_payload(self): """ Create the payload for the payment request based on the transaction values. diff --git a/addons/payment_mollie/views/payment_mollie_templates.xml b/addons/payment_mollie/views/payment_mollie_templates.xml index 1ae04addbdc..990cd0a6514 100644 --- a/addons/payment_mollie/views/payment_mollie_templates.xml +++ b/addons/payment_mollie/views/payment_mollie_templates.xml @@ -3,7 +3,11 @@