Skip to content

Commit

Permalink
[IMP]pms: payment link acquirer set
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioLodeiros committed Jul 2, 2024
1 parent 4814c75 commit c460d9d
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions pms/wizards/folio_payment_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,34 @@ def _generate_link(self):
acquirer = self.env["payment.acquirer"].search(
[
("pms_property_ids", "in", folio.pms_property_id.id),
("state", "=", "enabled"),
],
limit=1,
)
record = self.env[payment_link.res_model].browse(payment_link.res_id)
payment_link.link = (
"%s/website_payment/pay?reference=%s&amount=%s&currency_id=%s"
"&acquirer_id=%s&folio_id=%s&company_id=%s"
"&access_token=%s"
) % (
record.get_base_url(),
urls.url_quote_plus(payment_link.description),
payment_link.pending_amount,
payment_link.currency_id.id,
acquirer.id if acquirer else None,
payment_link.res_id,
payment_link.company_id.id,
payment_link.access_token,
)
if payment_link.partner_id:
payment_link.link += "&partner_id=%s" % payment_link.partner_id.id
if acquirer:
record = self.env[payment_link.res_model].browse(
payment_link.res_id
)
payment_link.link = (
"%s/website_payment/pay?reference=%s&amount=%s&currency_id=%s"
"&folio_id=%s&company_id=%s"
"&access_token=%s"
) % (
record.get_base_url(),
urls.url_quote_plus(payment_link.description),
payment_link.amount,
payment_link.currency_id.id,
payment_link.res_id,
payment_link.company_id.id,
payment_link.access_token,
)
if acquirer:
payment_link.link += "&acquirer_id=%s" % acquirer.id
if payment_link.partner_id:
payment_link.link += (
"&partner_id=%s" % payment_link.partner_id.id
)
else:
payment_link.link = False
else:
super(FolioPaymentLink, payment_link)._generate_link()

0 comments on commit c460d9d

Please sign in to comment.