Answers.Body: <p>Do you have <a href="https://civicrm.org/extensions/contribution-transact-api" rel="nofollow noreferrer">https://civicrm.org/extensions/contribution-transact-api</a> installed? You need that now if using webform with contributions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-04T20:15:27.413Z
Answers.Text: Thanks os much ! How could I have known ?! yes, that changes the error. I am testing on a development server, and not sure if all my settings are right. it now keeps telling me `It appears that this transaction is a duplicate` even when using different amounts. Do you know if there is anything else I need to configure to have `wf_civicrm` work with the `contribution-transact-api` ?
Answers.UserDisplayName: commonpike
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-04T20:59:50.057Z
Answers.Text: I'm not aware of anything else.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-05T07:14:50.250Z
Answers.Text: It has the same errors on live ..
Answers.UserDisplayName: commonpike
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-21T19:59:26.553Z
Answers.Text: @commonpike See if https://github.com/civicrm/civicrm-core/pull/25020 fixes the "transaction is a duplicate" issue?
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-04T19:17:41.483Z
Answers.LastActivityDate: 2022-07-04T19:17:41.483Z
Answers.UserDisplayName: Demerit
Body: <p>Seemingly after updating CiviCRM to 5.50.3 and webform_civicrm to 7.x-5.8 on drupal 7.83, webform payments fail. Watchdog says</p>
  <pre><code>The CiviCRM &quot;contribution transact&quot; API returned the error: &quot;Unknown api version&quot; 
  when called by function &quot;validate&quot; on line 97 of wf_crm_webform_postprocess.inc 
  with parameters: &quot;Array ( [credit_card_type] =&gt; MasterCard [credit_card_number] =&gt; xxxxxxxxxx...[snip]
  [form_token] =&gt; qnqM4nlUWJSVIPZiCsb57jdigsIZ76jGiG0Aa9a6nyc [form_id] =&gt; 
  webform_client_form_2556 [op] =&gt; Submit [payment_instrument_id] =&gt; 1 [payment_processor] 
  =&gt; 5 [card_type_id] =&gt; 2 [pan_truncation] =&gt; 7947 [check_permissions] =&gt; [version] =&gt; 3 )
  </code></pre>
  <p>As a result, it appears everything to be handled after payment is not done, storing the payment in civicrm, sending mails/invoices, adding contacts to groups, etc - however, strangely, the payment seems to have been done.</p>
  <p>Assuming this string &quot;Unknown api version&quot; comes from Civi/API/Request.php,
  <a href="https://lab.civicrm.org/dev/core/-/blob/fb87724ca7f9fd42560e0729e9e46a3c.." rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/blob/fb87724ca7f9fd42560e0729e9e46a3c..</a>.</p>
  <p>it seems <code>$params['version']</code> is not 3 or 4.</p>
  <p>It is clear in the error message version is either 3 or '3' - I can't see where the value comes from in <code>function contributionParams</code> - if it comes from a post, it might be a string?</p>
  <p>@see <a href="https://www.drupal.org/project/webform_civicrm/issues/3294171" rel="nofollow noreferrer">https://www.drupal.org/project/webform_civicrm/issues/3294171</a></p>
  
Tags: <webform-civicrm><payment><drupal-7>
Title: Payment forms fail with "Unknown api version"
ThreadText: # Payment forms fail with "Unknown api version"
  
  (Asked by: username_0 on 2022-07-04)
  
  Seemingly after updating CiviCRM to 5.50.3 and webform_civicrm to 7.x-5.8 on drupal 7.83, webform payments fail. Watchdog says
  The CiviCRM "contribution transact" API returned the error: "Unknown api version" 
  when called by function "validate" on line 97 of wf_crm_webform_postprocess.inc 
  with parameters: "Array ( [credit_card_type] => MasterCard [credit_card_number] => xxxxxxxxxx...[snip]
  [form_token] => qnqM4nlUWJSVIPZiCsb57jdigsIZ76jGiG0Aa9a6nyc [form_id] => 
  webform_client_form_2556 [op] => Submit [payment_instrument_id] => 1 [payment_processor] 
  => 5 [card_type_id] => 2 [pan_truncation] => 7947 [check_permissions] => [version] => 3 )
  
  As a result, it appears everything to be handled after payment is not done, storing the payment in civicrm, sending mails/invoices, adding contacts to groups, etc - however, strangely, the payment seems to have been done.
  Assuming this string "Unknown api version" comes from Civi/API/Request.php,
  https://lab.civicrm.org/dev/core/-/blob/fb87724ca7f9fd42560e0729e9e46a3c...
  it seems $params['version'] is not 3 or 4.
  It is clear in the error message version is either 3 or '3' - I can't see where the value comes from in function contributionParams - if it comes from a post, it might be a string?
  @see https://www.drupal.org/project/webform_civicrm/issues/3294171
  
  **Tags:** webform-civicrm, payment, drupal-7
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-07-04. Score: 1 | Accepted answer
  
  Do you have <https://civicrm.org/extensions/contribution-transact-api> installed? You need that now if using webform with contributions.
  
  > **Comments:**
  > **username_0**: Thanks os much ! How could I have known ?! yes, that changes the error. I am testing on a development server, and not sure if all my settings are right. it now keeps telling me `It appears that this transaction is a duplicate` even when using different amounts. Do you know if there is anything else I need to configure to have `wf_civicrm` work with the `contribution-transact-api` ?  
  > **username_1**: I'm not aware of anything else.  
  > **username_0**: It has the same errors on live ..  
  > **username_2**: @username_0 See if https://github.com/civicrm/civicrm-core/pull/25020 fixes the "transaction is a duplicate" issue?  
  
  ---
  
  