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
0093e39d
Commit
0093e39d
authored
8 years ago
by
Andie Hunt
Browse files
Options
Downloads
Patches
Plain Diff
don't return, exit - and fatal errors exit anyway
parent
2841c436
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Stripe/Page/Webhook.php
+5
-13
5 additions, 13 deletions
CRM/Stripe/Page/Webhook.php
with
5 additions
and
13 deletions
CRM/Stripe/Page/Webhook.php
+
5
−
13
View file @
0093e39d
...
...
@@ -59,7 +59,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
}
catch
(
Exception
$e
)
{
CRM_Core_Error
::
Fatal
(
"Failed to retrieve Stripe charge. Message: "
.
$e
->
getMessage
());
exit
();
}
// Find the recurring contribution in CiviCRM by mapping it from Stripe.
...
...
@@ -79,7 +78,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
$end_time
=
$rel_info_query
->
end_time
;
}
else
{
CRM_Core_Error
::
Fatal
(
"Error relating this customer (
$customer_id
) to the one in civicrm_stripe_subscriptions"
);
exit
();
}
}
...
...
@@ -95,7 +93,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
if
(
!
$recurring_contribution
[
'id'
])
{
CRM_Core_Error
::
Fatal
(
"ERROR: Stripe triggered a Webhook on an invoice not found in civicrm_contribution_recur: "
.
$stripe_event_data
);
exit
();
}
// Build some params.
...
...
@@ -129,7 +126,7 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
'fee_amount'
=>
$fee
));
return
;
CRM_Utils_System
::
civiExit
()
;
}
//Get the original contribution with this invoice_id
...
...
@@ -168,7 +165,7 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
SET end_date = %1, contribution_status_id = '1'
WHERE invoice_id = %2"
,
$query_params
);
return
;
CRM_Utils_System
::
civiExit
()
;
}
// Successful charge & more to come
...
...
@@ -182,7 +179,7 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
'contribution_status_id'
=>
"In Progress"
));
return
;
CRM_Utils_System
::
civiExit
()
;
}
break
;
...
...
@@ -195,7 +192,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
}
catch
(
Exception
$e
)
{
CRM_Core_Error
::
Fatal
(
"Failed to retrieve Stripe charge. Message: "
.
$e
->
getMessage
());
exit
();
}
// Find the recurring contribution in CiviCRM by mapping it from Stripe.
...
...
@@ -207,7 +203,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
WHERE customer_id = %1"
,
$query_params
);
if
(
empty
(
$invoice_id
))
{
CRM_Core_Error
::
Fatal
(
"Error relating this customer (
{
$customer_id
}
) to the one in civicrm_stripe_subscriptions"
);
exit
();
}
// Fetch Civi's info about this recurring object.
...
...
@@ -222,7 +217,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
}
else
{
CRM_Core_Error
::
Fatal
(
"ERROR: Stripe triggered a Webhook on an invoice not found in civicrm_contribution_recur: "
.
$stripe_event_data
);
exit
();
}
// Build some params.
$recieve_date
=
date
(
"Y-m-d H:i:s"
,
$charge
->
created
);
...
...
@@ -269,7 +263,7 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
SET contribution_status_id = 4
WHERE invoice_id = %1"
,
$query_params
);
return
;
CRM_Utils_System
::
civiExit
()
;
}
else
{
// This has failed more than once. Now what?
...
...
@@ -296,7 +290,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
$invoice_id
=
$rel_info_query
->
invoice_id
;
}
else
{
CRM_Core_Error
::
Fatal
(
"Error relating this customer (
$customer_id
) to the one in civicrm_stripe_subscriptions"
);
exit
();
}
}
...
...
@@ -310,7 +303,6 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
if
(
!
$recur_contribution
[
'id'
])
{
CRM_Core_Error
::
Fatal
(
"ERROR: Stripe triggered a Webhook on an invoice not found in civicrm_contribution_recur: "
.
$stripe_event_data
);
exit
();
}
//Cancel the recurring contribution
...
...
@@ -331,7 +323,7 @@ class CRM_Stripe_Page_Webhook extends CRM_Core_Page {
// One-time donation and per invoice payment.
case
'charge.succeeded'
:
// Not implemented.
return
;
CRM_Utils_System
::
civiExit
()
;
break
;
}
...
...
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