Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders\WooPayments
WooPaymentsService::get_onboarding_client_api_exception_error
Build a WP_Error for an exception thrown while talking to the internal WooPayments onboarding API.
Метод класса: WooPaymentsService{}
Хуков нет.
Возвращает
WP_Error.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_onboarding_client_api_exception_error( $e, $message ): WP_Error;
- $e(Exception) (обязательный)
- The caught exception.
- $message(строка) (обязательный)
- The human-readable, already-escaped error message.
Код WooPaymentsService::get_onboarding_client_api_exception_error() WooPaymentsService::get onboarding client api exception error WC 11.3.0
private function get_onboarding_client_api_exception_error( Exception $e, string $message ): WP_Error {
// Deliberately exclude the exception stack trace from this error data. The data is
// passed to ApiException as additional data (documented as exposable in the error
// response) and is persisted to the NOX profile option by the onboarding step-failed
// handlers, so it must stay free of stack frames, whose arguments can carry file
// paths, tokens, and other sensitive values. Keep only these bounded scalars.
return new WP_Error(
'woocommerce_woopayments_onboarding_client_api_exception',
$message,
array(
'code' => $e->getCode(),
'message' => $e->getMessage(),
)
);
}