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