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
1dd0d23c
Commit
1dd0d23c
authored
5 years ago
by
mattwire
Committed by
mattwire
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add workaround for #147 and set required billing fields via jquery
parent
224f9b75
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!82
6.3.1
,
!81
153 invalidint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/civicrm_stripe.js
+12
-0
12 additions, 0 deletions
js/civicrm_stripe.js
with
12 additions
and
0 deletions
js/civicrm_stripe.js
+
12
−
0
View file @
1dd0d23c
...
...
@@ -240,6 +240,8 @@ CRM.$(function($) {
card
.
mount
(
'
#card-element
'
);
debugging
(
"
created new card element
"
,
card
);
setBillingFieldsRequiredForJQueryValidate
();
// Hide the CiviCRM postcode field so it will still be submitted but will contain the value set in the stripe card-element.
if
(
document
.
getElementById
(
'
billing_postal_code-5
'
).
value
)
{
document
.
getElementById
(
'
billing_postal_code-5
'
).
setAttribute
(
'
disabled
'
,
true
);
...
...
@@ -331,6 +333,8 @@ CRM.$(function($) {
if
(
$
(
form
).
valid
()
===
false
)
{
debugging
(
'
Form not valid
'
);
document
.
querySelector
(
'
#billing-payment-block
'
).
scrollIntoView
();
window
.
scrollBy
(
0
,
-
50
);
return
false
;
}
...
...
@@ -580,6 +584,14 @@ CRM.$(function($) {
}
}
function
setBillingFieldsRequiredForJQueryValidate
()
{
// Work around https://github.com/civicrm/civicrm-core/compare/master...mattwire:stripe_147
// The main billing fields do not get set to required so don't get checked by jquery validateform.
$
(
'
.billing_name_address-section div.label span.crm-marker
'
).
each
(
function
()
{
$
(
this
).
closest
(
'
div
'
).
next
(
'
div
'
).
children
(
'
input
'
).
addClass
(
'
required
'
);
});
}
function
isEventAdditionalParticipants
()
{
if
((
document
.
getElementById
(
'
additional_participants
'
)
!==
null
)
&&
(
document
.
getElementById
(
'
additional_participants
'
).
value
.
length
!==
0
))
{
...
...
This diff is collapsed.
Click to expand it.
mattwire
@mattwire
mentioned in issue
#147 (closed)
·
5 years ago
mentioned in issue
#147 (closed)
mentioned in issue #147
Toggle commit list
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