Skip to content
Snippets Groups Projects
Commit 98231856 authored by mattwire's avatar mattwire Committed by mattwire
Browse files

Code formatting

parent 652c1fcf
No related branches found
No related tags found
1 merge request!132Issue262
......@@ -221,9 +221,9 @@ class CRM_Core_Payment_StripeIPN {
}
}
if (civicrm_api3('Mjwpayment', 'get_payment', [
'trxn_id' => $this->charge_id,
'status_id' => 'Completed'
])['count'] > 0) {
'trxn_id' => $this->charge_id,
'status_id' => 'Completed'
])['count'] > 0) {
// Payment already recorded
return TRUE;
}
......@@ -263,16 +263,6 @@ class CRM_Core_Payment_StripeIPN {
}
return TRUE;
case 'customer.subscription.deleted':
// Subscription is cancelled
if (!$this->getSubscriptionDetails()) {
// Subscription was not found in CiviCRM
return TRUE;
}
// Cancel the recurring contribution
$this->updateRecurCancelled(['id' => $this->contribution_recur_id, 'cancel_date' => $this->retrieve('cancel_date', 'String', FALSE)]);
return TRUE;
// One-time donation and per invoice payment.
case 'charge.failed':
// If we don't have a customer_id we can't do anything with it!
......@@ -383,6 +373,16 @@ class CRM_Core_Payment_StripeIPN {
'frequency_interval' => $this->frequency_interval,
]);
return TRUE;
case 'customer.subscription.deleted':
// Subscription is cancelled
if (!$this->getSubscriptionDetails()) {
// Subscription was not found in CiviCRM
return TRUE;
}
// Cancel the recurring contribution
$this->updateRecurCancelled(['id' => $this->contribution_recur_id, 'cancel_date' => $this->retrieve('cancel_date', 'String', FALSE)]);
return TRUE;
}
// Unhandled event type.
return TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment