X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment%2FAuthorizeNet.php;h=ed28adc948c362b751b652d0e6efd59e02f4eeb3;hb=19a93bccf7714cb49387b48ecef29ce52e3f00df;hp=e28bdbf900a5f4487e50a316495b431a11e8719a;hpb=b103ff44e20f5b84fec59532f8010a67fe426156;p=civicrm-core.git diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index e28bdbf900..ed28adc948 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -184,13 +184,13 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { // fetch available contribution statuses $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); + $result = []; // check for application errors // TODO: // AVS, CVV2, CAVV, and other verification results switch ($response_fields[0]) { case self::AUTH_REVIEW: - $params['payment_status_id'] = array_search('Pending', $contributionStatus); - $params['payment_status'] = 'Pending'; + $result = $this->setStatusPaymentPending($result); break; case self::AUTH_ERROR: @@ -203,13 +203,12 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { default: // Success - $params['trxn_id'] = !empty($response_fields[6]) ? $response_fields[6] : $this->getTestTrxnID(); - $params['payment_status_id'] = array_search('Completed', $statuses); - $params['payment_status'] = 'Completed'; + $result['trxn_id'] = !empty($response_fields[6]) ? $response_fields[6] : $this->getTestTrxnID(); + $result = $this->setStatusPaymentCompleted($result); break; } - return $params; + return $result; } /** @@ -304,7 +303,8 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { $template->assign('billingState', $this->_getParam('state_province')); $template->assign('billingZip', $this->_getParam('postal_code', TRUE)); $template->assign('billingCountry', $this->_getParam('country')); - + // Required to be set for s + $template->ensureVariablesAreAssigned(['subscriptionType']); $arbXML = $template->fetch('CRM/Contribute/Form/Contribution/AuthorizeNetARB.tpl'); // Submit to authorize.net