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
abd7f702
Commit
abd7f702
authored
4 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Code cleanup
parent
a0277735
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!124
6.5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Core/Payment/Stripe.php
+1
-1
1 addition, 1 deletion
CRM/Core/Payment/Stripe.php
CRM/Core/Payment/StripeIPN.php
+11
-20
11 additions, 20 deletions
CRM/Core/Payment/StripeIPN.php
templates/CRM/Core/Payment/Stripe/Card.tpl
+0
-1
0 additions, 1 deletion
templates/CRM/Core/Payment/Stripe/Card.tpl
with
12 additions
and
22 deletions
CRM/Core/Payment/Stripe.php
+
1
−
1
View file @
abd7f702
...
@@ -897,7 +897,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
...
@@ -897,7 +897,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
private
function
getDescription
(
$params
,
$type
=
'description'
)
{
private
function
getDescription
(
$params
,
$type
=
'description'
)
{
$description
=
NULL
;
$description
=
NULL
;
# See https://stripe.com/docs/statement-descriptors
# See https://stripe.com/docs/statement-descriptors
$disallowed_characters
=
array
(
'<'
,
'>'
,
'\\'
,
"'"
,
'"'
,
'*'
)
;
$disallowed_characters
=
[
'<'
,
'>'
,
'\\'
,
"'"
,
'"'
,
'*'
]
;
if
(
!
isset
(
\Civi
::
$statics
[
__CLASS__
][
'description'
][
'contact_contribution'
]))
{
if
(
!
isset
(
\Civi
::
$statics
[
__CLASS__
][
'description'
][
'contact_contribution'
]))
{
\Civi
::
$statics
[
__CLASS__
][
'description'
][
'contact_contribution'
]
=
$params
[
'contactID'
]
.
'-'
.
(
$params
[
'contributionID'
]
??
'XX'
);
\Civi
::
$statics
[
__CLASS__
][
'description'
][
'contact_contribution'
]
=
$params
[
'contactID'
]
.
'-'
.
(
$params
[
'contributionID'
]
??
'XX'
);
...
...
This diff is collapsed.
Click to expand it.
CRM/Core/Payment/StripeIPN.php
+
11
−
20
View file @
abd7f702
...
@@ -21,13 +21,6 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
...
@@ -21,13 +21,6 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
*/
*/
protected
$_paymentProcessor
;
protected
$_paymentProcessor
;
/**
* Transaction ID is the contribution in the redirect flow and a random number in the on-site->POST flow
* Ideally the contribution id would always be created at this point in either flow for greater consistency
* @var
*/
protected
$transaction_id
;
// By default, always retrieve the event from stripe to ensure we are
// By default, always retrieve the event from stripe to ensure we are
// not being fed garbage. However, allow an override so when we are
// not being fed garbage. However, allow an override so when we are
// testing, we can properly test a failed recurring contribution.
// testing, we can properly test a failed recurring contribution.
...
@@ -58,8 +51,6 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
...
@@ -58,8 +51,6 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
protected
$plan_name
=
NULL
;
protected
$plan_name
=
NULL
;
protected
$plan_start
=
NULL
;
protected
$plan_start
=
NULL
;
// Derived properties.
/**
/**
* @var int The recurring contribution ID (linked to Stripe Subscription) (if available)
* @var int The recurring contribution ID (linked to Stripe Subscription) (if available)
*/
*/
...
@@ -369,7 +360,6 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
...
@@ -369,7 +360,6 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
* @throws \CRM_Core_Exception
* @throws \CRM_Core_Exception
*/
*/
public
function
setInfo
()
{
public
function
setInfo
()
{
$abort
=
FALSE
;
$stripeObjectName
=
get_class
(
$this
->
_inputParameters
->
data
->
object
);
$stripeObjectName
=
get_class
(
$this
->
_inputParameters
->
data
->
object
);
$this
->
customer_id
=
CRM_Stripe_Api
::
getObjectParam
(
'customer_id'
,
$this
->
_inputParameters
->
data
->
object
);
$this
->
customer_id
=
CRM_Stripe_Api
::
getObjectParam
(
'customer_id'
,
$this
->
_inputParameters
->
data
->
object
);
if
(
empty
(
$this
->
customer_id
))
{
if
(
empty
(
$this
->
customer_id
))
{
...
@@ -377,16 +367,17 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
...
@@ -377,16 +367,17 @@ class CRM_Core_Payment_StripeIPN extends CRM_Core_Payment_BaseIPN {
}
}
$this
->
previous_plan_id
=
CRM_Stripe_Api
::
getParam
(
'previous_plan_id'
,
$this
->
_inputParameters
);
$this
->
previous_plan_id
=
CRM_Stripe_Api
::
getParam
(
'previous_plan_id'
,
$this
->
_inputParameters
);
$this
->
subscription_id
=
$this
->
retrieve
(
'subscription_id'
,
'String'
,
$abort
);
$this
->
subscription_id
=
$this
->
retrieve
(
'subscription_id'
,
'String'
,
FALSE
);
$this
->
invoice_id
=
$this
->
retrieve
(
'invoice_id'
,
'String'
,
$abort
);
$this
->
invoice_id
=
$this
->
retrieve
(
'invoice_id'
,
'String'
,
FALSE
);
$this
->
receive_date
=
$this
->
retrieve
(
'receive_date'
,
'String'
,
$abort
);
$this
->
receive_date
=
$this
->
retrieve
(
'receive_date'
,
'String'
,
FALSE
);
$this
->
charge_id
=
$this
->
retrieve
(
'charge_id'
,
'String'
,
$abort
);
$this
->
charge_id
=
$this
->
retrieve
(
'charge_id'
,
'String'
,
FALSE
);
$this
->
plan_id
=
$this
->
retrieve
(
'plan_id'
,
'String'
,
$abort
);
$this
->
plan_id
=
$this
->
retrieve
(
'plan_id'
,
'String'
,
FALSE
);
$this
->
plan_amount
=
$this
->
retrieve
(
'plan_amount'
,
'String'
,
$abort
);
$this
->
plan_amount
=
$this
->
retrieve
(
'plan_amount'
,
'String'
,
FALSE
);
$this
->
frequency_interval
=
$this
->
retrieve
(
'frequency_interval'
,
'String'
,
$abort
);
$this
->
frequency_interval
=
$this
->
retrieve
(
'frequency_interval'
,
'String'
,
FALSE
);
$this
->
frequency_unit
=
$this
->
retrieve
(
'frequency_unit'
,
'String'
,
$abort
);
$this
->
frequency_unit
=
$this
->
retrieve
(
'frequency_unit'
,
'String'
,
FALSE
);
$this
->
plan_name
=
$this
->
retrieve
(
'plan_name'
,
'String'
,
$abort
);
$this
->
plan_name
=
$this
->
retrieve
(
'plan_name'
,
'String'
,
FALSE
);
$this
->
plan_start
=
$this
->
retrieve
(
'plan_start'
,
'String'
,
$abort
);
$this
->
plan_start
=
$this
->
retrieve
(
'plan_start'
,
'String'
,
FALSE
);
$this
->
amount
=
$this
->
retrieve
(
'amount'
,
'String'
,
FALSE
);
if
((
$stripeObjectName
!==
'Stripe\Charge'
)
&&
(
$this
->
charge_id
!==
NULL
))
{
if
((
$stripeObjectName
!==
'Stripe\Charge'
)
&&
(
$this
->
charge_id
!==
NULL
))
{
$charge
=
\Stripe\Charge
::
retrieve
(
$this
->
charge_id
);
$charge
=
\Stripe\Charge
::
retrieve
(
$this
->
charge_id
);
...
...
This diff is collapsed.
Click to expand it.
templates/CRM/Core/Payment/Stripe/Card.tpl
+
0
−
1
View file @
abd7f702
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
| and copyright information, see https://civicrm.org/licensing |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
*}
*}
{* Manually create the CRM.vars.stripe here for drupal webform because \Civi::resources()->addVars() does not work in this context *}
{* Manually create the CRM.vars.stripe here for drupal webform because \Civi::resources()->addVars() does not work in this context *}
{
literal
}
{
literal
}
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
...
...
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