woocommerce_woopayments_onboarding_test_account_non_recoverable_errors │ хук-фильтр │ WC 11.1.0

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.

Использование

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.

Список изменений

С версии 11.1.0 Введена.

Где вызывается хук

WooPaymentsService::is_test_account_init_error_non_recoverable()
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
);

Где используется хук в WooCommerce

Использование не найдено.