       |> Map.merge(security_params)
       |> Map.merge(rate_request_params(shipment, service))
 
-    {:ok, response} = Client.post("/Rate", params, [{"Content-Type", "application/json"}])
+    response = Client.post("/Rate", params, [{"Content-Type", "application/json"}])
 
     with_response response do
       body = response.body["RateResponse"]

  defmacro with_response(response, do: block) do
    quote do
      response = unquote(response)
      fault = response.body["Fault"]

      if not is_nil(fault) do
        error = fault["detail"]["Errors"]["ErrorDetail"]["PrimaryErrorCode"]
        {:error, %{code: error["Code"], message: error["Description"]}}
      else
        unquote(block)
      end
    end
  end

      |> Map.merge(security_params)
      |> Map.merge(void_params)

    response = Client.post("/Void", params, [{"Content-Type", "application/json"}])

    with_response response do
      body = response.body["VoidShipmentResponse"]
