Answers.Body: <p>The stacktrace error "Invalid value passed to getPayment function" can be caused by not choosing a payment processor on the individual contribution page. Verify that the payment processor on that page(s) is checked; it should then operate correctly.</p>
  
  <p>The message "Payment Processor Error Message: 9003: MD5 Verification Failed" is a separate issue. This is a message from the payment processor, not from CiviCRM. You should investigate it further with your payment processor.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-29T16:41:05.237Z
Answers.LastActivityDate: 2016-06-29T16:58:39.397Z
Answers.LastEditDate: 2016-06-29T16:58:39.397Z
Answers.UserDisplayName: DaveD
Answers.Body: <p>In CRM/Contribute/Form/ContributionBase.php(349) the system is not able to determine the name of your payment processor. Please check:</p>
  
  <ul>
  <li>that you at least one payment processors configured</li>
  <li>that all payment configured processors have a 'name' defined and not empty</li>
  <li>that at least one of your payment processors is set as 'default'</li>
  <li>since the chosen payment processor depends on the mode the contribution form is used, check that you have 'test' credentials defined for at least one of your configured payment processors</li>
  <li>finally, that the contribution form leading to this error has a payment processor defined in the Amounts tab</li>
  </ul>
  
  <p>If all of this is correct, I would start debugging this by looking at lines 324 to 349 of the above file and investigating why the $defaultProcessorId variable is set to "" (rather than a numeric value) when reaching line 349.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-26T15:12:49.327Z
