diff --git a/payments/payment_gateways/doctype/braintree_settings/braintree_settings.py b/payments/payment_gateways/doctype/braintree_settings/braintree_settings.py index 7e0f3412..0ea0a016 100644 --- a/payments/payment_gateways/doctype/braintree_settings/braintree_settings.py +++ b/payments/payment_gateways/doctype/braintree_settings/braintree_settings.py @@ -269,11 +269,13 @@ def create_charge_on_braintree(self): status = "Error" redirect_url = "payment-failed" + get_parameters = [("doctype", self.data.reference_doctype), ("docname", self.data.reference_docname)] if redirect_to: - redirect_url += "?" + urlencode({"redirect_to": redirect_to}) + get_parameters.append(("redirect_to", redirect_to)) if redirect_message: - redirect_url += "&" + urlencode({"redirect_message": redirect_message}) + get_parameters.append(("redirect_message", redirect_message)) + redirect_url += "?" + urlencode(get_parameters) return {"redirect_to": redirect_url, "status": status}