Bläddra i källkod

fix: Redirect Web Form user directly to success URL, if no amount is due (backport #12661) (#12856)

If there is no amount due when using WebForms which accept payments, redirect the user directly to the success URL. This is useful for free items.

(cherry picked from commit f8f1301b79)

Co-authored-by: ci2014 <christoph.isik@wpci.de>
version-14
mergify[bot] 4 år sedan
committed by GitHub
förälder
incheckning
c7c2362f9c
Ingen känd nyckel hittad för denna signaturen i databasen GPG-nyckel ID: 4AEE18F83AFDEB23
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. +5
    -0
      frappe/website/doctype/web_form/web_form.py

+ 5
- 0
frappe/website/doctype/web_form/web_form.py Visa fil

@@ -215,6 +215,11 @@ def get_context(context):
amount = self.amount
if self.amount_based_on_field:
amount = doc.get(self.amount_field)

from decimal import Decimal
if amount is None or Decimal(amount) <= 0:
return frappe.utils.get_url(self.success_url or self.route)
payment_details = {
"amount": amount,
"title": title,


Laddar…
Avbryt
Spara