Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Adding eori field
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-allen-shippo committed Apr 9, 2021
1 parent 4675258 commit afcfc4c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Shippo/CustomsDeclaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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; }
}
}

8 changes: 8 additions & 0 deletions ShippoTesting/CustomsDeclarationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>)parameters["exporter_identification"];
Assert.AreEqual(exporterIdentificationParameters["eori_number"], testObject.ExporterIdentification.EoriNumber);
}

[Test]
Expand Down Expand Up @@ -111,6 +114,11 @@ public static Hashtable getDefaultParameters()
};
parameters.Add("invoiced_charges", invoicedCharges);

var exporterIdentification = new Dictionary<String, String>(){
{"eori_number", "PL12345678912345"},
};
parameters.Add("exporter_identification", exporterIdentification);

return parameters;
}

Expand Down

0 comments on commit afcfc4c

Please sign in to comment.