woocommerce_woopayments_onboarding_test_account_non_recoverable_errors
Filters the error identifiers for which retrying the WooPayments test account initialization cannot succeed.
Each identifier is matched against both the error type and the error code reported by the WooPayments extension. When an initialization error matches, the test account onboarding step is skipped forward instead of being marked as failed.
Usage
add_filter( 'woocommerce_woopayments_onboarding_test_account_non_recoverable_errors', 'wp_kama_woocommerce_woopayments_onboarding_test_account_non_recoverable_errors_filter', 10, 2 );
/**
* Function for `woocommerce_woopayments_onboarding_test_account_non_recoverable_errors` filter-hook.
*
* @param string[] $identifiers The non-recoverable error identifiers.
* @param WP_Error $error The error returned by the test account initialization request.
*
* @return string[]
*/
function wp_kama_woocommerce_woopayments_onboarding_test_account_non_recoverable_errors_filter( $identifiers, $error ){
// filter...
return $identifiers;
}
- $identifiers(string[])
- The non-recoverable error identifiers.
- $error(WP_Error)
- The error returned by the test account initialization request.
Changelog
| Since 11.1.0 | Introduced. |
Where the hook is called
woocommerce_woopayments_onboarding_test_account_non_recoverable_errors
woocommerce/src/Internal/Admin/Settings/PaymentsProviders/WooPayments/WooPaymentsService.php 661-665
$non_recoverable_identifiers = (array) apply_filters( 'woocommerce_woopayments_onboarding_test_account_non_recoverable_errors', self::ONBOARDING_TEST_ACCOUNT_NON_RECOVERABLE_ERROR_IDENTIFIERS, $error );