Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stripe
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
Stripe
Commits
a22c7353
Commit
a22c7353
authored
3 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Comment some functions
parent
72c4f9d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/civicrm_stripe.js
+30
-0
30 additions, 0 deletions
js/civicrm_stripe.js
with
30 additions
and
0 deletions
js/civicrm_stripe.js
+
30
−
0
View file @
a22c7353
...
...
@@ -45,6 +45,9 @@
load
();
});
/**
* Called on every load of this script (whether billingblock loaded via AJAX or DOMContentLoaded)
*/
function
load
()
{
if
(
window
.
civicrmStripeHandleReload
)
{
// Call existing instance of this, instead of making new one.
...
...
@@ -87,6 +90,12 @@
}
};
/**
* Called when payment details have been entered and validated successfully
*
* @param type
* @param object
*/
function
successHandler
(
type
,
object
)
{
debugging
(
type
+
'
: success - submitting form
'
);
...
...
@@ -142,6 +151,11 @@
}
}
/**
* Get a list of jQuery elements for all possible Stripe elements that could be loaded
*
* @returns {{paymentrequest: (*|jQuery|HTMLElement), card: (*|jQuery|HTMLElement)}}
*/
function
getJQueryPaymentElements
()
{
return
{
card
:
$
(
'
div#card-element
'
),
...
...
@@ -191,6 +205,11 @@
return
false
;
}
/**
* Handle the "Card" submission to Stripe
*
* @param submitEvent
*/
function
handleSubmitCard
(
submitEvent
)
{
debugging
(
'
handle submit card
'
);
stripe
.
createPaymentMethod
(
'
card
'
,
elements
.
card
).
then
(
function
(
createPaymentMethodResult
)
{
...
...
@@ -282,6 +301,11 @@
});
}
/**
* Handle the "PaymentRequest" submission to Stripe
*
* @param submitEvent
*/
function
handleSubmitPaymentRequestButton
(
submitEvent
)
{
debugging
(
'
handle submit paymentRequestButton
'
);
...
...
@@ -350,6 +374,9 @@
delete
(
CRM
.
vars
.
stripe
);
}
/**
* Check environment and trigger loadBillingBlock()
*/
function
checkAndLoad
()
{
if
(
typeof
CRM
.
vars
.
stripe
===
'
undefined
'
)
{
debugging
(
'
CRM.vars.stripe not defined! Not a Stripe processor?
'
);
...
...
@@ -395,6 +422,9 @@
}
}
/**
* This actually loads the billingBlock and the chosen Stripe element
*/
function
loadBillingBlock
()
{
debugging
(
'
loadBillingBlock
'
);
...
...
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