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
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
Rich
Stripe
Commits
52efe677
Commit
52efe677
authored
7 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup, load js.stripe.com for events
parent
3768ccfe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/civicrm_stripe.js
+4
-1
4 additions, 1 deletion
js/civicrm_stripe.js
stripe.php
+5
-21
5 additions, 21 deletions
stripe.php
with
9 additions
and
22 deletions
js/civicrm_stripe.js
+
4
−
1
View file @
52efe677
...
...
@@ -50,7 +50,10 @@
// Re-prep form when we've loaded a new payproc
$
(
document
).
ajaxComplete
(
function
(
event
,
xhr
,
settings
)
{
if
(
settings
.
url
.
match
(
"
/civicrm/payment/form?
"
))
{
// /civicrm/payment/form? occurs when a payproc is selected on page
// /civicrm/contact/view/participant occurs when payproc is first loaded on event credit card payment
if
((
settings
.
url
.
match
(
"
/civicrm/payment/form?
"
))
||
(
settings
.
url
.
match
(
"
/civicrm/contact/view/participant?
"
)))
{
loadStripeBillingBlock
();
}
});
...
...
This diff is collapsed.
Click to expand it.
stripe.php
+
5
−
21
View file @
52efe677
...
...
@@ -60,7 +60,7 @@ function stripe_civicrm_install() {
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
"
);
return
_stripe_civix_civicrm_install
();
_stripe_civix_civicrm_install
();
}
/**
...
...
@@ -73,7 +73,7 @@ function stripe_civicrm_uninstall() {
CRM_Core_DAO
::
executeQuery
(
"DROP TABLE civicrm_stripe_plans"
);
CRM_Core_DAO
::
executeQuery
(
"DROP TABLE civicrm_stripe_subscriptions"
);
return
_stripe_civix_civicrm_uninstall
();
_stripe_civix_civicrm_uninstall
();
}
/**
...
...
@@ -96,7 +96,7 @@ function stripe_civicrm_enable() {
<br />Webhook path to enter in Stripe:<br/><em>
$webookhook_path
</em>
<br />"
);
return
_stripe_civix_civicrm_enable
();
_stripe_civix_civicrm_enable
();
}
/**
...
...
@@ -149,7 +149,7 @@ function stripe_civicrm_managed(&$entities) {
),
);
return
_stripe_civix_civicrm_managed
(
$entities
);
_stripe_civix_civicrm_managed
(
$entities
);
}
/**
...
...
@@ -188,20 +188,6 @@ function stripe_civicrm_managed(&$entities) {
}
}
/**
* Implementation of hook_civicrm_alterContent
*
* Adding civicrm_stripe.js in a way that works for webforms and Civi forms.
*
* @return void
*/
function
stripe_civicrm_alterContent
(
&
$content
,
$context
,
$tplName
,
&
$object
)
{
if
(
$context
==
'form'
&&
!
empty
(
$object
->
_paymentProcessor
[
'class_name'
]))
{
$stripeJSURL
=
CRM_Core_Resources
::
singleton
()
->
getUrl
(
'com.drastikbydesign.stripe'
,
'js/civicrm_stripe.js'
);
$content
.
=
"<script src='
{
$stripeJSURL
}
'></script>"
;
}
}
/**
* Add stripe.js to forms, to generate stripe token
* @param $formName
...
...
@@ -209,10 +195,8 @@ function stripe_civicrm_managed(&$entities) {
*/
function
stripe_civicrm_buildForm
(
$formName
,
&
$form
)
{
if
(
!
empty
(
$form
->
_paymentProcessor
[
'class_name'
]))
{
//CRM_Core_Resources::singleton()->addScriptUrl('https://js.stripe.com/v2/', 10, 'page-body');
}
if
(
/*$form->isBackOffice &&*/
!
empty
(
$form
->
_paymentProcessor
[
'class_name'
]))
{
// civicrm_stripe.js is not included on backend form renewal unless we add it here.
CRM_Core_Resources
::
singleton
()
->
addScriptUrl
(
'https://js.stripe.com/v2/'
,
10
,
'page-body'
);
CRM_Core_Resources
::
singleton
()
->
addScriptFile
(
'com.drastikbydesign.stripe'
,
'js/civicrm_stripe.js'
);
}
}
...
...
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