Sha256: 48e41ebb5539121c2db19de455897c89b4c86b38190a0d7ecc8cd2bb74184a61

Contents?: true

Size: 659 Bytes

Versions: 7

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

require 'dry/monads'

module FriendlyShipping
  module Services
    class Ups
      class ParseShipmentConfirmResponse
        def self.call(request:, response:)
          parsing_result = ParseXMLResponse.call(
            request: request,
            response: response,
            expected_root_tag: 'ShipmentConfirmResponse'
          )
          parsing_result.fmap do |xml|
            FriendlyShipping::ApiResult.new(
              xml.root.at('ShipmentDigest').text,
              original_request: request,
              original_response: response
            )
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
friendly_shipping-0.9.0 lib/friendly_shipping/services/ups/parse_shipment_confirm_response.rb
friendly_shipping-0.8.1 lib/friendly_shipping/services/ups/parse_shipment_confirm_response.rb
friendly_shipping-0.8.0 lib/friendly_shipping/services/ups/parse_shipment_confirm_response.rb
friendly_shipping-0.7.3 lib/friendly_shipping/services/ups/parse_shipment_confirm_response.rb
friendly_shipping-0.7.2 lib/friendly_shipping/services/ups/parse_shipment_confirm_response.rb
friendly_shipping-0.7.1 lib/friendly_shipping/services/ups/parse_shipment_confirm_response.rb
friendly_shipping-0.7.0 lib/friendly_shipping/services/ups/parse_shipment_confirm_response.rb