From 5fafadf2f4d91fb6fa55061bf3196c6e5792f5c1 Mon Sep 17 00:00:00 2001 From: Braintree Date: Mon, 23 Jan 2017 20:00:39 +0000 Subject: [PATCH] 3.5.0 --- CHANGELOG.md | 5 ++ README.md | 2 +- src/Braintree/AchMandate.cs | 21 +++++++ src/Braintree/Braintree.xproj | 5 +- src/Braintree/IMerchantAccountGateway.cs | 1 + src/Braintree/MerchantAccountGateway.cs | 22 +++++++ src/Braintree/PaginatedCollection.cs | 47 +++++++++++++++ src/Braintree/PaginatedResult.cs | 18 ++++++ src/Braintree/TransactionGateway.cs | 15 +++-- src/Braintree/UsBankAccount.cs | 4 +- src/Braintree/UsBankAccountDetails.cs | 4 +- src/Braintree/project.json | 7 ++- test/Braintree.TestUtil/TestHelper.cs | 2 +- .../CustomerIntegrationTest.cs | 2 - .../MerchantAccountIntegrationTest.cs | 59 +++++++++++++++++++ .../PaymentMethodIntegrationTest.cs | 1 - .../TransactionIntegrationTest.cs | 13 ++-- ...ansparentRedirectRequestIntegrationTest.cs | 4 +- .../UsBankIntegrationTest.cs | 9 ++- test/Braintree.Tests/CustomerTest.cs | 2 - test/Braintree.Tests/TestTransactionTest.cs | 14 ----- .../WebhookNotificationTest.cs | 2 - 22 files changed, 216 insertions(+), 43 deletions(-) create mode 100644 src/Braintree/AchMandate.cs create mode 100644 src/Braintree/PaginatedCollection.cs create mode 100644 src/Braintree/PaginatedResult.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 514dafd8..05607b69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.5.0 +* Stop sending account_description field from us bank accounts +* Add multi-currency support for OAuth Onboarded Merchants +* Add functionality to list all merchant accounts for a merchant with `MerchantAccount.all` + ## 3.4.0 * Add payer_status accessor to paypal_details object * Add option `skip_advanced_fraud_check` for transaction flows diff --git a/README.md b/README.md index 2c670764..96bad0e7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Braintree .NET Client Library +# Braintree .NET Server Library The Braintree assembly provides integration access to the Braintree Gateway. diff --git a/src/Braintree/AchMandate.cs b/src/Braintree/AchMandate.cs new file mode 100644 index 00000000..c4f14787 --- /dev/null +++ b/src/Braintree/AchMandate.cs @@ -0,0 +1,21 @@ +using System; + +namespace Braintree +{ + public class AchMandate + { + public virtual string Text { get; protected set; } + public virtual DateTime? AcceptedAt { get; protected set; } + + protected internal AchMandate(NodeWrapper node) + { + if (node == null) return; + + Text = node.GetString("text"); + AcceptedAt = node.GetDateTime("accepted-at"); + } + + [Obsolete("Mock Use Only")] + protected AchMandate() { } + } +} diff --git a/src/Braintree/Braintree.xproj b/src/Braintree/Braintree.xproj index 955c4833..8e0e9487 100644 --- a/src/Braintree/Braintree.xproj +++ b/src/Braintree/Braintree.xproj @@ -9,7 +9,7 @@ Library Properties Braintree - Braintree-3.4.0 + Braintree-3.5.0 v4.5.2 512 @@ -50,6 +50,7 @@ --> + @@ -163,6 +164,8 @@ + + diff --git a/src/Braintree/IMerchantAccountGateway.cs b/src/Braintree/IMerchantAccountGateway.cs index d25db948..ae20802f 100644 --- a/src/Braintree/IMerchantAccountGateway.cs +++ b/src/Braintree/IMerchantAccountGateway.cs @@ -8,5 +8,6 @@ public interface IMerchantAccountGateway Result CreateForCurrency(MerchantAccountCreateForCurrencyRequest request); MerchantAccount Find(string id); Result Update(string id, MerchantAccountRequest request); + PaginatedCollection All(); } } diff --git a/src/Braintree/MerchantAccountGateway.cs b/src/Braintree/MerchantAccountGateway.cs index a1b538ab..9380a0e1 100644 --- a/src/Braintree/MerchantAccountGateway.cs +++ b/src/Braintree/MerchantAccountGateway.cs @@ -1,4 +1,5 @@ using Braintree.Exceptions; +using System.Collections.Generic; using System.Xml; namespace Braintree @@ -47,5 +48,26 @@ public virtual MerchantAccount Find(string id) return new MerchantAccount(new NodeWrapper(merchantAccountXML)); } + + public virtual PaginatedCollection All() + { + return new PaginatedCollection(FetchMerchantAccounts); + } + + private PaginatedResult FetchMerchantAccounts(int page) + { + XmlNode merchantAccountXML = service.Get(service.MerchantPath() + "/merchant_accounts?page=" + page); + var nodeWrapper = new NodeWrapper(merchantAccountXML); + + var totalItems = nodeWrapper.GetInteger("total-items").Value; + var pageSize = nodeWrapper.GetInteger("page-size").Value; + var merchantAccounts = new List(); + foreach (var node in nodeWrapper.GetList("merchant-account")) + { + merchantAccounts.Add(new MerchantAccount(node)); + } + + return new PaginatedResult(totalItems, pageSize, merchantAccounts); + } } } diff --git a/src/Braintree/PaginatedCollection.cs b/src/Braintree/PaginatedCollection.cs new file mode 100644 index 00000000..46d79b04 --- /dev/null +++ b/src/Braintree/PaginatedCollection.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; + +namespace Braintree +{ + public class PaginatedCollection : IEnumerable where T : class + { + public int Size { get { return TotalItems; } } + + private int PageSize = 0; + private int CurrentPage = 0; + private int Index = 0; + private int TotalItems = 0; + private List Items = new List(); + private System.Func> Pager; + + public PaginatedCollection(System.Func> pager) + { + Pager = pager; + } + + public IEnumerator GetEnumerator() + { + do + { + if (CurrentPage == 0 || Index % PageSize == 0) + { + CurrentPage++; + var results = Pager(CurrentPage); + TotalItems = results.TotalItems; + PageSize = results.PageSize; + Items = results.Items; + } + + foreach (T item in Items) + { + Index++; + yield return item; + } + } while(Index < TotalItems); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + } +} diff --git a/src/Braintree/PaginatedResult.cs b/src/Braintree/PaginatedResult.cs new file mode 100644 index 00000000..1a95b414 --- /dev/null +++ b/src/Braintree/PaginatedResult.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; + +namespace Braintree +{ + public class PaginatedResult where T : class + { + public int TotalItems { get; private set; } + public int PageSize { get; private set; } + public List Items { get; private set; } + + public PaginatedResult(int totalItems, int pageSize, List items) + { + TotalItems = totalItems; + PageSize = pageSize; + Items = items; + } + } +} diff --git a/src/Braintree/TransactionGateway.cs b/src/Braintree/TransactionGateway.cs index f99662f6..86dcadd3 100644 --- a/src/Braintree/TransactionGateway.cs +++ b/src/Braintree/TransactionGateway.cs @@ -204,12 +204,19 @@ private List FetchTransactions(TransactionSearchRequest query, stri var response = new NodeWrapper(service.Post(service.MerchantPath() + "/transactions/advanced_search", query)); - var transactions = new List(); - foreach (var node in response.GetList("transaction")) + if (response.GetName() == "credit-card-transactions") { - transactions.Add(new Transaction(node, gateway)); + var transactions = new List(); + foreach (var node in response.GetList("transaction")) + { + transactions.Add(new Transaction(node, gateway)); + } + return transactions; + } + else + { + throw new DownForMaintenanceException(); } - return transactions; } } } diff --git a/src/Braintree/UsBankAccount.cs b/src/Braintree/UsBankAccount.cs index 3e6bccf7..dd3d7eec 100644 --- a/src/Braintree/UsBankAccount.cs +++ b/src/Braintree/UsBankAccount.cs @@ -7,12 +7,12 @@ public class UsBankAccount : PaymentMethod public virtual string RoutingNumber { get; protected set; } public virtual string Last4 { get; protected set; } public virtual string AccountType { get; protected set; } - public virtual string AccountDescription { get; protected set; } public virtual string AccountHolderName { get; protected set; } public virtual string Token { get; protected set; } public virtual string ImageUrl { get; protected set; } public virtual string BankName { get; protected set; } public virtual string CustomerId { get; protected set; } + public virtual AchMandate AchMandate { get; protected set; } public virtual bool? IsDefault { get; protected set; } protected internal UsBankAccount(NodeWrapper node) @@ -20,12 +20,12 @@ protected internal UsBankAccount(NodeWrapper node) RoutingNumber = node.GetString("routing-number"); Last4 = node.GetString("last-4"); AccountType = node.GetString("account-type"); - AccountDescription = node.GetString("account-description"); AccountHolderName = node.GetString("account-holder-name"); Token = node.GetString("token"); ImageUrl = node.GetString("image-url"); BankName = node.GetString("bank-name"); CustomerId = node.GetString("customer-id"); + AchMandate = new AchMandate(node.GetNode("ach-mandate")); IsDefault = node.GetBoolean("default"); } diff --git a/src/Braintree/UsBankAccountDetails.cs b/src/Braintree/UsBankAccountDetails.cs index b55d8210..35f9d0df 100644 --- a/src/Braintree/UsBankAccountDetails.cs +++ b/src/Braintree/UsBankAccountDetails.cs @@ -5,22 +5,22 @@ public class UsBankAccountDetails public virtual string RoutingNumber { get; protected set; } public virtual string Last4 { get; protected set; } public virtual string AccountType { get; protected set; } - public virtual string AccountDescription { get; protected set; } public virtual string AccountHolderName { get; protected set; } public virtual string Token { get; protected set; } public virtual string ImageUrl { get; protected set; } public virtual string BankName { get; protected set; } + public virtual AchMandate AchMandate { get; protected set; } protected internal UsBankAccountDetails(NodeWrapper node) { RoutingNumber = node.GetString("routing-number"); Last4 = node.GetString("last-4"); AccountType = node.GetString("account-type"); - AccountDescription = node.GetString("account-description"); AccountHolderName = node.GetString("account-holder-name"); Token = node.GetString("token"); ImageUrl = node.GetString("image-url"); BankName = node.GetString("bank-name"); + AchMandate = new AchMandate(node.GetNode("ach-mandate")); } } } diff --git a/src/Braintree/project.json b/src/Braintree/project.json index 175eb4a4..b814c9b0 100644 --- a/src/Braintree/project.json +++ b/src/Braintree/project.json @@ -6,11 +6,12 @@ "dependencies": { }, "buildOptions": { }, - "version": "3.4.0-*", + "version": "3.5.0-*", "packOptions": { "releaseNotes": " -* Add payer_status accessor to paypal_details object -* Add option `skip_advanced_fraud_check` for transaction flows +* Stop sending account_description field from us bank accounts +* Add multi-currency support for OAuth Onboarded Merchants +* Add functionality to list all merchant accounts for a merchant with `MerchantAccount.all` ", "summary": " The Braintree .NET Client Library will allow you to take payments securely for diff --git a/test/Braintree.TestUtil/TestHelper.cs b/test/Braintree.TestUtil/TestHelper.cs index 78674d5b..23ee9ce9 100644 --- a/test/Braintree.TestUtil/TestHelper.cs +++ b/test/Braintree.TestUtil/TestHelper.cs @@ -56,7 +56,7 @@ public static string GenerateValidUsBankAccountNonce(BraintreeGateway gateway) ""account_holder_name"": ""Dan Schulman"", ""account_description"": ""PayPal Checking - 1234"", ""ach_mandate"": { - ""text"": """" + ""text"": ""cl mandate text"" } }"; diff --git a/test/Braintree.Tests.Integration/CustomerIntegrationTest.cs b/test/Braintree.Tests.Integration/CustomerIntegrationTest.cs index a88fa351..30867908 100644 --- a/test/Braintree.Tests.Integration/CustomerIntegrationTest.cs +++ b/test/Braintree.Tests.Integration/CustomerIntegrationTest.cs @@ -134,7 +134,6 @@ public void Find_IncludesUsBankAccountInPaymentMethods() Assert.AreEqual("1234", usBankAccount.Last4); Assert.AreEqual("checking", usBankAccount.AccountType); Assert.AreEqual("Dan Schulman", usBankAccount.AccountHolderName); - Assert.AreEqual("PayPal Checking - 1234", usBankAccount.AccountDescription); Assert.IsTrue(Regex.IsMatch(usBankAccount.BankName, ".*CHASE.*")); } @@ -617,7 +616,6 @@ public void Create_WithUsBankAccountPaymentMethodNonce() Assert.AreEqual("1234", usBankAccount.Last4); Assert.AreEqual("checking", usBankAccount.AccountType); Assert.AreEqual("Dan Schulman", usBankAccount.AccountHolderName); - Assert.AreEqual("PayPal Checking - 1234", usBankAccount.AccountDescription); Assert.IsTrue(Regex.IsMatch(usBankAccount.BankName, ".*CHASE.*")); } diff --git a/test/Braintree.Tests.Integration/MerchantAccountIntegrationTest.cs b/test/Braintree.Tests.Integration/MerchantAccountIntegrationTest.cs index 7712c531..3bb1932a 100644 --- a/test/Braintree.Tests.Integration/MerchantAccountIntegrationTest.cs +++ b/test/Braintree.Tests.Integration/MerchantAccountIntegrationTest.cs @@ -1,3 +1,4 @@ +using Braintree.TestUtil; using NUnit.Framework; using System; using System.Collections.Generic; @@ -434,6 +435,64 @@ public void CreateForCurrency_HandlesExistingMerchantAccountForId() Assert.AreEqual(ValidationErrorCode.MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_ID, errors[0].Code); } + [Test] + public void All_ReturnsAllMerchantAccounts() + { + gateway = new BraintreeGateway( + "client_id$development$integration_client_id", + "client_secret$development$integration_client_secret" + ); + + var code = OAuthTestHelper.CreateGrant(gateway, "integration_merchant_id", "read_write"); + ResultImpl accessTokenResult = gateway.OAuth.CreateTokenFromCode(new OAuthCredentialsRequest + { + Code = code, + Scope = "read_write" + }); + + BraintreeGateway OAuthGateway = new BraintreeGateway(accessTokenResult.Target.AccessToken); + + var merchantAccountResults = OAuthGateway.MerchantAccount.All(); + + var merchantAccounts = new List(); + foreach (var merchantAccount in merchantAccountResults) + { + merchantAccounts.Add(merchantAccount); + } + Assert.IsTrue(merchantAccounts.Count > 20); + } + + [Test] + public void All_ReturnsMerchantAccountWithCorrectAttributes() + { + gateway = new BraintreeGateway( + "client_id$development$integration_client_id", + "client_secret$development$integration_client_secret" + ); + + ResultImpl result = gateway.Merchant.Create(new MerchantRequest { + Email = "name@email.com", + CountryCodeAlpha3 = "USA", + PaymentMethods = new string[] {"credit_card", "paypal"}, + Scope = "read_write,shared_vault_transactions", + }); + + BraintreeGateway OAuthGateway = new BraintreeGateway(result.Target.Credentials.AccessToken); + + PaginatedCollection merchantAccountResults = OAuthGateway.MerchantAccount.All(); + var merchantAccounts = new List(); + foreach (var ma in merchantAccountResults) + { + merchantAccounts.Add(ma); + } + Assert.AreEqual(1, merchantAccounts.Count); + + MerchantAccount merchantAccount = merchantAccounts[0]; + Assert.AreEqual("USD", merchantAccount.CurrencyIsoCode); + Assert.AreEqual(MerchantAccountStatus.ACTIVE, merchantAccount.Status); + Assert.IsTrue(merchantAccount.IsDefault); + } + private MerchantAccountRequest deprecatedCreateRequest(string id) { return new MerchantAccountRequest diff --git a/test/Braintree.Tests.Integration/PaymentMethodIntegrationTest.cs b/test/Braintree.Tests.Integration/PaymentMethodIntegrationTest.cs index 27d9ccb4..520ef2b2 100644 --- a/test/Braintree.Tests.Integration/PaymentMethodIntegrationTest.cs +++ b/test/Braintree.Tests.Integration/PaymentMethodIntegrationTest.cs @@ -313,7 +313,6 @@ public void Create_CreatesUsBankAccountWithNonce() Assert.AreEqual("1234", usBankAccount.Last4); Assert.AreEqual("checking", usBankAccount.AccountType); Assert.AreEqual("Dan Schulman", usBankAccount.AccountHolderName); - Assert.AreEqual("PayPal Checking - 1234", usBankAccount.AccountDescription); Assert.IsTrue(Regex.IsMatch(usBankAccount.BankName, ".*CHASE.*")); var found = gateway.PaymentMethod.Find(usBankAccount.Token); Assert.IsInstanceOf(typeof(UsBankAccount), found); diff --git a/test/Braintree.Tests.Integration/TransactionIntegrationTest.cs b/test/Braintree.Tests.Integration/TransactionIntegrationTest.cs index da0f8075..595833a1 100644 --- a/test/Braintree.Tests.Integration/TransactionIntegrationTest.cs +++ b/test/Braintree.Tests.Integration/TransactionIntegrationTest.cs @@ -1197,9 +1197,11 @@ public void Sale_ReturnsSuccessfulResponseWithUsBankAccount() Assert.AreEqual("021000021", usBankAccountDetails.RoutingNumber); Assert.AreEqual("1234", usBankAccountDetails.Last4); Assert.AreEqual("checking", usBankAccountDetails.AccountType); - Assert.AreEqual("PayPal Checking - 1234", usBankAccountDetails.AccountDescription); Assert.AreEqual("Dan Schulman", usBankAccountDetails.AccountHolderName); Assert.IsTrue(Regex.IsMatch(usBankAccountDetails.BankName, ".*CHASE.*")); + AchMandate achMandate = usBankAccountDetails.AchMandate; + Assert.AreEqual("cl mandate text", achMandate.Text); + Assert.AreEqual("DateTime", achMandate.AcceptedAt.GetType().Name); } [Test] @@ -1231,9 +1233,11 @@ public void Sale_ReturnsSuccessfulResponseWithUsBankAccountAndVaultedToken() Assert.AreEqual("021000021", usBankAccountDetails.RoutingNumber); Assert.AreEqual("1234", usBankAccountDetails.Last4); Assert.AreEqual("checking", usBankAccountDetails.AccountType); - Assert.AreEqual("PayPal Checking - 1234", usBankAccountDetails.AccountDescription); Assert.AreEqual("Dan Schulman", usBankAccountDetails.AccountHolderName); Assert.IsTrue(Regex.IsMatch(usBankAccountDetails.BankName, ".*CHASE.*")); + AchMandate achMandate = usBankAccountDetails.AchMandate; + Assert.AreEqual("cl mandate text", achMandate.Text); + Assert.AreEqual("DateTime", achMandate.AcceptedAt.GetType().Name); request = new TransactionRequest { @@ -1260,9 +1264,11 @@ public void Sale_ReturnsSuccessfulResponseWithUsBankAccountAndVaultedToken() Assert.AreEqual("021000021", usBankAccountDetails.RoutingNumber); Assert.AreEqual("1234", usBankAccountDetails.Last4); Assert.AreEqual("checking", usBankAccountDetails.AccountType); - Assert.AreEqual("PayPal Checking - 1234", usBankAccountDetails.AccountDescription); Assert.AreEqual("Dan Schulman", usBankAccountDetails.AccountHolderName); Assert.IsTrue(Regex.IsMatch(usBankAccountDetails.BankName, ".*CHASE.*")); + achMandate = usBankAccountDetails.AchMandate; + Assert.AreEqual("cl mandate text", achMandate.Text); + Assert.AreEqual("DateTime", achMandate.AcceptedAt.GetType().Name); } [Test] @@ -2516,7 +2522,6 @@ public void Sale_WithUsBankAccountNonce() Assert.AreEqual("1234", usBankAccountDetails.Last4); Assert.AreEqual("checking", usBankAccountDetails.AccountType); Assert.AreEqual("Dan Schulman", usBankAccountDetails.AccountHolderName); - Assert.AreEqual("PayPal Checking - 1234", usBankAccountDetails.AccountDescription); Assert.IsTrue(Regex.IsMatch(usBankAccountDetails.BankName, ".*CHASE.*")); } diff --git a/test/Braintree.Tests.Integration/TransparentRedirectRequestIntegrationTest.cs b/test/Braintree.Tests.Integration/TransparentRedirectRequestIntegrationTest.cs index 69c3362f..584fa9d2 100644 --- a/test/Braintree.Tests.Integration/TransparentRedirectRequestIntegrationTest.cs +++ b/test/Braintree.Tests.Integration/TransparentRedirectRequestIntegrationTest.cs @@ -33,7 +33,7 @@ public void Constructor_RaisesDownForMaintenanceExceptionIfDownForMaintenance() PublicKey = "integration_public_key", PrivateKey = "integration_private_key" }; - BraintreeService service = new BraintreeService(gateway.Configuration); + service = new BraintreeService(gateway.Configuration); Exception exception = null; @@ -68,7 +68,7 @@ public void Constructor_AuthenticationExceptionIfBadCredentials() PublicKey = "integration_public_key", PrivateKey = "bad_key" }; - BraintreeService service = new BraintreeService(gateway.Configuration); + service = new BraintreeService(gateway.Configuration); Exception exception = null; try { diff --git a/test/Braintree.Tests.Integration/UsBankIntegrationTest.cs b/test/Braintree.Tests.Integration/UsBankIntegrationTest.cs index 6015f1cd..a0c435fc 100644 --- a/test/Braintree.Tests.Integration/UsBankIntegrationTest.cs +++ b/test/Braintree.Tests.Integration/UsBankIntegrationTest.cs @@ -50,9 +50,12 @@ public void Find_FindsUsBankAccountWithToken() Assert.AreEqual("021000021", usBankAccount.RoutingNumber); Assert.AreEqual("1234", usBankAccount.Last4); Assert.AreEqual("checking", usBankAccount.AccountType); - Assert.AreEqual("PayPal Checking - 1234", usBankAccount.AccountDescription); Assert.AreEqual("Dan Schulman", usBankAccount.AccountHolderName); Assert.IsTrue(Regex.IsMatch(usBankAccount.BankName, ".*CHASE.*")); + AchMandate achMandate = usBankAccount.AchMandate; + Assert.AreEqual("cl mandate text", achMandate.Text); + Assert.AreEqual("DateTime", achMandate.AcceptedAt.GetType().Name); + Assert.IsTrue(usBankAccount.IsDefault); } [Test] @@ -98,8 +101,10 @@ public void Sale_TransactUsBankAccountWithToken() Assert.AreEqual(usBankAccount.RoutingNumber, usBankAccountDetails.RoutingNumber); Assert.AreEqual(usBankAccount.Last4, usBankAccountDetails.Last4); Assert.AreEqual(usBankAccount.AccountType, usBankAccountDetails.AccountType); - Assert.AreEqual(usBankAccount.AccountDescription, usBankAccountDetails.AccountDescription); Assert.AreEqual(usBankAccount.AccountHolderName, usBankAccountDetails.AccountHolderName); + AchMandate achMandate = usBankAccountDetails.AchMandate; + Assert.AreEqual(usBankAccount.AchMandate.Text, achMandate.Text); + Assert.AreEqual("DateTime", achMandate.AcceptedAt.GetType().Name); } } diff --git a/test/Braintree.Tests/CustomerTest.cs b/test/Braintree.Tests/CustomerTest.cs index ee7f26fe..eb9bdea4 100644 --- a/test/Braintree.Tests/CustomerTest.cs +++ b/test/Braintree.Tests/CustomerTest.cs @@ -7,7 +7,6 @@ namespace Braintree.Tests public class CustomerTest { private BraintreeGateway gateway; - private BraintreeService service; [SetUp] public void Setup() @@ -19,7 +18,6 @@ public void Setup() PublicKey = "integration_public_key", PrivateKey = "integration_private_key" }; - service = new BraintreeService(gateway.Configuration); } [Test] diff --git a/test/Braintree.Tests/TestTransactionTest.cs b/test/Braintree.Tests/TestTransactionTest.cs index 88fb5466..dcae47e7 100644 --- a/test/Braintree.Tests/TestTransactionTest.cs +++ b/test/Braintree.Tests/TestTransactionTest.cs @@ -5,20 +5,6 @@ namespace Braintree.Tests [TestFixture()] public class TestTransactionTest { - private BraintreeGateway gateway; - - [SetUp()] - public void Setup() - { - gateway = new BraintreeGateway - { - Environment = Environment.DEVELOPMENT, - MerchantId = "integration_merchant_id", - PublicKey = "integration_public_key", - PrivateKey = "integration_private_key" - }; - } - [Test] public void FailsInProduction() { diff --git a/test/Braintree.Tests/WebhookNotificationTest.cs b/test/Braintree.Tests/WebhookNotificationTest.cs index a190028d..a357d0ef 100644 --- a/test/Braintree.Tests/WebhookNotificationTest.cs +++ b/test/Braintree.Tests/WebhookNotificationTest.cs @@ -147,7 +147,6 @@ public void SampleNotification_ReturnsANotificationForATransactionSettledWebHook Assert.AreEqual("123456789", usBankAccountDetails.RoutingNumber); Assert.AreEqual("1234", usBankAccountDetails.Last4); Assert.AreEqual("checking", usBankAccountDetails.AccountType); - Assert.AreEqual("PayPal Checking - 1234", usBankAccountDetails.AccountDescription); Assert.AreEqual("Dan Schulman", usBankAccountDetails.AccountHolderName); } @@ -168,7 +167,6 @@ public void SampleNotification_ReturnsANotificationForATransactionSettlementDecl Assert.AreEqual("123456789", usBankAccountDetails.RoutingNumber); Assert.AreEqual("1234", usBankAccountDetails.Last4); Assert.AreEqual("checking", usBankAccountDetails.AccountType); - Assert.AreEqual("PayPal Checking - 1234", usBankAccountDetails.AccountDescription); Assert.AreEqual("Dan Schulman", usBankAccountDetails.AccountHolderName); }