Skip to content

Commit bc602a7

Browse files
Revert "Add a function getTotalAmount() instead of relying on calculateTotalFee() that only exists in specific circumstances"
This reverts commit 999a7e5.
1 parent d93e413 commit bc602a7

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

Metadata/js/omnipay_PaypalRest.js

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,6 @@
33
var form = $('#billing-payment-block').closest('form');
44
var qfKey = $('[name=qfKey]', form).val();
55

6-
/**
7-
* Get the total amount on the form
8-
* @returns {number}
9-
*/
10-
function getTotalAmount() {
11-
var totalFee = 0.0;
12-
if (typeof CRM.payment.getTotalAmount !== 'undefined') {
13-
return CRM.payment.getTotalAmount();
14-
}
15-
16-
if (typeof calculateTotalFee == 'function') {
17-
// This is ONLY triggered in the following circumstances on a CiviCRM contribution page:
18-
// - With a priceset that allows a 0 amount to be selected.
19-
// - When we are the ONLY payment processor configured on the page.
20-
totalFee = parseFloat(calculateTotalFee());
21-
}
22-
else if (document.getElementById('total_amount')) {
23-
// The input#total_amount field exists on backend contribution forms
24-
totalFee = parseFloat(document.getElementById('total_amount').value);
25-
}
26-
return totalFee;
27-
}
28-
296
function renderPaypal() {
307
paypal.Buttons({
318

@@ -53,7 +30,7 @@
5330

5431
var frequencyInterval = $('#frequency_interval').val() || 1;
5532
var frequencyUnit = $('#frequency_unit').val() ? $('#frequency_interval').val() : CRM.vars.omnipay.frequency_unit;
56-
var paymentAmount = getTotalAmount();
33+
var paymentAmount = calculateTotalFee();
5734
var isRecur = $('#is_recur').is(":checked");
5835
var recurText = isRecur ? ' recurring' : '';
5936

0 commit comments

Comments
 (0)