Skip to content

Commit

Permalink
Add refund function in insurance service
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen293 committed Apr 4, 2024
1 parent 14f673e commit 9cffedb
Show file tree
Hide file tree
Showing 6 changed files with 229 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Next release

- Add Refund function in insurance service for requesting a refund for standalone insurance.

## v6.2.1 (2024-03-18)

- Fix serialization bug for carrier accounts parameter on `RetrieveStatelessRates` parameter set
Expand Down
18 changes: 18 additions & 0 deletions EasyPost.Tests/ServicesTests/InsuranceServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,24 @@ public async Task TestRetrieve()
Assert.Equal(insurance.Id, retrievedInsurance.Id);
}

[Fact]
[CrudOperations.Create]
[Testing.Function]
public async Task TestRefund()
{
UseVCR("refund");

Dictionary<string, object> parameters = Fixtures.BasicInsurance;
parameters.Add("tracking_code", "EZ1000000001");

Insurance insurance = await Client.Insurance.Create(parameters);
Insurance cancelledInsurance = await Client.Insurance.Refund(insurance.Id);

Assert.IsType<Insurance>(insurance);
Assert.StartsWith("ins_", cancelledInsurance.Id);
Assert.Equal("cancelled", cancelledInsurance.Status);
}

#endregion

#endregion
Expand Down
98 changes: 98 additions & 0 deletions EasyPost.Tests/cassettes/net/insurance_service/refund.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9cffedb

Please sign in to comment.