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 #70 from goshippo/master
Browse files Browse the repository at this point in the history
Releasing v3.2.0 with tax id support
  • Loading branch information
sam-allen-shippo authored Apr 23, 2021
2 parents f0c1c0c + d87af6c commit d60823e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
13 changes: 13 additions & 0 deletions Shippo/CustomsDeclaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ public class ExporterIdentification : ShippoId
{
[JsonProperty(PropertyName = "eori_number")]
public object EoriNumber { get; set; }

[JsonProperty(PropertyName = "tax_id")]
public TaxId TaxId { get; set; }
}

[JsonObject(MemberSerialization.OptIn)]
public class TaxId : ShippoId
{
[JsonProperty(PropertyName = "number")]
public object Number { get; set; }

[JsonProperty(PropertyName = "type")]
public object Type { get; set; }
}

[JsonObject(MemberSerialization.OptIn)]
Expand Down
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.1</Version>
<Version>3.2.0</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>Adding EORI support</PackageReleaseNotes>
<PackageReleaseNotes>Adding support for tax IDs such as VAT and EIN for customs declarations</PackageReleaseNotes>
<RepositoryType>Github</RepositoryType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
Expand Down
13 changes: 11 additions & 2 deletions ShippoTesting/CustomsDeclarationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public void TestValidCreate()
Assert.AreEqual(invoicedChargesParameters["other_fees"], testObject.InvoicedCharges.OtherFees);
Assert.AreEqual(invoicedChargesParameters["currency"], testObject.InvoicedCharges.Currency);

var exporterIdentificationParameters = (Dictionary<String, String>)parameters["exporter_identification"];
var exporterIdentificationParameters = (Dictionary<String, Object>)parameters["exporter_identification"];
var taxIdParameters = (Dictionary<String, String>) exporterIdentificationParameters["tax_id"];
Assert.AreEqual(taxIdParameters["number"], testObject.ExporterIdentification.TaxId.Number);
Assert.AreEqual(taxIdParameters["type"], testObject.ExporterIdentification.TaxId.Type);
Assert.AreEqual(exporterIdentificationParameters["eori_number"], testObject.ExporterIdentification.EoriNumber);
}

Expand Down Expand Up @@ -114,8 +117,14 @@ public static Hashtable getDefaultParameters()
};
parameters.Add("invoiced_charges", invoicedCharges);

var exporterIdentification = new Dictionary<String, String>(){
var taxId = new Dictionary<String, String>()
{
{"number", "123456789"},
{"type", "EIN" }
};
var exporterIdentification = new Dictionary<String, Object>(){
{"eori_number", "PL12345678912345"},
{"tax_id", taxId}
};
parameters.Add("exporter_identification", exporterIdentification);

Expand Down

0 comments on commit d60823e

Please sign in to comment.