Skip to content

Commit

Permalink
prep release v6.3.0 (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen293 authored Apr 10, 2024
1 parent 3121fc8 commit ebe494e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 45 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CHANGELOG

## Next Release
## v6.3.0 (2024-04-10)

- Add Refund function in insurance service for requesting a refund for standalone insurance.
- Fix payment method funding and deletion failures due to undetermined payment method type
Expand Down
36 changes: 0 additions & 36 deletions EasyPost.Tests/ServicesTests/BillingServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,42 +175,6 @@ public async Task TestGetPaymentMethodByPriorityNoPaymentMethod()
await Assert.ThrowsAsync<InvalidObjectError>(async () => await Client.Billing.DeletePaymentMethod(PaymentMethod.Priority.Primary));
}

[Fact]
[CrudOperations.Delete]
[Testing.Exception]
public async Task TestGetPaymentMethodByPriorityPaymentMethodLegacyIdPrefix()
{
UseMockClient(new List<TestUtils.MockRequest>
{
new(
new TestUtils.MockRequestMatchRules(Method.Get, @"v2\/payment_methods$"),
new TestUtils.MockRequestResponseInfo(HttpStatusCode.OK, data: new PaymentMethodsSummary
{
Id = "summary_123",
PrimaryPaymentMethod = new PaymentMethod
{
Id = "card_123", // Legacy ID prefix, used to determine the type
Object = null, // No object, force use of the ID to determine the type
},
SecondaryPaymentMethod = new PaymentMethod
{
Id = "bank_123", // Legacy ID prefix, used to determine the type
Object = null, // No object, force use of the ID to determine the type
},
})
),
new(
new TestUtils.MockRequestMatchRules(Method.Delete, @"v2\/credit_cards\/\S*$"), // Only include the credit card endpoint, as the ID is a credit card ID
new TestUtils.MockRequestResponseInfo(HttpStatusCode.OK)
),
});

// Deleting a payment method gets the payment method internally, which should execute the code that should not trigger an exception.
Exception? possibleException = await Record.ExceptionAsync(async () => await Client.Billing.DeletePaymentMethod(PaymentMethod.Priority.Primary));

Assert.Null(possibleException);
}

[Fact]
[CrudOperations.Delete]
[Testing.Exception]
Expand Down
2 changes: 1 addition & 1 deletion EasyPost.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>EasyPost-Official</id>
<title>EasyPost (Official)</title>
<version>6.2.1</version>
<version>6.3.0</version>
<authors>EasyPost</authors>
<owners>EasyPost</owners>
<projectUrl>https://www.easypost.com</projectUrl>
Expand Down
5 changes: 2 additions & 3 deletions EasyPost/Models/API/PaymentMethod.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using EasyPost._base;
using EasyPost.Exceptions.General;
using EasyPost.Utilities.Internal;
Expand Down Expand Up @@ -90,11 +89,11 @@ public PaymentMethodType? Type
return null;
}

if (Id.StartsWith("card_", StringComparison.InvariantCulture) || Object == "CreditCard")
if (Object == "CreditCard")
{
type = PaymentMethodType.CreditCard;
}
else if (Id.StartsWith("bank_", StringComparison.InvariantCulture) || Object == "BankAccount")
else if (Object == "BankAccount")
{
type = PaymentMethodType.BankAccount;
}
Expand Down
6 changes: 3 additions & 3 deletions EasyPost/Properties/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

// Version information for an assembly must follow semantic versioning
// When releasing a release candidate, append a 4th digit being the number of the release candidate
[assembly: AssemblyVersion("6.2.1")]
[assembly: AssemblyFileVersion("6.2.1")]
[assembly: AssemblyInformationalVersion("6.2.1")]
[assembly: AssemblyVersion("6.3.0")]
[assembly: AssemblyFileVersion("6.3.0")]
[assembly: AssemblyInformationalVersion("6.3.0")]

0 comments on commit ebe494e

Please sign in to comment.