Exception: Correios::Pricefier::CalculatePriceFAC
- Inherits:
-
Helper
- Object
- StandardError
- CorreiosException
- Helper
- Correios::Pricefier::CalculatePriceFAC
- Defined in:
- lib/pricefier/requests/calculate_price_fac.rb
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ CalculatePriceFAC
constructor
A new instance of CalculatePriceFAC.
- #request ⇒ Object
Methods inherited from Helper
#array_to_string, #array_to_string_comma, #bool_to_int, #bool_to_string, #calculate_reverse_shipping_deadline, #calculate_shipping_deadline, #date_to_string, #decimal_to_string, #generate_http_exception, #generate_revese_logistics_exception, #generate_soap_fault_exception, #generate_sro_exception, #inverse_card_status, #inverse_object_type, #inverse_payment_method, #inverse_reverse_shipping_type, #inverse_service_availability, #inverse_shipping_cancellation, #inverse_tracking_event_status, #object_type, #payment_method, #pricefier_object_type, #remove_label_digit_checker, #reverse_shipping_service, #reverse_shipping_type, #reverse_tracking_result_type, #string_to_bool, #string_to_date, #string_to_decimal, #string_to_time, #string_to_time_no_second, #ticket_type, #tracking_language, #tracking_query_type, #tracking_result_type
Methods inherited from CorreiosException
Constructor Details
#initialize(data = {}) ⇒ CalculatePriceFAC
Returns a new instance of CalculatePriceFAC.
4 5 6 7 8 9 10 11 |
# File 'lib/pricefier/requests/calculate_price_fac.rb', line 4 def initialize(data = {}) @show_request = data[:show_request] @service_codes = data[:service_codes] @weight = data[:weight] @reference_date = data[:reference_date] super() end |
Instance Method Details
#request ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/pricefier/requests/calculate_price_fac.rb', line 13 def request puts xml if @show_request == true begin format_response(Pricefier.client.call( :calc_preco_fac, soap_action: 'http://tempuri.org/CalcPrecoFAC', xml: xml ).to_hash) rescue Savon::SOAPFault => error generate_soap_fault_exception(error) rescue Savon::HTTPError => error generate_http_exception(error.http.code) end end |