Update recurring contribution details failing due to country code error
CiviCRM version 5.45.2 Payment Shared version 1.2.2 Authorize.net version 2.4
We are experiencing a new issue, though not entirely sure at what point this began. On the self-service recurring contribution details update screen, we are seeing the following output when the form is submitted:
setBillingCountry expects ISO 3166-1 alpha-2 country code.
The civi log error is:
$Fatal Error Details = array:3 [
"message" => "setBillingCountry expects ISO 3166-1 alpha-2 country code."
"code" => null
"exception" => InvalidArgumentException {#1714
#message: "setBillingCountry expects ISO 3166-1 alpha-2 country code."
#code: 0
#file: "/var/www/web/public/modules/civicrm/Civi/Payment/PropertyBag.php"
#line: 613
trace: {
/var/www/web/public/modules/civicrm/Civi/Payment/PropertyBag.php:613 {
› if (!is_string($input) || strlen($input) !== 2) {
› throw new \InvalidArgumentException("setBillingCountry expects ISO 3166-1 alpha-2 country code.");
› }
}
/var/www/web/public/modules/civicrm/Civi/Payment/PropertyBag.php:232 { …}
/var/www/web/public/modules/civicrm/Civi/Payment/PropertyBag.php:352 { …}
/var/www/web/public/modules/civicrm/Civi/Payment/PropertyBag.php:120 { …}
/var/www/web/public/civi/extensions/mjwshared/CRM/Core/Payment/MJWTrait.php:553 { …}
/var/www/web/public/civi/extensions/authnet/CRM/Core/Payment/AuthorizeNetCommon.php:525 { …}
/var/www/web/public/modules/civicrm/CRM/Contribute/Form/UpdateBilling.php:208 { …}
/var/www/web/public/modules/civicrm/CRM/Core/Form.php:534 { …}
/var/www/web/public/modules/civicrm/CRM/Core/QuickForm/Action/Submit.php:56 { …}
/var/www/web/public/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
/var/www/web/public/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
/var/www/web/public/modules/civicrm/CRM/Core/Controller.php:352 { …}
/var/www/web/public/modules/civicrm/CRM/Utils/Wrapper.php:98 { …}
/var/www/web/public/modules/civicrm/CRM/Core/Invoke.php:286 { …}
/var/www/web/public/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/var/www/web/public/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/var/www/web/public/modules/civicrm/backdrop/civicrm.module:547 { …}
/var/www/web/public/core/modules/system/system.module:2562 { …}
/var/www/web/public/core/includes/module.inc:942 { …}
/var/www/web/public/core/modules/layout/includes/block_legacy.class.inc:24 { …}
/var/www/web/public/core/modules/layout/includes/block_legacy.class.inc:50 { …}
/var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc:509 { …}
/var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc:463 { …}
/var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc:370 { …}
/var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc:350 { …}
/var/www/web/public/core/modules/layout/layout.module:649 { …}
/var/www/web/public/core/includes/menu.inc:531 { …}
/var/www/web/public/index.php:21 { …}
}
}
]
Jan 25 17:12:09 [debug] $backTrace = #0 /var/www/web/public/modules/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/web/public/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(InvalidArgumentException))
#2 /var/www/web/public/modules/civicrm/backdrop/civicrm.module(547): CRM_Core_Invoke::invoke((Array:3))
#3 /var/www/web/public/core/modules/system/system.module(2562): civicrm_invoke("contribute", "updatebilling")
#4 /var/www/web/public/core/includes/module.inc(942): system_block_view("main", (Array:0), (Array:1))
#5 /var/www/web/public/core/modules/layout/includes/block_legacy.class.inc(24): module_invoke("system", "block_view", "main", (Array:0), (Array:1))
#6 /var/www/web/public/core/modules/layout/includes/block_legacy.class.inc(50): BlockLegacy->buildBlock()
#7 /var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc(509): BlockLegacy->getContent()
#8 /var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc(463): LayoutRendererStandard->renderBlock(Object(BlockLegacy))
#9 /var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc(370): LayoutRendererStandard->renderBlocks()
#10 /var/www/web/public/core/modules/layout/plugins/renderers/layout_renderer_standard.inc(350): LayoutRendererStandard->renderLayout()
#11 /var/www/web/public/core/modules/layout/layout.module(649): LayoutRendererStandard->render()
#12 /var/www/web/public/core/includes/menu.inc(531): layout_route_handler((Array:31))
#13 /var/www/web/public/index.php(21): menu_execute_active_handler()
#14 {main}
The fields on this screen are the Authorize.net (Credit Card) fields (card type, card number, security code, expiration date) and the Billing Name and Address Fields (Billing First Name, Billing Middle Name, Billing Last Name, Street Address, City, Country, State/Province, Postal Code).
The billing fields are core fields, so I'm wondering what is happening where the billingCountry property is being passed something that is not ISO 3166-1 alpha-2? Is this a bug with the Authorize.net extension, or is something else going on?