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
2a29046a
Commit
2a29046a
authored
4 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
More library update fixes
parent
aed2cef1
Branches
Branches containing commit
Tags
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
+4
-1
4 additions, 1 deletion
CRM/Core/Payment/Stripe.php
CRM/Core/Payment/StripeIPN.php
+1
-3
1 addition, 3 deletions
CRM/Core/Payment/StripeIPN.php
api/v3/Stripe/Ipn.php
+5
-13
5 additions, 13 deletions
api/v3/Stripe/Ipn.php
with
10 additions
and
17 deletions
CRM/Core/Payment/Stripe.php
+
4
−
1
View file @
2a29046a
...
...
@@ -1125,10 +1125,13 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
* @throws \CiviCRM_API3_Exception
* @throws \Stripe\Exception\UnknownApiErrorException
*/
public
static
function
processPaymentNotification
(
$paymentProcessorID
,
$rawData
,
$verifyRequest
=
TRUE
)
{
public
static
function
processPaymentNotification
(
$paymentProcessorID
,
$rawData
,
$verifyRequest
=
TRUE
,
$emailReceipt
=
NULL
)
{
$_GET
[
'processor_id'
]
=
$paymentProcessorID
;
$ipnClass
=
new
CRM_Core_Payment_StripeIPN
(
$rawData
,
$verifyRequest
);
$ipnClass
->
setExceptionMode
(
FALSE
);
if
(
isset
(
$emailReceipt
))
{
$ipnClass
->
setSendEmailReceipt
(
$emailReceipt
);
}
return
$ipnClass
->
main
();
}
...
...
This diff is collapsed.
Click to expand it.
CRM/Core/Payment/StripeIPN.php
+
1
−
3
View file @
2a29046a
...
...
@@ -404,8 +404,6 @@ class CRM_Core_Payment_StripeIPN {
* @throws \CRM_Core_Exception
*/
public
function
setInfo
()
{
$stripeObjectName
=
get_class
(
$this
->
_inputParameters
->
data
->
object
);
if
(
!
$this
->
getCustomer
())
{
if
((
bool
)
\Civi
::
settings
()
->
get
(
'stripe_ipndebug'
))
{
$message
=
$this
->
_paymentProcessor
->
getPaymentProcessorLabel
()
.
': '
.
CRM_Stripe_Api
::
getParam
(
'id'
,
$this
->
_inputParameters
)
.
': Missing customer_id'
;
...
...
@@ -427,7 +425,7 @@ class CRM_Core_Payment_StripeIPN {
$this
->
plan_start
=
$this
->
retrieve
(
'plan_start'
,
'String'
,
FALSE
);
$this
->
amount
=
$this
->
retrieve
(
'amount'
,
'String'
,
FALSE
);
if
((
$
stripeObjectName
!==
'Stripe\C
harge'
)
&&
(
$this
->
charge_id
!==
NULL
))
{
if
((
$
this
->
_inputParameters
->
data
->
object
->
object
!==
'c
harge'
)
&&
(
$this
->
charge_id
!==
NULL
))
{
$charge
=
\Stripe\Charge
::
retrieve
(
$this
->
charge_id
);
$balanceTransactionID
=
CRM_Stripe_Api
::
getObjectParam
(
'balance_transaction'
,
$charge
);
}
...
...
This diff is collapsed.
Click to expand it.
api/v3/Stripe/Ipn.php
+
5
−
13
View file @
2a29046a
...
...
@@ -47,7 +47,7 @@ function civicrm_api3_stripe_Ipn($params) {
$object
=
NULL
;
$ppid
=
NULL
;
if
(
array_key_exists
(
'id'
,
$params
))
{
$data
=
civicrm_api3
(
'SystemLog'
,
'getsingle'
,
array
(
'id'
=>
$params
[
'id'
],
'return'
=>
array
(
'message'
,
'context'
))
);
$data
=
civicrm_api3
(
'SystemLog'
,
'getsingle'
,
[
'id'
=>
$params
[
'id'
],
'return'
=>
[
'message'
,
'context'
]]
);
if
(
empty
(
$data
))
{
throw
new
API_Exception
(
'Failed to find that entry in the system log'
,
3234
);
}
...
...
@@ -64,8 +64,8 @@ function civicrm_api3_stripe_Ipn($params) {
throw
new
API_Exception
(
'Please pass the payment processor id (ppid) if using evtid.'
,
3236
);
}
$ppid
=
$params
[
'ppid'
];
$processor
=
new
CRM_Core_Payment_Stripe
(
''
,
civicrm_api3
(
'PaymentProcessor'
,
'getsingle'
,
[
'id'
=>
$ppid
]));
$processor
->
setAPIParams
();
$p
aymentP
rocessor
=
new
CRM_Core_Payment_Stripe
(
''
,
civicrm_api3
(
'PaymentProcessor'
,
'getsingle'
,
[
'id'
=>
$ppid
]));
$p
aymentP
rocessor
->
setAPIParams
();
$object
=
\Stripe\Event
::
retrieve
(
$params
[
'evtid'
]);
}
...
...
@@ -97,16 +97,8 @@ function civicrm_api3_stripe_Ipn($params) {
}
if
(
class_exists
(
'CRM_Core_Payment_StripeIPN'
))
{
// The $_GET['processor_id'] value is normally set by
// CRM_Core_Payment::handlePaymentMethod
$_GET
[
'processor_id'
]
=
$ppid
;
$ipnClass
=
new
CRM_Core_Payment_StripeIPN
(
$object
);
$ipnClass
->
setExceptionMode
(
FALSE
);
if
(
$params
[
'noreceipt'
]
==
1
)
{
$ipnClass
->
setSendEmailReceipt
(
0
);
}
try
{
$
ipnClass
->
main
(
);
$
paymentProcessor
->
processPaymentNotification
(
$ppid
,
$object
,
TRUE
,
(
$params
[
'noreceipt'
]
==
1
)
?
0
:
NULL
);
}
catch
(
Throwable
$e
)
{
return
civicrm_api3_create_error
(
$e
->
getMessage
());
}
...
...
@@ -114,5 +106,5 @@ function civicrm_api3_stripe_Ipn($params) {
else
{
trigger_error
(
"The api depends on CRM_Core_Payment_StripeIPN"
);
}
return
civicrm_api3_create_success
(
array
()
);
return
civicrm_api3_create_success
(
[]
);
}
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