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

Commit

Permalink
Merge pull request #66 from goshippo/sa/eori
Browse files Browse the repository at this point in the history
Adding eori field
  • Loading branch information
sam-allen-shippo authored Apr 9, 2021
2 parents 4675258 + a4c334a commit ce2b521
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 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; }
}
}

4 changes: 2 additions & 2 deletions Shippo/Shippo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<TargetFrameworks>net45;net40</TargetFrameworks>
<Version>3.1.0</Version>
<Version>3.1.1</Version>
<Title>Shippo client library</Title>
<Description>.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.</Description>
<Summary>Shippo Shipping API client Library (USPS, FedEx, UPS, and more)</Summary>
<PackageProjectUrl>https://github.com/goshippo/shippo-csharp-client/</PackageProjectUrl>
<RepositoryUrl>https://github.com/goshippo/shippo-csharp-client/</RepositoryUrl>
<PackageTags>USPS Fedex UPS API Shippo</PackageTags>
<PackageReleaseNotes>Added Tracking Sub-statuses and additional Customs and Manifest testing</PackageReleaseNotes>
<PackageReleaseNotes>Adding EORI support</PackageReleaseNotes>
<RepositoryType>Github</RepositoryType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
Expand Down
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 ce2b521

Please sign in to comment.