Skip to content

Commit 926e997

Browse files
authored
Support for bank accounts in billing (#286)
- Support for bank account in billing options - Move PaymentMethod and CreditCard functions to Billing - New PaymentMethodObject that can be either a credit card or bank account - Move and update unit tests - Used region to keep JSON properties of PaymentMethod grouped
1 parent c78ecc7 commit 926e997

File tree

10 files changed

+251
-401
lines changed

10 files changed

+251
-401
lines changed

EasyPost.Tests/BillingTest.cs

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using System.Threading.Tasks;
2+
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
4+
namespace EasyPost.Tests
5+
{
6+
[TestClass]
7+
public class BillingTest
8+
{
9+
private TestUtils.VCR _vcr;
10+
11+
[TestInitialize]
12+
public void Initialize()
13+
{
14+
_vcr = new TestUtils.VCR("billing", TestUtils.ApiKey.Production);
15+
}
16+
17+
[Ignore]
18+
[TestMethod]
19+
// Skipping due to the lack of an available real payment method in tests.
20+
public async Task TestDeletePaymentMethod()
21+
{
22+
_vcr.SetUpTest("delete_payment_method");
23+
24+
bool success = await Billing.DeletePaymentMethod(PaymentMethod.Priority.Primary);
25+
26+
Assert.IsTrue(success);
27+
}
28+
29+
[Ignore]
30+
[TestMethod]
31+
// Skipping due to the lack of an available real payment method in tests.
32+
public async Task TestFundWallet()
33+
{
34+
_vcr.SetUpTest("fund_wallet");
35+
36+
bool success = await Billing.FundWallet("2000", PaymentMethod.Priority.Primary);
37+
38+
Assert.IsTrue(success);
39+
}
40+
41+
[Ignore]
42+
[TestMethod]
43+
// Skipping due to having to manually add and remove a payment method from the account.
44+
public async Task TestRetrievePaymentMethods()
45+
{
46+
_vcr.SetUpTest("retrieve_payment_methods");
47+
48+
PaymentMethod paymentMethods = await Billing.RetrievePaymentMethods();
49+
50+
Assert.IsNotNull(paymentMethods.primary_payment_method);
51+
Assert.IsNotNull(paymentMethods.secondary_payment_method);
52+
}
53+
}
54+
}

EasyPost.Tests/CreditCardTest.cs

-44
This file was deleted.

EasyPost.Tests/PaymentMethodTest.cs

-28
This file was deleted.

EasyPost.Tests/cassettes/net462/payment_method/all.json

-51
This file was deleted.

EasyPost.Tests/cassettes/net50/payment_method/all.json

-51
This file was deleted.

EasyPost.Tests/cassettes/net60/payment_method/all.json

-51
This file was deleted.

EasyPost.Tests/cassettes/netcore3.1/payment_method/all.json

-51
This file was deleted.

0 commit comments

Comments
 (0)