Class: Shipping::ShipsuranceClient
- Inherits:
-
BaseService
- Object
- BaseService
- Shipping::ShipsuranceClient
- Defined in:
- app/services/shipping/shipsurance_client.rb
Overview
Faraday-backed HTTP client for the Shipsurance (DSI) Carrier Insurance API.
Handles credential injection, URL routing (record vs void), and
form-encoded POST delivery for both production and sandbox environments.
The record and void endpoints live on different subdomains; this client
resolves the correct void base automatically from the configured base_url.
Constant Summary collapse
- RECORD_PATH =
'/dsi_recordShipment.aspx'- VOID_PATH =
'/VoidShipment.aspx'
Instance Method Summary collapse
-
#record_shipment(params) ⇒ String
Record a new shipment for insurance coverage.
-
#void_shipment(params) ⇒ String
Void a previously recorded shipment.
Methods inherited from BaseService
#initialize, #log_debug, #log_error, #log_info, #log_warning, #logger, #options, #process, #tagged_logger
Constructor Details
This class inherits a constructor from BaseService
Instance Method Details
#record_shipment(params) ⇒ String
Record a new shipment for insurance coverage.
21 22 23 |
# File 'app/services/shipping/shipsurance_client.rb', line 21 def record_shipment(params) post(record_url, with_credentials(params)) end |
#void_shipment(params) ⇒ String
Void a previously recorded shipment.
30 31 32 |
# File 'app/services/shipping/shipsurance_client.rb', line 30 def void_shipment(params) post(void_url, with_credentials(params)) end |