Skip to content
Snippets Groups Projects
Commit 52befd01 authored by mattwire's avatar mattwire
Browse files

Throw exception when repeatTransaction fails

parent eccf41b3
No related branches found
No related tags found
1 merge request!176Release 6.7
...@@ -375,9 +375,7 @@ class CRM_Core_Payment_StripeIPN { ...@@ -375,9 +375,7 @@ class CRM_Core_Payment_StripeIPN {
return TRUE; return TRUE;
} }
else { else {
if (!$this->createNextContributionForRecur()) { $this->createNextContributionForRecur();
return FALSE;
}
} }
return TRUE; return TRUE;
} }
...@@ -409,9 +407,7 @@ class CRM_Core_Payment_StripeIPN { ...@@ -409,9 +407,7 @@ class CRM_Core_Payment_StripeIPN {
else { else {
// We have a recurring contribution but have not yet received invoice.finalized so we don't have the next contribution yet. // We have a recurring contribution but have not yet received invoice.finalized so we don't have the next contribution yet.
// invoice.payment_succeeded sometimes comes before invoice.finalized so trigger the same behaviour here to create a new contribution // invoice.payment_succeeded sometimes comes before invoice.finalized so trigger the same behaviour here to create a new contribution
if (!$this->createNextContributionForRecur()) { $this->createNextContributionForRecur();
return FALSE;
}
// Now get the contribution we just created. // Now get the contribution we just created.
$this->getContribution(); $this->getContribution();
} }
...@@ -587,7 +583,6 @@ class CRM_Core_Payment_StripeIPN { ...@@ -587,7 +583,6 @@ class CRM_Core_Payment_StripeIPN {
* This happens when Stripe generates a new invoice and notifies us (normally by invoice.finalized but * This happens when Stripe generates a new invoice and notifies us (normally by invoice.finalized but
* invoice.payment_succeeded sometimes arrives first). * invoice.payment_succeeded sometimes arrives first).
* *
* @return bool
* @throws \CiviCRM_API3_Exception * @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException * @throws \Civi\Payment\Exception\PaymentProcessorException
*/ */
...@@ -604,7 +599,7 @@ class CRM_Core_Payment_StripeIPN { ...@@ -604,7 +599,7 @@ class CRM_Core_Payment_StripeIPN {
'total_amount' => $this->amount, 'total_amount' => $this->amount,
'fee_amount' => $this->fee, 'fee_amount' => $this->fee,
]; ];
return $this->repeatContribution($params); $this->repeatContribution($params);
// Don't touch the contributionRecur as it's updated automatically by Contribution.repeattransaction // Don't touch the contributionRecur as it's updated automatically by Contribution.repeattransaction
} }
......
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