Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions payments/templates/pages/stripe_checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ def get_context(context):
context.image = get_header_image(context.reference_docname, gateway_controller)

context["amount"] = fmt_money(amount=context["amount"], currency=context["currency"])

try:
reference = frappe.get_doc(context.reference_doctype, context.reference_docname)
context["amount"] = fmt_money(amount=reference.grand_total, currency=reference.currency)
except:
frappe.log_error(
"Grant Total not found in {}," "For document {}".format(context.reference_doctype, context.reference_docname)
)
frappe.redirect_to_message(
_("Amount and currency could not be determined"),
_("Looks like someone sent you to an incomplete URL. Please ask them to look into it."),
)
frappe.local.flags.redirect_location = frappe.local.response.location
raise frappe.Redirect

if is_a_subscription(context.reference_doctype, context.reference_docname):
payment_plan = frappe.db.get_value(
Expand Down