Exception: Correios::ReverseLogistics::CancelShipping
- Inherits:
-
Helper
- Object
- StandardError
- CorreiosException
- Helper
- Correios::ReverseLogistics::CancelShipping
- Defined in:
- lib/reverse_logistics/requests/cancel_shipping.rb
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ CancelShipping
constructor
A new instance of CancelShipping.
- #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 = {}) ⇒ CancelShipping
Returns a new instance of CancelShipping.
4 5 6 7 8 9 10 11 |
# File 'lib/reverse_logistics/requests/cancel_shipping.rb', line 4 def initialize(data = {}) @credentials = Correios.credentials @show_request = data[:show_request] @ticket_number = data[:ticket_number] @ticket_type = data[:ticket_type] super() end |
Instance Method Details
#request ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/reverse_logistics/requests/cancel_shipping.rb', line 13 def request puts xml if @show_request == true begin format_response(ReverseLogistics.client.call( :cancelar_pedido, soap_action: '', 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 |