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

add handle field to shipping lines #249

Merged
merged 2 commits into from
Nov 19, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
}
],
"carrier_identifier": "third_party_carrier_identifier",
"requested_fulfillment_service_id": null
"requested_fulfillment_service_id": null,
"handle": "test"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
}
],
"carrier_identifier": "third_party_carrier_identifier",
"requested_fulfillment_service_id": 123456
"requested_fulfillment_service_id": 123456,
"handle": "test"
}
3 changes: 2 additions & 1 deletion fixtures/shippinglines/valid.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
}
],
"carrier_identifier": "third_party_carrier_identifier",
"requested_fulfillment_service_id": "third_party_fulfillment_service_id"
"requested_fulfillment_service_id": "third_party_fulfillment_service_id",
"handle": "test"
}
1 change: 1 addition & 0 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ type ShippingLines struct {
DeliveryCategory string `json:"delivery_category,omitempty"`
CarrierIdentifier string `json:"carrier_identifier,omitempty"`
TaxLines []TaxLine `json:"tax_lines,omitempty"`
Handle string `json:"handle,omitempty"`
}

// UnmarshalJSON custom unmarshaller for ShippingLines implemented to handle requested_fulfillment_service_id being
Expand Down
5 changes: 5 additions & 0 deletions order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,10 @@ func testShippingLines(t *testing.T, expected, actual ShippingLines) {
t.Errorf("ShippingLines.CarrierIdentifier should be (%v), was (%v)", expected.CarrierIdentifier, actual.CarrierIdentifier)
}

if actual.Handle != expected.Handle {
t.Errorf("ShippingLines.Handle should be (%v), was (%v)", expected.Handle, actual.Handle)
}

testTaxLines(t, expected.TaxLines, actual.TaxLines)
}

Expand Down Expand Up @@ -1346,5 +1350,6 @@ func validShippingLines() ShippingLines {
Rate: &tl2Rate,
},
},
Handle: "test",
}
}