diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ec9c4a6..d51b2a22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/EasyPost.Tests/ServicesTests/BillingServiceTest.cs b/EasyPost.Tests/ServicesTests/BillingServiceTest.cs index dcdeeb97..0c7b1306 100644 --- a/EasyPost.Tests/ServicesTests/BillingServiceTest.cs +++ b/EasyPost.Tests/ServicesTests/BillingServiceTest.cs @@ -175,42 +175,6 @@ public async Task TestGetPaymentMethodByPriorityNoPaymentMethod() await Assert.ThrowsAsync(async () => await Client.Billing.DeletePaymentMethod(PaymentMethod.Priority.Primary)); } - [Fact] - [CrudOperations.Delete] - [Testing.Exception] - public async Task TestGetPaymentMethodByPriorityPaymentMethodLegacyIdPrefix() - { - UseMockClient(new List - { - 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] diff --git a/EasyPost.nuspec b/EasyPost.nuspec index 947b496c..22dd864f 100644 --- a/EasyPost.nuspec +++ b/EasyPost.nuspec @@ -3,7 +3,7 @@ EasyPost-Official EasyPost (Official) - 6.2.1 + 6.3.0 EasyPost EasyPost https://www.easypost.com diff --git a/EasyPost/Models/API/PaymentMethod.cs b/EasyPost/Models/API/PaymentMethod.cs index b1491c46..5a7e9144 100644 --- a/EasyPost/Models/API/PaymentMethod.cs +++ b/EasyPost/Models/API/PaymentMethod.cs @@ -1,4 +1,3 @@ -using System; using EasyPost._base; using EasyPost.Exceptions.General; using EasyPost.Utilities.Internal; @@ -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; } diff --git a/EasyPost/Properties/VersionInfo.cs b/EasyPost/Properties/VersionInfo.cs index b062489e..1f21137f 100644 --- a/EasyPost/Properties/VersionInfo.cs +++ b/EasyPost/Properties/VersionInfo.cs @@ -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")] diff --git a/examples b/examples index a073139f..4f12b33d 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit a073139f81aa9c82e72bcc000a6c1a155050b1b9 +Subproject commit 4f12b33d59586e70250231d89744a7512c09f97c