array( self::createAcceptHeader( $useSandbox, 1, self::FORMAT_JSON ) ), 'Authorization' => array( self::createAuthorizationHeader( $accessToken ) ), 'User-Agent' => array( 'Sdk/' . self::SDK_VERSION, 'PHP/' . PHP_VERSION, 'WordPress/' . $wp_version, 'WooCommerce/' . WC()->version, 'AplazameWooCommerce/' . WC_Aplazame::VERSION, ), 'Accept-Language' => array( 'es' ), ); if ( $data && ! is_string( $data ) ) { $data = json_encode( $data ); if ( json_last_error() !== JSON_ERROR_NONE ) { throw new DomainException( json_last_error_msg(), json_last_error() ); } $headers['Content-Type'] = array( 'application/json' ); } parent::__construct( $method, $uri, $headers, $data ); } }