[IMP]pms: allow custom amount portal payment

This commit is contained in:
Darío Lodeiros
2024-03-16 12:49:00 +01:00
parent 5c06ffb6e5
commit 7b5397a820
3 changed files with 29 additions and 9 deletions

View File

@@ -93,6 +93,10 @@ class PortalFolio(CustomerPortal):
"success_url",
"%s?%s" % (folio_sudo.access_url, access_token if access_token else ""),
)
custom_amount = False
if "custom_amount" in kwargs:
custom_amount = float(kwargs["custom_amount"])
vals = {
"acquirer_id": acquirer_id,
"return_url": success_url,
@@ -118,6 +122,7 @@ class PortalFolio(CustomerPortal):
"subscription payments will be made automatically."
),
},
amount=custom_amount,
)
@http.route(
@@ -199,6 +204,8 @@ class PortalFolio(CustomerPortal):
download=download,
)
values = self._folio_get_page_view_values(folio_sudo, access_token, **kw)
if "custom_amount" in kw:
values["custom_amount"] = float(kw["custom_amount"])
return request.render("pms.folio_portal_template", values)