Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add advanced options #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
shipengine_sdk (1.0.4)
shipengine_sdk (1.0.5)
faraday (>= 1.4)
faraday_middleware (>= 1.0)
hashie (>= 3.4)
Expand Down
5 changes: 4 additions & 1 deletion lib/shipengine/domain/rates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ def get_rates_with_shipment_details(shipment_details, config)
custom_field3: mash_result.advanced_options.custom_field3,
origin_type: mash_result.advanced_options.origin_type,
shipper_release: mash_result.advanced_options.shipper_release,
collect_on_delivery:
collect_on_delivery:,
license_number: mash_result.advanced_options.license_number,
invoice_number: mash_result.advanced_options.invoice_number,
certificate_number: mash_result.advanced_options.certificate_number
)

total_weight = nil
Expand Down
12 changes: 9 additions & 3 deletions lib/shipengine/domain/rates/get_with_shipment_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,14 @@ class AdvancedOptions
:custom_field3,
:origin_type,
:shipper_release,
:collect_on_delivery

:collect_on_delivery,
:license_number,
:invoice_number,
:certificate_number

# rubocop:todo Metrics/ParameterLists
def initialize(bill_to_account:, bill_to_country_code:, bill_to_party:, bill_to_postal_code:, contains_alcohol:, delivered_duty_paid:, dry_ice:, dry_ice_weight:, non_machinable:, saturday_delivery:, use_ups_ground_freight_pricing:, freight_class:, custom_field1:, custom_field2:,
custom_field3:, origin_type:, shipper_release:, collect_on_delivery:)
custom_field3:, origin_type:, shipper_release:, collect_on_delivery:, license_number:, invoice_number:, certificate_number:)
# rubocop:enable Metrics/ParameterLists
@bill_to_account = bill_to_account
@bill_to_country_code = bill_to_country_code
Expand All @@ -209,6 +212,9 @@ def initialize(bill_to_account:, bill_to_country_code:, bill_to_party:, bill_to_
@origin_type = origin_type
@shipper_release = shipper_release
@collect_on_delivery = collect_on_delivery
@license_number = license_number
@invoice_number = invoice_number
@certificate_number = certificate_number
end

class CollectOnDelivery
Expand Down
2 changes: 1 addition & 1 deletion lib/shipengine/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ShipEngine
VERSION = '1.0.4'
VERSION = '1.0.5'
end