Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
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
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
Rich
Stripe
Commits
e6319a2f
Commit
e6319a2f
authored
5 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Handle previous/submit buttons on drupal webform
parent
22a12d65
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/index.md
+5
-3
5 additions, 3 deletions
docs/index.md
js/civicrm_stripe.js
+18
-6
18 additions, 6 deletions
js/civicrm_stripe.js
with
23 additions
and
9 deletions
docs/index.md
+
5
−
3
View file @
e6319a2f
...
...
@@ -8,13 +8,15 @@ Latest releases can be found here: https://civicrm.org/extensions/stripe-payment
View this extension in the
[
Extension Directory
](
https://civicrm.org/extensions/stripe-payment-processor
)
.
## Compatibility / Requirements
*
CiviCRM 5.1
0
+
*
PHP 7.
0
+
*
CiviCRM 5.1
3
+
*
PHP 7.
1
+
*
Jquery 1.10 (Use jquery_update module on Drupal).
*
Drupal 7 / Joomla / Wordpress (latest supported release).
*Not currently tested with other CMS but it may work.*
*
Stripe API version: 2019-0
2
-1
9
*
Stripe API version: 2019-0
8
-1
4
*
Drupal webform_civicrm 7.x-4.22+ (if using webform integration)
If using test mode with drupal webform_civicrm you need this patch: https://github.com/colemanw/webform_civicrm/pull/266
## Credits
Current Maintainer: Matthew Wire - https://www.mjwconsult.co.uk
...
...
This diff is collapsed.
Click to expand it.
js/civicrm_stripe.js
+
18
−
6
View file @
e6319a2f
...
...
@@ -249,17 +249,14 @@ CRM.$(function($) {
// For CiviCRM Webforms.
if
(
getIsDrupalWebform
())
{
// We need the action field for back/submit to work and redirect properly after submission
if
(
!
(
$
(
'
#action
'
).
length
))
{
form
.
append
(
$
(
'
<input type="hidden" name="op" id="action" />
'
));
}
var
$actions
=
form
.
querySelector
(
'
[type=submit]
'
);
$
(
'
[type=submit]
'
).
click
(
function
()
{
$
(
'
#action
'
).
val
(
this
.
value
);
addDrupalWebformActionElement
(
this
.
value
);
});
// If enter pressed, use our submit function
form
.
addEventListener
(
'
keydown
'
,
function
(
e
)
{
if
(
e
.
keyCode
===
13
)
{
$
(
'
#action
'
).
val
(
this
.
value
);
addDrupalWebformActionElement
(
this
.
value
);
submit
(
event
);
}
});
...
...
@@ -453,4 +450,19 @@ CRM.$(function($) {
}
}
function
addDrupalWebformActionElement
(
submitAction
)
{
var
hiddenInput
=
null
;
if
(
document
.
getElementById
(
'
action
'
)
!==
null
)
{
hiddenInput
=
document
.
getElementById
(
'
action
'
);
}
else
{
hiddenInput
=
document
.
createElement
(
'
input
'
);
}
hiddenInput
.
setAttribute
(
'
type
'
,
'
hidden
'
);
hiddenInput
.
setAttribute
(
'
name
'
,
'
op
'
);
hiddenInput
.
setAttribute
(
'
id
'
,
'
action
'
);
hiddenInput
.
setAttribute
(
'
value
'
,
submitAction
);
form
.
appendChild
(
hiddenInput
);
}
});
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