From afcfc4cda8f0e89fbfa9731747cdda0fe53552e4 Mon Sep 17 00:00:00 2001 From: sam-allen-shippo Date: Fri, 9 Apr 2021 11:22:03 -0700 Subject: [PATCH 1/2] Adding eori field --- Shippo/CustomsDeclaration.cs | 10 ++++++++++ ShippoTesting/CustomsDeclarationTest.cs | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/Shippo/CustomsDeclaration.cs b/Shippo/CustomsDeclaration.cs index a63c217..2c04ca2 100644 --- a/Shippo/CustomsDeclaration.cs +++ b/Shippo/CustomsDeclaration.cs @@ -22,6 +22,13 @@ public class InvoicedCharges : ShippoId public object OtherFees { get; set; } } + [JsonObject(MemberSerialization.OptIn)] + public class ExporterIdentification : ShippoId + { + [JsonProperty(PropertyName = "eori_number")] + public object EoriNumber { get; set; } + } + [JsonObject(MemberSerialization.OptIn)] public class CustomsDeclaration : ShippoId { [JsonProperty(PropertyName = "object_created")] @@ -98,6 +105,9 @@ public class CustomsDeclaration : ShippoId { [JsonProperty(PropertyName = "invoiced_charges")] public InvoicedCharges InvoicedCharges { get; set; } + + [JsonProperty(PropertyName = "exporter_identification")] + public ExporterIdentification ExporterIdentification { get; set; } } } diff --git a/ShippoTesting/CustomsDeclarationTest.cs b/ShippoTesting/CustomsDeclarationTest.cs index e552382..cb3466a 100644 --- a/ShippoTesting/CustomsDeclarationTest.cs +++ b/ShippoTesting/CustomsDeclarationTest.cs @@ -41,6 +41,9 @@ public void TestValidCreate() Assert.AreEqual(invoicedChargesParameters["total_duties"], testObject.InvoicedCharges.TotalDuties); Assert.AreEqual(invoicedChargesParameters["other_fees"], testObject.InvoicedCharges.OtherFees); Assert.AreEqual(invoicedChargesParameters["currency"], testObject.InvoicedCharges.Currency); + + var exporterIdentificationParameters = (Dictionary)parameters["exporter_identification"]; + Assert.AreEqual(exporterIdentificationParameters["eori_number"], testObject.ExporterIdentification.EoriNumber); } [Test] @@ -111,6 +114,11 @@ public static Hashtable getDefaultParameters() }; parameters.Add("invoiced_charges", invoicedCharges); + var exporterIdentification = new Dictionary(){ + {"eori_number", "PL12345678912345"}, + }; + parameters.Add("exporter_identification", exporterIdentification); + return parameters; } From a4c334a88101b94372c1c21f3f29a183c631a3d1 Mon Sep 17 00:00:00 2001 From: sam-allen-shippo Date: Fri, 9 Apr 2021 13:51:32 -0700 Subject: [PATCH 2/2] Bumping API version --- Shippo/Shippo.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shippo/Shippo.csproj b/Shippo/Shippo.csproj index 49e0885..066b34c 100644 --- a/Shippo/Shippo.csproj +++ b/Shippo/Shippo.csproj @@ -2,14 +2,14 @@ net45;net40 - 3.1.0 + 3.1.1 Shippo client library .NET library which integrates with Shippo Multi Carrier Shipping API. This library provides access to Shippo (goshippo.com) API capabilities. Including label generation, rating, tracking and more. Shippo Shipping API client Library (USPS, FedEx, UPS, and more) https://github.com/goshippo/shippo-csharp-client/ https://github.com/goshippo/shippo-csharp-client/ USPS Fedex UPS API Shippo - Added Tracking Sub-statuses and additional Customs and Manifest testing + Adding EORI support Github false