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
35eadf83
Commit
35eadf83
authored
4 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Fixes to confirmation js
parent
4d392838
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!114
6.4.1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Core/Payment/Stripe.php
+2
-0
2 additions, 0 deletions
CRM/Core/Payment/Stripe.php
CRM/Stripe/AJAX.php
+8
-4
8 additions, 4 deletions
CRM/Stripe/AJAX.php
stripe.php
+4
-0
4 additions, 0 deletions
stripe.php
with
14 additions
and
4 deletions
CRM/Core/Payment/Stripe.php
+
2
−
0
View file @
35eadf83
...
...
@@ -378,7 +378,9 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
'locale'
=>
CRM_Core_I18n
::
getLocale
(),
'apiVersion'
=>
CRM_Stripe_Check
::
API_VERSION
,
'csrfToken'
=>
class_exists
(
'\Civi\Firewall\Firewall'
)
?
\Civi\Firewall\Firewall
::
getCSRFToken
()
:
NULL
,
'country'
=>
CRM_Core_BAO_Country
::
defaultContactCountry
(),
];
\Civi
::
resources
()
->
addVars
(
E
::
SHORT_NAME
,
$jsVars
);
// Assign to smarty so we can add via Card.tpl for drupal webform because addVars doesn't work in that context
$form
->
assign
(
'stripeJSVars'
,
$jsVars
);
...
...
This diff is collapsed.
Click to expand it.
CRM/Stripe/AJAX.php
+
8
−
4
View file @
35eadf83
...
...
@@ -47,17 +47,21 @@ class CRM_Stripe_AJAX {
(
CRM_Utils_Request
::
retrieveValue
(
'reset'
,
'String'
)
===
NULL
)
?:
self
::
returnInvalid
();
if
(
class_exists
(
'\Civi\Firewall\Firewall'
))
{
if
(
!
\Civi\Firewall\Firewall
::
isCSRFTokenValid
(
CRM_Utils_Request
::
retrieveValue
(
'csrfToken'
,
'String'
)))
{
if
(
!
\Civi\Firewall\Firewall
::
isCSRFTokenValid
(
CRM_Utils_Request
::
retrieveValue
(
'csrfToken'
,
'String'
)
??
''
))
{
self
::
returnInvalid
();
}
}
$paymentMethodID
=
CRM_Utils_Request
::
retrieveValue
(
'payment_method_id'
,
'String'
);
$paymentIntentID
=
CRM_Utils_Request
::
retrieveValue
(
'payment_intent_id'
,
'String'
);
$capture
=
CRM_Utils_Request
::
retrieveValue
(
'capture'
,
'Boolean'
,
FALSE
);
$amount
=
CRM_Utils_Request
::
retrieveValue
(
'amount'
,
'String'
);
if
(
empty
(
$amount
))
{
// $capture is normally true if we have already created the intent and just need to get extra
// authentication from the user (eg. on the confirmation page). So we don't need the amount
// in this case.
if
(
empty
(
$amount
)
&&
!
$capture
)
{
self
::
returnInvalid
();
}
$capture
=
CRM_Utils_Request
::
retrieveValue
(
'capture'
,
'Boolean'
,
FALSE
);
$title
=
CRM_Utils_Request
::
retrieveValue
(
'description'
,
'String'
);
$confirm
=
TRUE
;
$currency
=
CRM_Utils_Request
::
retrieveValue
(
'currency'
,
'String'
,
CRM_Core_Config
::
singleton
()
->
defaultCurrency
);
...
...
@@ -150,7 +154,7 @@ class CRM_Stripe_AJAX {
}
else
{
// Invalid status
CRM_Utils_JSON
::
output
([
'error'
=>
[
'message'
=>
'Invalid PaymentIntent status
'
]]);
CRM_Utils_JSON
::
output
([
'error'
=>
[
'message'
=>
'Invalid PaymentIntent status
: '
.
$intent
->
status
]]);
}
}
...
...
This diff is collapsed.
Click to expand it.
stripe.php
+
4
−
0
View file @
35eadf83
...
...
@@ -207,7 +207,11 @@ function stripe_civicrm_buildForm($formName, &$form) {
'paymentIntentStatus'
=>
$intent
->
status
,
'paymentIntentMethod'
=>
$intent
->
confirmation_method
,
'publishableKey'
=>
CRM_Core_Payment_Stripe
::
getPublicKeyById
(
$form
->
_paymentProcessor
[
'id'
]),
'locale'
=>
CRM_Core_I18n
::
getLocale
(),
'apiVersion'
=>
CRM_Stripe_Check
::
API_VERSION
,
'jsDebug'
=>
(
boolean
)
\Civi
::
settings
()
->
get
(
'stripe_jsdebug'
),
'csrfToken'
=>
class_exists
(
'\Civi\Firewall\Firewall'
)
?
\Civi\Firewall\Firewall
::
getCSRFToken
()
:
NULL
,
'country'
=>
CRM_Core_BAO_Country
::
defaultContactCountry
(),
];
\Civi
::
resources
()
->
addVars
(
E
::
SHORT_NAME
,
$jsVars
);
}
...
...
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