Class: Edi::Walmart::ConfirmMessageSender

Inherits:
BaseEdiService show all
Defined in:
app/services/edi/walmart/confirm_message_sender.rb

Constant Summary

Constants included from AddressAbbreviator

AddressAbbreviator::MAX_LENGTH

Instance Attribute Summary

Attributes inherited from BaseEdiService

#orchestrator

Instance Method Summary collapse

Methods inherited from BaseEdiService

#duplicate_po_already_notified?, #initialize, #mark_duplicate_po_as_notified, #report_order_creation_issues, #safe_process_edi_communication_log

Methods included from AddressAbbreviator

#abbreviate_street, #collect_street_originals, #record_address_abbreviation_notes

Methods inherited from BaseService

#initialize, #log_debug, #log_error, #log_info, #log_warning, #logger, #options, #tagged_logger

Constructor Details

This class inherits a constructor from Edi::BaseEdiService

Instance Method Details

#process(edi_communication_logs = nil) ⇒ Object

Sends ship confirmation to Walmart Marketplace API
See: https://developer.walmart.com/us-marketplace/docs/shipping-orders

Endpoint: POST /v3/orders/purchaseOrderId/shipping

Parameters:



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/services/edi/walmart/confirm_message_sender.rb', line 10

def process(edi_communication_logs = nil)
  edi_communication_logs ||= EdiCommunicationLog
                               .requiring_processing
                               .where(partner: orchestrator.partner, category: 'order_confirm')
  edi_communication_logs = [edi_communication_logs].flatten

  transport = instantiate_transporter

  edi_communication_logs.each do |ecl|
    send_confirmation(ecl, transport)
  end
end