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
129c617e
Commit
129c617e
authored
8 years ago
by
Peter Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
add debug helper function
parent
1b664d15
Branches
Branches containing commit
Tags
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
+18
-0
18 additions, 0 deletions
js/civicrm_stripe.js
with
18 additions
and
0 deletions
js/civicrm_stripe.js
+
18
−
0
View file @
129c617e
...
...
@@ -117,24 +117,29 @@
$form
.
submit
(
function
(
event
)
{
// Don't handle submits generated by the CiviDiscount button.
if
(
$form
.
data
(
'
cividiscount-dont-handle
'
)
==
1
)
{
debugging
(
'
pvjwy
'
);
return
true
;
}
if
(
isWebform
)
{
var
$processorFields
=
$
(
'
.civicrm-enabled[name$="civicrm_1_contribution_1_contribution_payment_processor_id]"]
'
);
if
(
$
(
'
#action
'
).
attr
(
'
value
'
)
==
webformPrevious
)
{
debugging
(
'
wmlfp
'
);
return
true
;
}
if
(
$
(
'
#wf-crm-billing-total
'
).
length
)
{
if
(
$
(
'
#wf-crm-billing-total
'
).
data
(
'
data-amount
'
)
==
'
0
'
)
{
debugging
(
'
qplfr
'
);
return
true
;
}
}
if
(
$processorFields
.
length
)
{
if
(
$processorFields
.
filter
(
'
:checked
'
).
val
()
==
'
0
'
)
{
debugging
(
'
evxyh
'
);
return
true
;
}
if
(
!
(
$form
.
find
(
'
input[name="stripe_token"]
'
).
length
))
{
debugging
(
'
irjfg
'
);
return
true
;
}
}
...
...
@@ -150,6 +155,7 @@
if
(
typeof
currentTotal
!==
'
undefined
'
)
{
if
(
currentTotal
==
0
&&
!
additionalParticipants
)
{
// This is also hit when "Going back", but we already have stripe_token.
debugging
(
'
ozlkf
'
);
return
true
;
}
}
...
...
@@ -161,11 +167,13 @@
if
((
$form
.
find
(
'
input[name="payment_processor"]:checked
'
).
length
)
||
(
$form
.
find
(
'
input[name="payment_processor_id"]:checked
'
).
length
))
{
processorId
=
$form
.
find
((
'
input[name="payment_processor"]:checked
'
)
||
(
'
input[name="payment_processor_id"]:checked
'
).
val
());
if
(
!
(
$form
.
find
(
'
input[name="stripe_token"]
'
).
length
)
||
(
$
(
'
#stripe-id
'
).
length
&&
$
(
'
#stripe-id
'
).
val
()
!=
processorId
))
{
debugging
(
'
kfoej
'
);
return
true
;
}
}
else
{
// No payment processor is checked.
debugging
(
'
qlmvy
'
);
return
true
;
}
}
...
...
@@ -173,6 +181,7 @@
// Handle pay later (option value '0' in payment_processor radio group).
if
((
$form
.
find
(
'
input[name="payment_processor"]:checked
'
).
length
&&
!
parseInt
(
$form
.
find
(
'
input[name="payment_processor"]:checked
'
).
val
()))
||
(
$form
.
find
(
'
input[name="payment_processor_id"]:checked
'
).
length
&&
!
parseInt
(
$form
.
find
(
'
input[name="payment_processor_id"]:checked
'
).
val
())))
{
debugging
(
'
ynhpz
'
);
return
true
;
}
...
...
@@ -180,12 +189,14 @@
if
(
$form
.
find
(
"
input#stripe-token
"
).
val
())
{
$form
.
find
(
"
input#credit_card_number
"
).
removeAttr
(
'
name
'
);
$form
.
find
(
"
input#cvv2
"
).
removeAttr
(
'
name
'
);
debugging
(
'
zpqef
'
);
return
true
;
}
// If there's no credit card field, no use in continuing (probably wrong
// context anyway)
if
(
!
$form
.
find
(
'
#credit_card_number
'
).
length
)
{
debugging
(
'
gvzod
'
);
return
true
;
}
...
...
@@ -210,7 +221,14 @@
exp_year
:
cc_year
},
stripeResponseHandler
);
debugging
(
'
ywkvh
'
);
return
false
;
});
});
}(
cj
,
CRM
));
function
debugging
(
errorCode
)
{
// Uncomment the following to debug unexpected returns.
// console.log(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