Class: Api::V1::MyCarrierTmsMessagesController

Inherits:
BaseController
  • Object
show all
Includes:
ActionController::HttpAuthentication::Basic::ControllerMethods
Defined in:
app/controllers/api/v1/my_carrier_tms_messages_controller.rb

Overview

Controller: my carrier tms messages.

Instance Method Summary collapse

Methods inherited from BaseController

#catalog_for_request, #error!, #locale_for_request, #logger, #render_bad_request_response, #render_internal_server_error, #render_not_found_response, #render_result, #render_unprocessable_entity_response, #set_locale, #store_for_request, #underscore_params

Instance Method Details

#shipmentsvoid

This method returns an undefined value.

POST /v1/my_carrier_tms_messages/shipments — MyCarrier TMS shipment
inbound webhook. Currently logs the payload and acknowledges only.



47
48
49
50
51
52
# File 'app/controllers/api/v1/my_carrier_tms_messages_controller.rb', line 47

def shipments
  logger.info "Api::V1::MyCarrierTmsMessagesController#shipments POST, params: #{params}"
  render json: { status: 'OK' }, status: :ok
rescue StandardError => e
  ErrorReporting.error("MyCarrierTmsMessagesController.shipments error: #{e}")
end

#testvoid

This method returns an undefined value.

API_ACCOUNT_LOGIN_WHITELIST = ['mft_gateway']
GET /v1/my_carrier_tms_messages/test — connectivity check, logs params and
always responds 200 (auth is currently disabled, see the commented-out
authenticate_message below).



14
15
16
17
18
19
# File 'app/controllers/api/v1/my_carrier_tms_messages_controller.rb', line 14

def test
  logger.info "Api::V1::MyCarrierTmsMessagesController#test GET, params: #{params}"
  render json: { status: 'OK' }, status: :ok
rescue StandardError => e
  ErrorReporting.error("MyCarrierTmsMessagesController.test error: #{e}")
end

#test_createvoid

This method returns an undefined value.

POST /v1/my_carrier_tms_messages/test_create — connectivity check for the
create path; logs params and always responds 200.



25
26
27
28
29
30
# File 'app/controllers/api/v1/my_carrier_tms_messages_controller.rb', line 25

def test_create
  logger.info "Api::V1::MyCarrierTmsMessagesController#test_create POST, params: #{params}"
  render json: { status: 'OK' }, status: :ok
rescue StandardError => e
  ErrorReporting.error("MyCarrierTmsMessagesController.test_create error: #{e}")
end

#test_updatevoid

This method returns an undefined value.

PUT /v1/my_carrier_tms_messages/test_update — connectivity check for the
update path; logs params and always responds 200.



36
37
38
39
40
41
# File 'app/controllers/api/v1/my_carrier_tms_messages_controller.rb', line 36

def test_update
  logger.info "Api::V1::MyCarrierTmsMessagesController#test_update PUT, params: #{params}"
  render json: { status: 'OK' }, status: :ok
rescue StandardError => e
  ErrorReporting.error("MyCarrierTmsMessagesController.test_update error: #{e}")
end

#update_shipmentsvoid

This method returns an undefined value.

PUT /v1/my_carrier_tms_messages/update_shipments — MyCarrier TMS shipment
update webhook. Currently logs the payload and acknowledges only.



58
59
60
61
62
63
# File 'app/controllers/api/v1/my_carrier_tms_messages_controller.rb', line 58

def update_shipments
  logger.info "Api::V1::MyCarrierTmsMessagesController#update_shipments PUT, params: #{params}"
  render json: { status: 'OK' }, status: :ok
rescue StandardError => e
  ErrorReporting.error("MyCarrierTmsMessagesController.update_shipments error: #{e}")
end