Answers.Text: Thanks. This is really helpful! I just crashed Civi trying to upgrade it, so I can't even try this. Do you do consulting? I'd love to hire you to help straighten this out, if you're open to it. naomi at socher-lerner.com
Answers.UserDisplayName: naomisl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-26T15:57:56.713Z
Answers.Text: I've restored to backup and un-crashed! Now I've checked your suggested list, and am on to looking through the file you suggested. Wish me luck! (And I'm still interested in your consulting services, definitely. This is frustrating!)
Answers.UserDisplayName: naomisl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-26T19:50:51.130Z
Answers.Text: Added those lines in the question. Do you see anything I can change?
Answers.UserDisplayName: naomisl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-24T00:04:04.187Z
Answers.LastActivityDate: 2016-06-24T00:04:04.187Z
Answers.UserDisplayName: cividesk
Answers.Body: <p>I had a similar issue that ultimately turned out to be a problem between the .htaccess and settings.civicrm.php files. Basically, the contribution page was https:// but the response from authorize.net was being pushed back to http://.</p>
  
  <p>Not sure if this is your problem, but it's an easy thing to check. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-22T21:11:26.427Z
Answers.Text: Interesting! How do you check for that?
Answers.UserDisplayName: naomisl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-22T01:58:40.517Z
Answers.LastActivityDate: 2016-06-22T01:58:40.517Z
Answers.UserDisplayName: Cullen McGough
Answers.Body: <p>Try changing </p>
  
  <p>if (isset($defaultProcessorId)) {</p>
  
  <p>to</p>
  
  <p>if (!empty($defaultProcessorId)) {</p>
  
  <p>In those code lines above - it seems to be set but empty</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-27T22:21:10.450Z
Answers.LastActivityDate: 2016-06-27T22:21:10.450Z
Answers.UserDisplayName: Eileen
Answers.Body: <p>Just an intuitive answer. I see two errors. May be they are related or one is influencing the other. May be the first inhibits or is needed for the payment process? Don't leave loose ends!</p>
  
  <p>First error is a fatal error and would block further processing. I see it relates to email. I would try to solve that error first, then concentrate on the other. May be the first will solve the second or it will lead you to the solution of the second. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-24T17:05:36.893Z
Answers.LastActivityDate: 2016-06-24T17:05:36.893Z
Answers.UserDisplayName: ñull
Answers.Body: <p>Had this exact same error but it was specific to the test credentials - production credentials were working fine - if this is the case with you Naomi, then the issue might not be in the code at all (@twomice and @Eileen are both much more experienced than I, so if it is in the code, I will bow out to them). If production credentials ARE working, then try updating the test credentials with those of an authnet sandbox account (this is the only way testing will work). Also, just a tip, the MD5 Hash needs to be relatively short (I've used MD5 Hash generators that spit out really long strings that tend to cause issues).</p>
  
  <p>Hope this helps!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-28T20:01:12.030Z
Answers.LastActivityDate: 2016-06-28T20:01:12.030Z
Answers.UserDisplayName: Tamar Meir - Cividesk
Body: <p>All of my contribution pages, when tested, return you back to the page with this message at the top:</p>
  
  <p>Payment Processor Error Message:
  9003: MD5 Verification Failed</p>
  
  <p>I have reset the MD5 code from both sides, even going so far as to delete the entire payment processor and recreate it. Whatever the issue is, it is definitely not the MD5 code. </p>
  
  <p>Authorize.net says that they have no record of having been reached by our website at all, and that something must be going wrong with the call/connection. </p>
  
  <p>Here are the only error codes I found in the log. They both seem to be email related, but perhaps they are related to this somehow? </p>
  
  <pre><code>    $Fatal Error Details = Array ( 
  [message] =&gt; Could not connect to MailStore for postmaster@mail.makomcommunity.org&amp;lt;p&amp;gt;
  Error message: &amp;lt;pre&amp;gt;An error occured while sending or receiving mail. Could not read from the stream. 
  It was probably terminated by the host.&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt; [code] =&gt; 
  ) 
  
      $backTrace = #0 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(322): CRM_Core_Error::backtrace("backTrace", TRUE
  #1 /home/makom/www/www/sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(185): CRM_Core_Error::fatal("Could not connect to MailStore for postmaster@mail.makomcommunity.org&lt;p&gt;Error...")
  #2 /home/makom/www/www/sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(60): CRM_Utils_Mail_EmailProcessor::_process(TRUE, Object(CRM_Core_DAO_MailSettings)) 
  #3 /home/makom/www/www/sites/all/modules/civicrm/api/v3/Job.php(361): CRM_Utils_Mail_EmailProcessor::processBounces() 
  #4 /home/makom/www/www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_fetch_bounces((Array:1)) 
  #5 /home/makom/www/www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9)) 
  #6 /home/makom/www/www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel-&gt;run("job", "fetch_bounces", (Array:1), NULL) 
  #7 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("job", "fetch_bounces", (Array:1)) 
  #8 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager-&gt;executeJob(Object(CRM_Core_ScheduledJob)) 
  #9 /home/makom/www/www/sites/all/modules/civicrm/bin/cron.php(42): CRM_Core_JobManager-&gt;execute() #10 {main} 
  </code></pre>
  
  <p>I guess my question here is this: What do you think is wrong, and how would you go about fixing it? </p>
  
  <p><strong>Update:</strong> I got the error log to cough up a related error! So as of right now, this is my issue. It is also worth noting that I am now having this error with PayPal as well, so I think it's something in the payment processor portion of civi, rather than an authorize.net issue. </p>
  
  <p>Please help me decode these errors! </p>
  
  <pre><code>    $backTrace = 
  #0 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(364): CRM_Core_Error::backtrace("backTrace", TRUE)     
  #1 /home/makom/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php(188): CRM_Core_Error::fatal("Invalid value passed to getPayment function") 
  #2 /home/makom/www/www/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionBase.php(349): CRM_Financial_BAO_PaymentProcessor::getPayment("", "live") 
  #3 /home/makom/www/www/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php(73): CRM_Contribute_Form_ContributionBase-&gt;preProcess()
  #4 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Form.php(455): CRM_Contribute_Form_Contribution_Main-&gt;preProcess() 
  #5 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(94): CRM_Core_Form-&gt;buildForm() 
  #6 /home/makom/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display-&gt;perform(Object(CRM_Contribute_Form_Contribution_Main), "display") 
  #7 /home/makom/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller-&gt;handle(Object(CRM_Contribute_Form_Contribution_Main), "display") 
  #8 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page-&gt;handle("display") 
  #9 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller-&gt;run((Array:3), NULL) 
  #10 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15)) 
  #11 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3)) 
  #12 /home/makom/www/www/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
  #13 [internal function](): civicrm_invoke("contribute", "transact?reset=1&amp;id=13")
  #14 /home/makom/www/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2)) 
  #15 /home/makom/www/www/index.php(21): menu_execute_active_handler()
  #16 {main}
  </code></pre>
  
  <p><strong>Update 2:</strong></p>
  
  <p>This is what I see in lines 324-349. I think this means that the issue is somewhere in CRM_Utils_Array? But I"m not at all sure where to find that. There doesn't seem to be a table in the civicrm database by that name.</p>
  
  <pre><code>//FIXME: to support multiple payment processors
        if ($isMonetary &amp;&amp;
          (!$isPayLater || !empty($this-&gt;_values['payment_processor']))
        ) {
          $ppID = CRM_Utils_Array::value('payment_processor', $this-&gt;_values);
          if (!$ppID) {
            CRM_Core_Error::fatal(ts('A payment processor must be selected for this contribution page (contact the site administrator for assistance).'));
          }
  
          $ppIds = explode(CRM_Core_DAO::VALUE_SEPARATOR, $ppID);
          $this-&gt;_paymentProcessors = CRM_Financial_BAO_PaymentProcessor::getPayments($ppIds, $this-&gt;_mode);
  
          $this-&gt;set('paymentProcessors', $this-&gt;_paymentProcessors);
  
          //set default payment processor
          if (!empty($this-&gt;_paymentProcessors) &amp;&amp; empty($this-&gt;_paymentProcessor)) {
            foreach ($this-&gt;_paymentProcessors as $ppId =&gt; $values) {
              if ($values['is_default'] == 1 || (count($this-&gt;_paymentProcessors) == 1)) {
                $defaultProcessorId = $ppId;
                break;
              }
            }
          }
  
          if (isset($defaultProcessorId)) {
            $this-&gt;_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($defaultProcessorId, $this-&gt;_mode);
            $this-&gt;assign_by_ref('paymentProcessor', $this-&gt;_paymentProcessor);
          }
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-17T08:54:09.513Z
Comments.Text: https://forum.civicrm.org/index.php?topic=5727.5;wap2 - in case if you haven't read this
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Tags: <civicontribute><contributions><payment-processor><contribution-page>
Title: authorize.net payment processor debugging
ThreadText: # authorize.net payment processor debugging
  
  (Asked by: username_0 on 2016-06-16)
  
  All of my contribution pages, when tested, return you back to the page with this message at the top:
  
  Payment Processor Error Message:
  9003: MD5 Verification Failed
  
  I have reset the MD5 code from both sides, even going so far as to delete the entire payment processor and recreate it. Whatever the issue is, it is definitely not the MD5 code.
  
  Authorize.net says that they have no record of having been reached by our website at all, and that something must be going wrong with the call/connection.
  
  Here are the only error codes I found in the log. They both seem to be email related, but perhaps they are related to this somehow?
  
  ```
      $Fatal Error Details = Array ( 
  [message] => Could not connect to MailStore for postmaster@mail.makomcommunity.org&lt;p&gt;
  Error message: &lt;pre&gt;An error occured while sending or receiving mail. Could not read from the stream. 
  It was probably terminated by the host.&lt;/pre&gt;&lt;p&gt; [code] => 
  ) 
  
      $backTrace = #0 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(322): CRM_Core_Error::backtrace("backTrace", TRUE
  #1 /home/makom/www/www/sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(185): CRM_Core_Error::fatal("Could not connect to MailStore for postmaster@mail.makomcommunity.org<p>Error...")
  #2 /home/makom/www/www/sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php(60): CRM_Utils_Mail_EmailProcessor::_process(TRUE, Object(CRM_Core_DAO_MailSettings)) 
  #3 /home/makom/www/www/sites/all/modules/civicrm/api/v3/Job.php(361): CRM_Utils_Mail_EmailProcessor::processBounces() 
  #4 /home/makom/www/www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_fetch_bounces((Array:1)) 
  #5 /home/makom/www/www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9)) 
  #6 /home/makom/www/www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("job", "fetch_bounces", (Array:1), NULL) 
  #7 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("job", "fetch_bounces", (Array:1)) 
  #8 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob)) 
  #9 /home/makom/www/www/sites/all/modules/civicrm/bin/cron.php(42): CRM_Core_JobManager->execute() #10 {main} 
  
  ```
  
  I guess my question here is this: What do you think is wrong, and how would you go about fixing it?
  
  **Update:** I got the error log to cough up a related error! So as of right now, this is my issue. It is also worth noting that I am now having this error with PayPal as well, so I think it's something in the payment processor portion of civi, rather than an authorize.net issue.
  
  Please help me decode these errors!
  
  ```
      $backTrace = 
  #0 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(364): CRM_Core_Error::backtrace("backTrace", TRUE)     
  #1 /home/makom/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php(188): CRM_Core_Error::fatal("Invalid value passed to getPayment function") 
  #2 /home/makom/www/www/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionBase.php(349): CRM_Financial_BAO_PaymentProcessor::getPayment("", "live") 
  #3 /home/makom/www/www/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php(73): CRM_Contribute_Form_ContributionBase->preProcess()
  #4 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Form.php(455): CRM_Contribute_Form_Contribution_Main->preProcess() 
  #5 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(94): CRM_Core_Form->buildForm() 
  #6 /home/makom/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contribute_Form_Contribution_Main), "display") 
  #7 /home/makom/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Main), "display") 
  #8 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("display") 
  #9 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL) 
  #10 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15)) 
  #11 /home/makom/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3)) 
  #12 /home/makom/www/www/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
  #13 [internal function](): civicrm_invoke("contribute", "transact?reset=1&id=13")
  #14 /home/makom/www/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2)) 
  #15 /home/makom/www/www/index.php(21): menu_execute_active_handler()
  #16 {main}
  
  ```
  
  **Update 2:**
  
  This is what I see in lines 324-349. I think this means that the issue is somewhere in CRM\_Utils\_Array? But I"m not at all sure where to find that. There doesn't seem to be a table in the civicrm database by that name.
  
  ```
  //FIXME: to support multiple payment processors
        if ($isMonetary &&
          (!$isPayLater || !empty($this->_values['payment_processor']))
        ) {
          $ppID = CRM_Utils_Array::value('payment_processor', $this->_values);
          if (!$ppID) {
            CRM_Core_Error::fatal(ts('A payment processor must be selected for this contribution page (contact the site administrator for assistance).'));
          }
  
          $ppIds = explode(CRM_Core_DAO::VALUE_SEPARATOR, $ppID);
          $this->_paymentProcessors = CRM_Financial_BAO_PaymentProcessor::getPayments($ppIds, $this->_mode);
  
          $this->set('paymentProcessors', $this->_paymentProcessors);
  
          //set default payment processor
          if (!empty($this->_paymentProcessors) && empty($this->_paymentProcessor)) {
            foreach ($this->_paymentProcessors as $ppId => $values) {
              if ($values['is_default'] == 1 || (count($this->_paymentProcessors) == 1)) {
                $defaultProcessorId = $ppId;
                break;
              }
            }
          }
  
          if (isset($defaultProcessorId)) {
            $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($defaultProcessorId, $this->_mode);
            $this->assign_by_ref('paymentProcessor', $this->_paymentProcessor);
          }
  
  ```
  
  **Tags:** civicontribute, contributions, payment-processor, contribution-page
  
  > **Comments:**
  > **username_1**: https://forum.civicrm.org/index.php?topic=5727.5;wap2 - in case if you haven't read this  
  
  ---
  
  ## 6 answers
  
  ### Answer by username_2 on 2016-06-29. Score: 2 | Accepted answer
  
  The stacktrace error "Invalid value passed to getPayment function" can be caused by not choosing a payment processor on the individual contribution page. Verify that the payment processor on that page(s) is checked; it should then operate correctly.
  
  The message "Payment Processor Error Message: 9003: MD5 Verification Failed" is a separate issue. This is a message from the payment processor, not from CiviCRM. You should investigate it further with your payment processor.
  
  
  ---
  
  ### Answer by username_3 on 2016-06-24. Score: 5
  
  In CRM/Contribute/Form/ContributionBase.php(349) the system is not able to determine the name of your payment processor. Please check:
  
  * that you at least one payment processors configured
  * that all payment configured processors have a 'name' defined and not empty
  * that at least one of your payment processors is set as 'default'
  * since the chosen payment processor depends on the mode the contribution form is used, check that you have 'test' credentials defined for at least one of your configured payment processors
  * finally, that the contribution form leading to this error has a payment processor defined in the Amounts tab
  
  If all of this is correct, I would start debugging this by looking at lines 324 to 349 of the above file and investigating why the $defaultProcessorId variable is set to "" (rather than a numeric value) when reaching line 349.
  
  > **Comments:**
  > **username_0**: Thanks. This is really helpful! I just crashed Civi trying to upgrade it, so I can't even try this. Do you do consulting? I'd love to hire you to help straighten this out, if you're open to it. naomi at socher-lerner.com  
  > **username_0**: I've restored to backup and un-crashed! Now I've checked your suggested list, and am on to looking through the file you suggested. Wish me luck! (And I'm still interested in your consulting services, definitely. This is frustrating!)  
  > **username_0**: Added those lines in the question. Do you see anything I can change?  
  
  ---
  
  ### Answer by username_4 on 2016-06-22. Score: 3
  
  I had a similar issue that ultimately turned out to be a problem between the .htaccess and settings.civicrm.php files. Basically, the contribution page was https:// but the response from authorize.net was being pushed back to http://.
  
  Not sure if this is your problem, but it's an easy thing to check.
  
  > **Comments:**
  > **username_0**: Interesting! How do you check for that?  
  
  ---
  
  ### Answer by username_5 on 2016-06-27. Score: 2
  
  Try changing
  
  if (isset($defaultProcessorId)) {
  
  to
  
  if (!empty($defaultProcessorId)) {
  
  In those code lines above - it seems to be set but empty
  
  
  ---
  
  ### Answer by username_6 on 2016-06-24. Score: 2
  
  Just an intuitive answer. I see two errors. May be they are related or one is influencing the other. May be the first inhibits or is needed for the payment process? Don't leave loose ends!
  
  First error is a fatal error and would block further processing. I see it relates to email. I would try to solve that error first, then concentrate on the other. May be the first will solve the second or it will lead you to the solution of the second.
  
  
  ---
  
  ### Answer by username_7 on 2016-06-28. Score: 1
  
  Had this exact same error but it was specific to the test credentials - production credentials were working fine - if this is the case with you Naomi, then the issue might not be in the code at all (@twomice and @username_5 are both much more experienced than I, so if it is in the code, I will bow out to them). If production credentials ARE working, then try updating the test credentials with those of an authnet sandbox account (this is the only way testing will work). Also, just a tip, the MD5 Hash needs to be relatively short (I've used MD5 Hash generators that spit out really long strings that tend to cause issues).
  
  Hope this helps!
  
  
  ---
  
  