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
2016de7b
Commit
2016de7b
authored
7 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Backend membership renewal fails with stripe token not passed because stripe.js is not included
parent
47e537dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/civicrm_stripe.js
+10
-7
10 additions, 7 deletions
js/civicrm_stripe.js
stripe.php
+12
-0
12 additions, 0 deletions
stripe.php
with
22 additions
and
7 deletions
js/civicrm_stripe.js
+
10
−
7
View file @
2016de7b
...
@@ -44,15 +44,18 @@
...
@@ -44,15 +44,18 @@
Stripe
.
setPublishableKey
(
$
(
'
#stripe-pub-key
'
).
val
());
Stripe
.
setPublishableKey
(
$
(
'
#stripe-pub-key
'
).
val
());
});
});
if
(
$
(
'
.webform-client-form
'
).
length
)
{
// Check for form marked as a stripe-payment-form by the server.
isWebform
=
true
;
if
(
!
(
$
(
'
form.stripe-payment-form
'
).
length
))
{
$
(
'
form.webform-client-form
'
).
addClass
(
'
stripe-payment-form
'
);
// If there isn't one look for it.
}
if
(
$
(
'
.webform-client-form
'
).
length
)
{
else
{
isWebform
=
true
;
if
(
!
(
$
(
'
.stripe-payment-form
'
).
length
))
{
$
(
'
form.webform-client-form
'
).
addClass
(
'
stripe-payment-form
'
);
$
(
'
#crm-main-content-wrapper form
'
).
addClass
(
'
stripe-payment-form
'
);
}
else
{
$
(
'
#crm-container > form
'
).
addClass
(
'
stripe-payment-form
'
);
}
}
}
}
$form
=
$
(
'
form.stripe-payment-form
'
);
$form
=
$
(
'
form.stripe-payment-form
'
);
if
(
isWebform
)
{
if
(
isWebform
)
{
$submit
=
$form
.
find
(
'
.button-primary
'
);
$submit
=
$form
.
find
(
'
.button-primary
'
);
...
...
This diff is collapsed.
Click to expand it.
stripe.php
+
12
−
0
View file @
2016de7b
...
@@ -204,6 +204,18 @@ function stripe_civicrm_managed(&$entities) {
...
@@ -204,6 +204,18 @@ function stripe_civicrm_managed(&$entities) {
}
}
}
}
/**
* Add stripe.js to forms, to generate stripe token
* @param $formName
* @param $form
*/
function
stripe_civicrm_buildForm
(
$formName
,
&
$form
)
{
if
((
$formName
==
'CRM_Member_Form_MembershipRenewal'
)
&&
!
empty
(
$form
->
_paymentProcessor
[
'class_name'
]))
{
// civicrm_stripe.js is not included on backend form renewal unless we add it here.
CRM_Core_Resources
::
singleton
()
->
addScriptFile
(
'com.drastikbydesign.stripe'
,
'js/civicrm_stripe.js'
);
}
}
/*
/*
* Implementation of hook_idsException.
* Implementation of hook_idsException.
*
*
...
...
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