Commit 79f0af85 authored by mattwire's avatar mattwire

Check which processor should be handling IPN notifications when both...

Check which processor should be handling IPN notifications when both creditcard and echeck configured in CiviCRM
parent 5aaf4175
......@@ -82,6 +82,20 @@ class CRM_Core_Payment_AuthNetIPN {
$this->exception('Bad response from getTransactionDetailsRequest in IPN handler. ' . $response->getErrorText());
}
// CiviCRM implements separate payment processors for creditCard / eCheck but for AuthorizeNet there is only one.
// So both CiviCRM payment processors receive the IPN notifications for each type.
if (property_exists($response->transaction->payment, 'creditCard') && !($this->_paymentProcessor instanceof CRM_Core_Payment_AuthNetCreditcard)) {
// \Civi::log()->debug('credit card payment but not creditcard processor');
return TRUE;
}
elseif (property_exists($response->transaction->payment, 'bankAccount') && !($this->_paymentProcessor instanceof CRM_Core_Payment_AuthNetEcheck)) {
// \Civi::log()->debug('bank account payment but not echeck processor');
return TRUE;
}
else {
$this->exception('Unsupported payment type (not creditCard or bankAccount');
}
// Set parameters required for IPN functions
if ($this->getParamFromResponse($response, 'is_recur')) {
$this->contribution_recur_id = $this->getRecurringContributionIDFromSubscriptionID($this->getParamFromResponse($response, 'subscription_id'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment