WC_Auth::post_consumer_data PHP Method

post_consumer_data() protected method

Post consumer data.
Since: 2.4.0
protected post_consumer_data ( array $consumer_data, string $url ) : boolean
$consumer_data array
$url string
return boolean
        protected function post_consumer_data($consumer_data, $url)
        {
            $params = array('body' => json_encode($consumer_data), 'timeout' => 60, 'headers' => array('Content-Type' => 'application/json;charset=' . get_bloginfo('charset')));
            $response = wp_safe_remote_post(esc_url_raw($url), $params);
            if (is_wp_error($response)) {
                throw new Exception($response->get_error_message());
            } elseif (200 != $response['response']['code']) {
                throw new Exception(__('An error occurred in the request and at the time were unable to send the consumer data', 'woocommerce'));
            }
            return true;
        }