Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mjwshared
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
mjwshared
Commits
9c7df627
Commit
9c7df627
authored
4 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
js cleanup
parent
910de8d3
No related branches found
No related tags found
1 merge request
!9
0.9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/crm.payment.js
+19
-20
19 additions, 20 deletions
js/crm.payment.js
with
19 additions
and
20 deletions
js/crm.payment.js
+
19
−
20
View file @
9c7df627
...
...
@@ -18,21 +18,21 @@
this
.
debugging
(
this
.
scriptName
,
'
Calculated amount using internal calculateTaxAmount()
'
);
}
else
if
(
typeof
calculateTotalFee
==
'
function
'
)
{
// This is ONLY triggered in the following circumstances on a CiviCRM contribution page:
// - With a priceset that allows a 0 amount to be selected.
// - When Stripe is the ONLY payment processor configured on the page.
totalFee
=
parseFloat
(
calculateTotalFee
());
}
else
if
(
this
.
getIsDrupalWebform
())
{
// This is how webform civicrm calculates the amount in webform_civicrm_payment.js
$
(
'
.line-item:visible
'
,
'
#wf-crm-billing-items
'
).
each
(
function
()
{
totalFee
+=
parseFloat
(
$
(
this
).
data
(
'
amount
'
));
});
}
else
if
(
document
.
getElementById
(
'
total_amount
'
))
{
// The input#total_amount field exists on backend contribution forms
totalFee
=
parseFloat
(
document
.
getElementById
(
'
total_amount
'
).
value
);
}
// This is ONLY triggered in the following circumstances on a CiviCRM contribution page:
// - With a priceset that allows a 0 amount to be selected.
// - When Stripe is the ONLY payment processor configured on the page.
totalFee
=
parseFloat
(
calculateTotalFee
());
}
else
if
(
this
.
getIsDrupalWebform
())
{
// This is how webform civicrm calculates the amount in webform_civicrm_payment.js
$
(
'
.line-item:visible
'
,
'
#wf-crm-billing-items
'
).
each
(
function
()
{
totalFee
+=
parseFloat
(
$
(
this
).
data
(
'
amount
'
));
});
}
else
if
(
document
.
getElementById
(
'
total_amount
'
))
{
// The input#total_amount field exists on backend contribution forms
totalFee
=
parseFloat
(
document
.
getElementById
(
'
total_amount
'
).
value
);
}
this
.
debugging
(
this
.
scriptName
,
'
getTotalAmount:
'
+
totalFee
);
return
totalFee
;
},
...
...
@@ -117,8 +117,8 @@
isRecur
=
Boolean
(
document
.
getElementById
(
'
is_recur
'
).
checked
);
}
}
// Auto-renew memberships
// This gets messy quickly!
// Auto-renew memberships
// This gets messy quickly!
// input[name="auto_renew"] : set to 1 when there is a force-renew membership with no priceset.
else
if
(
$
(
'
input[name="auto_renew"]
'
).
length
!==
0
)
{
if
(
$
(
'
input[name="auto_renew"]
'
).
prop
(
'
checked
'
))
{
...
...
@@ -138,8 +138,7 @@
return
isRecur
;
},
/**
/**
* Output debug information
* @param {string} scriptName
* @param {string} errorCode
...
...
@@ -149,7 +148,7 @@
if
((
typeof
(
CRM
.
vars
.
stripe
)
===
'
undefined
'
)
||
(
Boolean
(
CRM
.
vars
.
stripe
.
jsDebug
)
===
true
))
{
console
.
log
(
new
Date
().
toISOString
()
+
'
'
+
scriptName
+
'
:
'
+
errorCode
);
}
}
,
}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment