From 4e60f706f64b7818f6d50b9806c6743a0f90ddad Mon Sep 17 00:00:00 2001
From: Matthew Wire <mjw@mjwconsult.co.uk>
Date: Thu, 19 Mar 2020 21:31:32 +0000
Subject: [PATCH] Add support for a function getTotalAmount that could be used
 to retrieve amount from form if defined

---
 js/civicrm_stripe.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/js/civicrm_stripe.js b/js/civicrm_stripe.js
index 89e90a1b..d3236797 100644
--- a/js/civicrm_stripe.js
+++ b/js/civicrm_stripe.js
@@ -545,6 +545,9 @@ CRM.$(function($) {
     if (isEventAdditionalParticipants()) {
       totalFee = null;
     }
+    else if (CRM.payment && typeof CRM.payment.getTotalAmount == 'function') {
+      return CRM.payment.getTotalAmount(form.id);
+    }
     else if (document.getElementById('totalTaxAmount') !== null) {
       totalFee = parseFloat(calculateTaxAmount());
       debugging('Calculated amount using internal calculateTaxAmount()');
-- 
GitLab