Skip to content
Browse files

2.4.0

  • Loading branch information...
1 parent b927284 commit c007571e89b22b7826e81413ea9914384f15596e @braintreeps braintreeps committed Jun 24, 2010
View
1 Braintree.Tests/Braintree.Tests.csproj
@@ -75,6 +75,7 @@
<Compile Include="RequestTest.cs" />
<Compile Include="ResourceCollectionTest.cs" />
<Compile Include="MultipleValueNodeTest.cs" />
+ <Compile Include="TransparentRedirectTest.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Braintree\Braintree.csproj">
View
66 Braintree.Tests/CreditCardTest.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using NUnit.Framework;
using Braintree;
using Braintree.Exceptions;
@@ -66,7 +67,7 @@ public void Create_CreatesCreditCardForGivenCustomerId()
Assert.AreEqual("05", creditCard.ExpirationMonth);
Assert.AreEqual("2012", creditCard.ExpirationYear);
Assert.AreEqual("Michael Angelo", creditCard.CardholderName);
- Assert.IsTrue(creditCard.Default.Value);
+ Assert.IsTrue(creditCard.IsDefault.Value);
Assert.AreEqual(DateTime.Now.Year, creditCard.CreatedAt.Value.Year);
Assert.AreEqual(DateTime.Now.Year, creditCard.UpdatedAt.Value.Year);
}
@@ -111,7 +112,7 @@ public void ConfirmTransparentRedirectCreate_CreatesTheCreditCardObservingMakeDe
};
CreditCard creditCard = gateway.CreditCard.Create(request).Target;
- Assert.IsTrue(creditCard.Default.Value);
+ Assert.IsTrue(creditCard.IsDefault.Value);
CreditCardRequest trParams = new CreditCardRequest
{
@@ -125,7 +126,7 @@ public void ConfirmTransparentRedirectCreate_CreatesTheCreditCardObservingMakeDe
String queryString = TestHelper.QueryStringForTR(trParams, request, gateway.CreditCard.TransparentRedirectURLForCreate());
CreditCard card = gateway.CreditCard.ConfirmTransparentRedirect(queryString).Target;
- Assert.IsTrue(card.Default.Value);
+ Assert.IsTrue(card.IsDefault.Value);
}
[Test]
@@ -145,7 +146,7 @@ public void ConfirmTransparentRedirectCreate_CreatesTheCreditCardObservingMakeDe
};
CreditCard creditCard = gateway.CreditCard.Create(request).Target;
- Assert.IsTrue(creditCard.Default.Value);
+ Assert.IsTrue(creditCard.IsDefault.Value);
CreditCardRequest trParams = new CreditCardRequest
{
@@ -155,7 +156,7 @@ public void ConfirmTransparentRedirectCreate_CreatesTheCreditCardObservingMakeDe
String queryString = TestHelper.QueryStringForTR(trParams, request, gateway.CreditCard.TransparentRedirectURLForCreate());
CreditCard card = gateway.CreditCard.ConfirmTransparentRedirect(queryString).Target;
- Assert.IsTrue(card.Default.Value);
+ Assert.IsTrue(card.IsDefault.Value);
}
[Test]
@@ -281,8 +282,8 @@ public void Create_SetsDefaultIfSpecified()
CreditCard card1 = gateway.CreditCard.Create(request1).Target;
CreditCard card2 = gateway.CreditCard.Create(request2).Target;
- Assert.IsFalse(gateway.CreditCard.Find(card1.Token).Default.Value);
- Assert.IsTrue(gateway.CreditCard.Find(card2.Token).Default.Value);
+ Assert.IsFalse(gateway.CreditCard.Find(card1.Token).IsDefault.Value);
+ Assert.IsTrue(gateway.CreditCard.Find(card2.Token).IsDefault.Value);
}
[Test]
@@ -302,8 +303,8 @@ public void Update_UpdatesDefaultIfSpecified()
CreditCard card1 = gateway.CreditCard.Create(creditCardCreateRequest).Target;
CreditCard card2 = gateway.CreditCard.Create(creditCardCreateRequest).Target;
- Assert.IsTrue(card1.Default.Value);
- Assert.IsFalse(card2.Default.Value);
+ Assert.IsTrue(card1.IsDefault.Value);
+ Assert.IsFalse(card2.IsDefault.Value);
var creditCardUpdateRequest = new CreditCardRequest
@@ -316,8 +317,8 @@ public void Update_UpdatesDefaultIfSpecified()
gateway.CreditCard.Update(card2.Token, creditCardUpdateRequest);
- Assert.IsFalse(gateway.CreditCard.Find(card1.Token).Default.Value);
- Assert.IsTrue(gateway.CreditCard.Find(card2.Token).Default.Value);
+ Assert.IsFalse(gateway.CreditCard.Find(card1.Token).IsDefault.Value);
+ Assert.IsTrue(gateway.CreditCard.Find(card2.Token).IsDefault.Value);
}
[Test]
@@ -502,7 +503,7 @@ public void Delete_DeletesTheCreditCard()
}
[Test]
- public void verifyValidCreditCard()
+ public void VerifyValidCreditCard()
{
Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
CreditCardRequest request = new CreditCardRequest
@@ -523,7 +524,7 @@ public void verifyValidCreditCard()
}
[Test]
- public void verifyValidCreditCardSpecifyingMerhantAccount()
+ public void VerifyValidCreditCardSpecifyingMerhantAccount()
{
Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
CreditCardRequest request = new CreditCardRequest
@@ -546,7 +547,7 @@ public void verifyValidCreditCardSpecifyingMerhantAccount()
}
[Test]
- public void verifyInvalidCreditCard()
+ public void VerifyInvalidCreditCard()
{
Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
CreditCardRequest request = new CreditCardRequest
@@ -567,5 +568,42 @@ public void verifyInvalidCreditCard()
CreditCardVerification verification = result.CreditCardVerification;
Assert.AreEqual("processor_declined", verification.Status);
}
+
+ [Test]
+ public void Expired()
+ {
+ ResourceCollection<CreditCard> collection = gateway.CreditCard.Expired();
+
+ Assert.IsTrue(collection.MaximumCount > 1);
+
+ List<String> cards = new List<String>();
+ foreach (CreditCard card in collection) {
+ Assert.IsTrue(card.IsExpired.Value);
+ cards.Add(card.Token);
+ }
+
+ HashSet<String> uniqueCards = new HashSet<String>(cards);
+ Assert.AreEqual(uniqueCards.Count, collection.MaximumCount);
+ }
+
+ [Test]
+ public void ExpiringBetween()
+ {
+ DateTime beginning = new DateTime(2010, 1, 1);
+ DateTime end = new DateTime(2010, 12, 31);
+
+ ResourceCollection<CreditCard> collection = gateway.CreditCard.ExpiringBetween(beginning, end);
+
+ Assert.IsTrue(collection.MaximumCount > 1);
+
+ List<String> cards = new List<String>();
+ foreach (CreditCard card in collection) {
+ Assert.AreEqual("2010", card.ExpirationYear);
+ cards.Add(card.Token);
+ }
+
+ HashSet<String> uniqueCards = new HashSet<String>(cards);
+ Assert.AreEqual(uniqueCards.Count, collection.MaximumCount);
+ }
}
}
View
4 Braintree.Tests/CryptoTest.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
@@ -10,7 +10,7 @@ namespace Braintree.Tests
public class CryptoTest
{
[Test]
- public void hmacHash_ReturnsCorrectHash()
+ public void HmacHash_ReturnsCorrectHash()
{
String actual = new Crypto().HmacHash("secretKey", "hello world");
Assert.AreEqual("D503D7A1A6ADBA1E6474E9FF2C4167F9DFDF4247", actual);
View
113 Braintree.Tests/CustomerTest.cs
@@ -326,6 +326,62 @@ public void ConfirmTransparentRedirect_UpdatesTheCustomer()
}
[Test]
+ public void Update_UpdatesCustomerAndNestedValuesViaTr()
+ {
+ var createRequest = new CustomerRequest()
+ {
+ FirstName = "Old First",
+ LastName = "Old Last",
+ CreditCard = new CreditCardRequest()
+ {
+ Number = "4111111111111111",
+ ExpirationDate = "10/10",
+ BillingAddress = new CreditCardAddressRequest()
+ {
+ PostalCode = "11111"
+ }
+ }
+ };
+
+ Customer customer = gateway.Customer.Create(createRequest).Target;
+ CreditCard creditCard = customer.CreditCards[0];
+ Address address = creditCard.BillingAddress;
+
+ var trParams = new CustomerRequest()
+ {
+ CustomerId = customer.Id,
+ FirstName = "New First",
+ LastName = "New Last",
+ CreditCard = new CreditCardRequest()
+ {
+ ExpirationDate = "12/12",
+ Options = new CreditCardOptionsRequest()
+ {
+ UpdateExistingToken = creditCard.Token
+ },
+ BillingAddress = new CreditCardAddressRequest()
+ {
+ PostalCode = "44444",
+ Options = new CreditCardAddressOptionsRequest()
+ {
+ UpdateExisting = true
+ }
+ }
+ }
+ };
+
+ String queryString = TestHelper.QueryStringForTR(trParams, new CustomerRequest(), gateway.Customer.TransparentRedirectURLForUpdate());
+ Customer updatedCustomer = gateway.Customer.ConfirmTransparentRedirect(queryString).Target;
+ CreditCard updatedCreditCard = gateway.CreditCard.Find(creditCard.Token);
+ Address updatedAddress = gateway.Address.Find(customer.Id, address.Id);
+
+ Assert.AreEqual("New First", updatedCustomer.FirstName);
+ Assert.AreEqual("New Last", updatedCustomer.LastName);
+ Assert.AreEqual("12/2012", updatedCreditCard.ExpirationDate);
+ Assert.AreEqual("44444", updatedAddress.PostalCode);
+ }
+
+ [Test]
public void Update_UpdatesCustomerWithNewValues()
{
string oldId = Guid.NewGuid().ToString();
@@ -370,6 +426,60 @@ public void Update_UpdatesCustomerWithNewValues()
}
[Test]
+ public void Update_UpdatesCustomerAndNestedValues()
+ {
+ var createRequest = new CustomerRequest()
+ {
+ FirstName = "Old First",
+ LastName = "Old Last",
+ CreditCard = new CreditCardRequest()
+ {
+ Number = "4111111111111111",
+ ExpirationDate = "10/10",
+ BillingAddress = new CreditCardAddressRequest()
+ {
+ PostalCode = "11111"
+ }
+ }
+ };
+
+ Customer customer = gateway.Customer.Create(createRequest).Target;
+ CreditCard creditCard = customer.CreditCards[0];
+ Address address = creditCard.BillingAddress;
+
+ var updateRequest = new CustomerRequest()
+ {
+ FirstName = "New First",
+ LastName = "New Last",
+ CreditCard = new CreditCardRequest()
+ {
+ ExpirationDate = "12/12",
+ Options = new CreditCardOptionsRequest()
+ {
+ UpdateExistingToken = creditCard.Token
+ },
+ BillingAddress = new CreditCardAddressRequest()
+ {
+ PostalCode = "44444",
+ Options = new CreditCardAddressOptionsRequest()
+ {
+ UpdateExisting = true
+ }
+ }
+ }
+ };
+
+ Customer updatedCustomer = gateway.Customer.Update(customer.Id, updateRequest).Target;
+ CreditCard updatedCreditCard = gateway.CreditCard.Find(creditCard.Token);
+ Address updatedAddress = gateway.Address.Find(customer.Id, address.Id);
+
+ Assert.AreEqual("New First", updatedCustomer.FirstName);
+ Assert.AreEqual("New Last", updatedCustomer.LastName);
+ Assert.AreEqual("12/2012", updatedCreditCard.ExpirationDate);
+ Assert.AreEqual("44444", updatedAddress.PostalCode);
+ }
+
+ [Test]
public void Delete_DeletesTheCustomer()
{
String id = Guid.NewGuid().ToString();
@@ -398,8 +508,9 @@ public void Delete_DeletesTheCustomer()
foreach (Customer item in collection) {
items.Add(item.Id);
}
+ HashSet<String> uniqueItems = new HashSet<String>(items);
- Assert.AreEqual(items.Count, collection.MaximumCount);
+ Assert.AreEqual(uniqueItems.Count, collection.MaximumCount);
}
}
}
View
54 Braintree.Tests/SubscriptionTest.cs
@@ -536,6 +536,34 @@ public void UpdatePlan()
}
[Test]
+ public void Update_PaymentMethodToken()
+ {
+ Subscription subscription = gateway.Subscription.Create(new SubscriptionRequest
+ {
+ PaymentMethodToken = creditCard.Token,
+ PlanId = Plan.PLAN_WITHOUT_TRIAL.Id,
+ }).Target;
+
+ CreditCard newCreditCard = gateway.CreditCard.Create(new CreditCardRequest
+ {
+ CustomerId = creditCard.CustomerId,
+ Number = "5105105105105100",
+ ExpirationDate = "05/12",
+ CVV = "123",
+ CardholderName = creditCard.CardholderName
+
+ }).Target;
+
+ SubscriptionRequest updateRequest = new SubscriptionRequest { PaymentMethodToken = newCreditCard.Token };
+ Result<Subscription> result = gateway.Subscription.Update(subscription.Id, updateRequest);
+
+ Assert.IsTrue(result.IsSuccess());
+ subscription = result.Target;
+
+ Assert.AreEqual(newCreditCard.Token, subscription.PaymentMethodToken);
+ }
+
+ [Test]
public void UpdateMerchantAccountId()
{
Plan originalPlan = Plan.PLAN_WITHOUT_TRIAL;
@@ -613,15 +641,10 @@ public void Create_WithBadPlanId()
PlanId = "noSuchPlanId"
};
- try
- {
- gateway.Subscription.Create(createRequest);
- Assert.Fail("Expected NotFoundException.");
- }
- catch (NotFoundException)
- {
- // expected
- }
+ Result<Subscription> result = gateway.Subscription.Create(createRequest);
+
+ Assert.IsFalse(result.IsSuccess());
+ Assert.AreEqual(ValidationErrorCode.SUBSCRIPTION_PLAN_ID_IS_INVALID, result.Errors.ForObject("subscription").OnField("plan_id")[0].Code);
}
[Test]
@@ -633,15 +656,10 @@ public void Create_WithBadPaymentMethod()
PlanId = Plan.PLAN_WITHOUT_TRIAL.Id
};
- try
- {
- gateway.Subscription.Create(createRequest);
- Assert.Fail("Expected NotFoundException.");
- }
- catch (NotFoundException)
- {
- // expected
- }
+ Result<Subscription> result = gateway.Subscription.Create(createRequest);
+
+ Assert.IsFalse(result.IsSuccess());
+ Assert.AreEqual(ValidationErrorCode.SUBSCRIPTION_PAYMENT_METHOD_TOKEN_IS_INVALID, result.Errors.ForObject("subscription").OnField("payment_method_token")[0].Code);
}
[Test]
View
7 Braintree.Tests/TrUtilTest.cs
@@ -27,6 +27,13 @@ public void IncludesApiVersion()
}
[Test]
+ public void IncludesKind()
+ {
+ String tr_data = TrUtil.BuildTrData(new TransactionRequest(), "example.com");
+ TestHelper.AssertIncludes("kind=create_transaction", tr_data);
+ }
+
+ [Test]
public void IsValidTrQueryString_ForValidString()
{
String queryString = "http_status=200&id=6kdj469tw7yck32j&hash=99c9ff20cd7910a1c1e793ff9e3b2d15586dc6b9";
View
32 Braintree.Tests/TransactionTest.cs
@@ -1415,6 +1415,27 @@ public void SubmitForSettlement_WithAmount()
}
[Test]
+ public void StatusHistory_HasCorrectValues()
+ {
+ TransactionRequest request = new TransactionRequest
+ {
+ Amount = SandboxValues.TransactionAmount.AUTHORIZE,
+ CreditCard = new CreditCardRequest
+ {
+ Number = SandboxValues.CreditCardNumber.VISA,
+ ExpirationDate = "05/2008"
+ }
+ };
+
+ String transactionId = gateway.Transaction.Sale(request).Target.Id;
+ Transaction transaction = gateway.Transaction.SubmitForSettlement(transactionId, Decimal.Parse("50.00")).Target;
+
+ Assert.AreEqual(2, transaction.StatusHistory.Length);
+ Assert.AreEqual(TransactionStatus.AUTHORIZED, transaction.StatusHistory[0].Status);
+ Assert.AreEqual(TransactionStatus.SUBMITTED_FOR_SETTLEMENT, transaction.StatusHistory[1].Status);
+ }
+
+ [Test]
public void SubmitForSettlement_WithValidationError()
{
TransactionRequest request = new TransactionRequest
@@ -1480,9 +1501,16 @@ public void Refund_WithABasicTransaction()
System.Console.WriteLine("Got exception! " + e.Source);
throw e;
}
+
Assert.IsTrue(result.IsSuccess());
- Assert.AreEqual(TransactionType.CREDIT, result.Target.Type);
- Assert.AreEqual(transaction.Amount, result.Target.Amount);
+ var refund = result.Target;
+
+ Assert.AreEqual(TransactionType.CREDIT, refund.Type);
+ Assert.AreEqual(transaction.Amount, refund.Amount);
+
+ Transaction firstTransaction = gateway.Transaction.Find(transaction.Id);
+ Assert.AreEqual(refund.Id, firstTransaction.RefundId);
+ Assert.AreEqual(firstTransaction.Id, refund.RefundedTransactionId);
}
[Test]
View
1 Braintree.Tests/TransparentRedirectRequestTest.cs
@@ -148,5 +148,6 @@ public void Constructor_AuthenticationExceptionIfBadCredentials()
// expected
}
}
+
}
}
View
192 Braintree.Tests/TransparentRedirectTest.cs
@@ -0,0 +1,192 @@
+using System;
+using NUnit.Framework;
+using Braintree;
+
+namespace Braintree.Tests
+{
+ [TestFixture]
+ public class TransparentRedirectTest
+ {
+ 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 Url_ReturnsCorrectUrl()
+ {
+ var host = System.Environment.GetEnvironmentVariable("GATEWAY_HOST") ?? "localhost";
+ var port = System.Environment.GetEnvironmentVariable("GATEWAY_PORT") ?? "3000";
+
+ var url = "http://" + host + ":" + port + "/merchants/integration_merchant_id/transparent_redirect_requests";
+ Assert.AreEqual(url, gateway.TransparentRedirect.Url);
+ }
+
+ [Test]
+ public void CreateTransactionFromTransparentRedirect()
+ {
+ TransactionRequest trParams = new TransactionRequest
+ {
+ Type = TransactionType.SALE
+ };
+
+ TransactionRequest request = new TransactionRequest
+ {
+ Amount = SandboxValues.TransactionAmount.AUTHORIZE,
+ CreditCard = new CreditCardRequest
+ {
+ Number = SandboxValues.CreditCardNumber.VISA,
+ ExpirationDate = "05/2009",
+ }
+ };
+
+ String queryString = TestHelper.QueryStringForTR(trParams, request, gateway.TransparentRedirect.Url);
+ Result<Transaction> result = gateway.TransparentRedirect.ConfirmTransaction(queryString);
+ Assert.IsTrue(result.IsSuccess());
+ Transaction transaction = result.Target;
+
+ Assert.AreEqual(1000.00, transaction.Amount);
+ Assert.AreEqual(TransactionType.SALE, transaction.Type);
+ Assert.AreEqual(TransactionStatus.AUTHORIZED, transaction.Status);
+ Assert.AreEqual(DateTime.Now.Year, transaction.CreatedAt.Value.Year);
+ Assert.AreEqual(DateTime.Now.Year, transaction.UpdatedAt.Value.Year);
+
+ CreditCard creditCard = transaction.CreditCard;
+ Assert.AreEqual("411111", creditCard.Bin);
+ Assert.AreEqual("1111", creditCard.LastFour);
+ Assert.AreEqual("05", creditCard.ExpirationMonth);
+ Assert.AreEqual("2009", creditCard.ExpirationYear);
+ Assert.AreEqual("05/2009", creditCard.ExpirationDate);
+
+ }
+
+ [Test]
+ public void CreateCustomerFromTransparentRedirect()
+ {
+ CustomerRequest trParams = new CustomerRequest
+ {
+ FirstName = "John"
+ };
+
+ CustomerRequest request = new CustomerRequest
+ {
+ LastName = "Doe"
+ };
+
+ String queryString = TestHelper.QueryStringForTR(trParams, request, gateway.TransparentRedirect.Url);
+ Result<Customer> result = gateway.TransparentRedirect.ConfirmCustomer(queryString);
+ Assert.IsTrue(result.IsSuccess());
+ Customer customer = result.Target;
+
+ Assert.AreEqual("John", customer.FirstName);
+ Assert.AreEqual("Doe", customer.LastName);
+ }
+
+ [Test]
+ public void UpdateCustomerFromTransparentRedirect()
+ {
+ var createRequest = new CustomerRequest
+ {
+ FirstName = "Miranda",
+ LastName = "Higgenbottom"
+ };
+
+ Customer createdCustomer = gateway.Customer.Create(createRequest).Target;
+
+ CustomerRequest trParams = new CustomerRequest
+ {
+ CustomerId = createdCustomer.Id,
+ FirstName = "Penelope"
+ };
+
+ CustomerRequest request = new CustomerRequest
+ {
+ LastName = "Lambert"
+ };
+
+ String queryString = TestHelper.QueryStringForTR(trParams, request, gateway.TransparentRedirect.Url);
+ Result<Customer> result = gateway.TransparentRedirect.ConfirmCustomer(queryString);
+ Assert.IsTrue(result.IsSuccess());
+ Customer updatedCustomer = gateway.Customer.Find(createdCustomer.Id);
+
+ Assert.AreEqual("Penelope", updatedCustomer.FirstName);
+ Assert.AreEqual("Lambert", updatedCustomer.LastName);
+ }
+
+ [Test]
+ public void CreateCreditCardFromTransparentRedirect()
+ {
+ Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
+ CreditCardRequest trParams = new CreditCardRequest
+ {
+ CustomerId = customer.Id,
+ Number = "4111111111111111",
+ ExpirationDate = "10/10"
+ };
+
+ CreditCardRequest request = new CreditCardRequest
+ {
+ CardholderName = "John Doe"
+ };
+
+ String queryString = TestHelper.QueryStringForTR(trParams, request, gateway.TransparentRedirect.Url);
+ Result<CreditCard> result = gateway.TransparentRedirect.ConfirmCreditCard(queryString);
+ Assert.IsTrue(result.IsSuccess());
+ CreditCard creditCard = result.Target;
+
+ Assert.AreEqual("John Doe", creditCard.CardholderName);
+ Assert.AreEqual("411111", creditCard.Bin);
+ Assert.AreEqual("1111", creditCard.LastFour);
+ Assert.AreEqual("10/2010", creditCard.ExpirationDate);
+ }
+
+
+ [Test]
+ public void UpdateCreditCardFromTransparentRedirect()
+ {
+ Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
+
+ var creditCardRequest = new CreditCardRequest
+ {
+ CustomerId = customer.Id,
+ Number = "5105105105105100",
+ ExpirationDate = "05/12",
+ CardholderName = "Beverly D'angelo"
+ };
+
+ CreditCard createdCreditCard = gateway.CreditCard.Create(creditCardRequest).Target;
+
+
+ CreditCardRequest trParams = new CreditCardRequest
+ {
+ PaymentMethodToken = createdCreditCard.Token,
+ Number = "4111111111111111",
+ ExpirationDate = "10/10"
+ };
+
+ CreditCardRequest request = new CreditCardRequest
+ {
+ CardholderName = "Sampsonite"
+ };
+
+ String queryString = TestHelper.QueryStringForTR(trParams, request, gateway.TransparentRedirect.Url);
+ Result<CreditCard> result = gateway.TransparentRedirect.ConfirmCreditCard(queryString);
+ Assert.IsTrue(result.IsSuccess());
+ CreditCard creditCard = gateway.CreditCard.Find(createdCreditCard.Token);
+
+ Assert.AreEqual("Sampsonite", creditCard.CardholderName);
+ Assert.AreEqual("411111", creditCard.Bin);
+ Assert.AreEqual("1111", creditCard.LastFour);
+ Assert.AreEqual("10/2010", creditCard.ExpirationDate);
+ }
+ }
+}
View
10 Braintree/Braintree.csproj
@@ -9,7 +9,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Braintree</RootNamespace>
- <AssemblyName>Braintree-2.3.0</AssemblyName>
+ <AssemblyName>Braintree-2.4.0</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkSubset>
@@ -23,7 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <DocumentationFile>bin\Debug\Braintree-2.3.0.xml</DocumentationFile>
+ <DocumentationFile>bin\Debug\Braintree-2.4.0.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -33,7 +33,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <DocumentationFile>bin\Debug\Braintree-2.3.0.xml</DocumentationFile>
+ <DocumentationFile>bin\Debug\Braintree-2.4.0.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
@@ -104,8 +104,10 @@
<Compile Include="DateRangeNode.cs" />
<Compile Include="CreditCardAddressRequest.cs" />
<Compile Include="CreditCardAddressOptionsRequest.cs" />
- <Compile Include="CustomerSearchRequest.cs" />
+ <Compile Include="IdsSearchRequest.cs" />
<Compile Include="Exceptions\UpgradeRequiredException.cs" />
+ <Compile Include="StatusEvent.cs" />
+ <Compile Include="TransparentRedirectGateway.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
View
5 Braintree/BraintreeGateway.cs
@@ -109,6 +109,11 @@ public virtual TransactionGateway Transaction
get { return new TransactionGateway(); }
}
+ public virtual TransparentRedirectGateway TransparentRedirect
+ {
+ get { return new TransparentRedirectGateway(); }
+ }
+
public virtual String TrData(Request trData, String redirectURL)
{
return TrUtil.BuildTrData(trData, redirectURL);
View
6 Braintree/CreditCard.cs
@@ -63,7 +63,8 @@ public class CreditCard
public String CardType { get; protected set; }
public DateTime? CreatedAt { get; protected set; }
public String CustomerId { get; protected set; }
- public Boolean? Default { get; protected set; }
+ public Boolean? IsDefault { get; protected set; }
+ public Boolean? IsExpired { get; protected set; }
public String CustomerLocation { get; protected set; }
public String LastFour { get; protected set; }
public Subscription[] Subscriptions { get; protected set; }
@@ -101,9 +102,10 @@ internal CreditCard(NodeWrapper node)
CardholderName = node.GetString("cardholder-name");
CardType = node.GetString("card-type");
CustomerId = node.GetString("customer-id");
- Default = node.GetBoolean("default");
+ IsDefault = node.GetBoolean("default");
ExpirationMonth = node.GetString("expiration-month");
ExpirationYear = node.GetString("expiration-year");
+ IsExpired = node.GetBoolean("expired");
CustomerLocation = node.GetString("customer-location");
LastFour = node.GetString("last-4");
Token = node.GetString("token");
View
43 Braintree/CreditCardGateway.cs
@@ -12,11 +12,13 @@ namespace Braintree
/// </summary>
public class CreditCardGateway
{
+ [Obsolete("Use gateway.TransparentRedirect.Url")]
public virtual String TransparentRedirectURLForCreate()
{
return Configuration.BaseMerchantURL() + "/payment_methods/all/create_via_transparent_redirect_request";
}
+ [Obsolete("Use gateway.TransparentRedirect.Url")]
public virtual String TransparentRedirectURLForUpdate()
{
return Configuration.BaseMerchantURL() + "/payment_methods/all/update_via_transparent_redirect_request";
@@ -29,6 +31,7 @@ public virtual Result<CreditCard> Create(CreditCardRequest request)
return new Result<CreditCard>(new NodeWrapper(creditCardXML));
}
+ [Obsolete("Use gateway.TransparentRedirect.Confirm()")]
public virtual Result<CreditCard> ConfirmTransparentRedirect(String queryString)
{
TransparentRedirectRequest trRequest = new TransparentRedirectRequest(queryString);
@@ -37,6 +40,46 @@ public virtual Result<CreditCard> ConfirmTransparentRedirect(String queryString)
return new Result<CreditCard>(new NodeWrapper(creditCardXML));
}
+ public virtual ResourceCollection<CreditCard> Expired()
+ {
+ NodeWrapper response = new NodeWrapper(WebServiceGateway.Post("/payment_methods/all/expired_ids"));
+
+ return new ResourceCollection<CreditCard>(response, delegate(String[] ids) {
+ IdsSearchRequest query = new IdsSearchRequest().
+ Ids.IncludedIn(ids);
+
+ NodeWrapper fetchResponse = new NodeWrapper(WebServiceGateway.Post("/payment_methods/all/expired", query));
+
+ List<CreditCard> creditCards = new List<CreditCard>();
+ foreach (NodeWrapper node in fetchResponse.GetList("credit-card"))
+ {
+ creditCards.Add(new CreditCard(node));
+ }
+ return creditCards;
+ });
+ }
+
+ public virtual ResourceCollection<CreditCard> ExpiringBetween(DateTime start, DateTime end)
+ {
+ String queryString = String.Format("start={0:MMyyyy}&end={1:MMyyyy}", start, end);
+
+ NodeWrapper response = new NodeWrapper(WebServiceGateway.Post("/payment_methods/all/expiring_ids?" + queryString));
+
+ return new ResourceCollection<CreditCard>(response, delegate(String[] ids) {
+ IdsSearchRequest query = new IdsSearchRequest().
+ Ids.IncludedIn(ids);
+
+ NodeWrapper fetchResponse = new NodeWrapper(WebServiceGateway.Post("/payment_methods/all/expiring?" + queryString, query));
+
+ List<CreditCard> creditCards = new List<CreditCard>();
+ foreach (NodeWrapper node in fetchResponse.GetList("credit-card"))
+ {
+ creditCards.Add(new CreditCard(node));
+ }
+ return creditCards;
+ });
+ }
+
public virtual CreditCard Find(String token)
{
XmlNode creditCardXML = WebServiceGateway.Get("/payment_methods/" + token);
View
3 Braintree/CreditCardOptionsRequest.cs
@@ -11,6 +11,7 @@ public class CreditCardOptionsRequest : Request
public Boolean VerifyCard { get; set; }
public Boolean MakeDefault { get; set; }
public String VerificationMerchantAccountId { get; set; }
+ public String UpdateExistingToken { get; set; }
public override String ToXml()
{
@@ -27,6 +28,7 @@ public override String ToXml(String rootElement)
}
builder.Append(BuildXMLElement("verification-merchant-account-id", VerificationMerchantAccountId));
builder.Append(BuildXMLElement("verify-card", VerifyCard));
+ builder.Append(BuildXMLElement("update-existing-token", UpdateExistingToken));
builder.Append(String.Format("</{0}>", rootElement));
return builder.ToString();
@@ -43,6 +45,7 @@ public override String ToQueryString(String root)
Append(ParentBracketChildString(root, "verification_merchant_account_id"), VerificationMerchantAccountId).
Append(ParentBracketChildString(root, "verify_card"), VerifyCard).
Append(ParentBracketChildString(root, "make_default"), MakeDefault).
+ Append(ParentBracketChildString(root, "update_existing_token"), UpdateExistingToken).
ToString();
}
}
View
12 Braintree/CreditCardRequest.cs
@@ -42,6 +42,18 @@ public class CreditCardRequest : Request
public String ExpirationDate { get; set; }
public String PaymentMethodToken { get; set; }
+ public override String Kind()
+ {
+ if (PaymentMethodToken == null)
+ {
+ return TransparentRedirectGateway.CREATE_PAYMENT_METHOD;
+ }
+ else
+ {
+ return TransparentRedirectGateway.UPDATE_PAYMENT_METHOD;
+ }
+ }
+
public override String ToXml()
{
return ToXml("credit-card");
View
5 Braintree/CustomerGateway.cs
@@ -37,6 +37,7 @@ public virtual Result<Customer> Update(String Id, CustomerRequest request)
return new Result<Customer>(new NodeWrapper(customerXML));
}
+ [Obsolete("Use gateway.TransparentRedirect.Confirm()")]
public virtual Result<Customer> ConfirmTransparentRedirect(String queryString)
{
TransparentRedirectRequest trRequest = new TransparentRedirectRequest(queryString);
@@ -45,11 +46,13 @@ public virtual Result<Customer> ConfirmTransparentRedirect(String queryString)
return new Result<Customer>(new NodeWrapper(node));
}
+ [Obsolete("Use gateway.TransparentRedirect.Url")]
public virtual String TransparentRedirectURLForCreate()
{
return Configuration.BaseMerchantURL() + "/customers/all/create_via_transparent_redirect_request";
}
+ [Obsolete("Use gateway.TransparentRedirect.Url")]
public virtual String TransparentRedirectURLForUpdate()
{
return Configuration.BaseMerchantURL() + "/customers/all/update_via_transparent_redirect_request";
@@ -66,7 +69,7 @@ public virtual ResourceCollection<Customer> All()
private List<Customer> FetchCustomers(String[] ids)
{
- CustomerSearchRequest query = new CustomerSearchRequest().
+ IdsSearchRequest query = new IdsSearchRequest().
Ids.IncludedIn(ids);
NodeWrapper response = new NodeWrapper(WebServiceGateway.Post("/customers/advanced_search", query));
View
12 Braintree/CustomerRequest.cs
@@ -58,6 +58,18 @@ public class CustomerRequest : Request
public Dictionary<String, String> CustomFields { get; set; }
public CreditCardRequest CreditCard { get; set; }
+ public override String Kind()
+ {
+ if (CustomerId == null)
+ {
+ return TransparentRedirectGateway.CREATE_CUSTOMER;
+ }
+ else
+ {
+ return TransparentRedirectGateway.UPDATE_CUSTOMER;
+ }
+ }
+
public override String ToXml()
{
return ToXml("customer");
View
6 Braintree/CustomerSearchRequest.cs → Braintree/IdsSearchRequest.cs
@@ -6,13 +6,13 @@
namespace Braintree
{
- public class CustomerSearchRequest : SearchRequest
+ public class IdsSearchRequest : SearchRequest
{
- public MultipleValueNode<CustomerSearchRequest> Ids
+ public MultipleValueNode<IdsSearchRequest> Ids
{
get
{
- return new MultipleValueNode<CustomerSearchRequest>("ids", this);
+ return new MultipleValueNode<IdsSearchRequest>("ids", this);
}
}
}
View
4 Braintree/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("2.2.0.0")]
-[assembly: AssemblyFileVersion("2.2.0.0")]
+[assembly: AssemblyVersion("2.4.0.0")]
+[assembly: AssemblyFileVersion("2.4.0.0")]
View
5 Braintree/Request.cs
@@ -62,6 +62,11 @@ internal virtual String BuildXMLElement(String tagName, String value)
return String.Format("<{0}>{1}</{0}>", SecurityElement.Escape(tagName), SecurityElement.Escape(value));
}
+ public virtual String Kind()
+ {
+ return null;
+ }
+
protected virtual String ParentBracketChildString(String parent, String child)
{
return String.Format("{0}[{1}]", parent, child);
View
26 Braintree/StatusEvent.cs
@@ -0,0 +1,26 @@
+#pragma warning disable 1591
+
+using System;
+
+namespace Braintree
+{
+ public class StatusEvent
+ {
+ public Decimal? Amount { get; protected set; }
+ public TransactionStatus Status { get; protected set; }
+ public DateTime? Timestamp { get; protected set; }
+ public TransactionSource Source { get; protected set; }
+ public String User { get; protected set; }
+
+ public StatusEvent(NodeWrapper node)
+ {
+ if (node == null) return;
+
+ Amount = node.GetDecimal("amount");
+ Status = (TransactionStatus)CollectionUtil.Find(TransactionStatus.ALL, node.GetString("status"), TransactionStatus.UNRECOGNIZED);
+ Timestamp = node.GetDateTime("timestamp");
+ Source = (TransactionSource)CollectionUtil.Find(TransactionSource.ALL, node.GetString("transaction-source"), TransactionSource.UNRECOGNIZED);
+ User = node.GetString("user");
+ }
+ }
+}
View
1 Braintree/TrUtil.cs
@@ -17,6 +17,7 @@ public static String BuildTrData(Request request, String redirectURL)
Append("public_key", Configuration.PublicKey).
Append("redirect_url", redirectURL).
Append("time", dateString).
+ Append("kind", request.Kind()).
ToString();
String requestQueryString = request.ToQueryString();
View
26 Braintree/Transaction.cs
@@ -29,13 +29,16 @@ public class TransactionStatus : Enumeration
protected TransactionStatus(String name) : base(name) {}
}
- public abstract class TransactionSource
+ public class TransactionSource : Enumeration
{
- public const String API = "api";
- public const String CONTROL_PANEL = "control_panel";
- public const String RECURRING = "recurring";
+ public static readonly TransactionSource API = new TransactionSource("api");
+ public static readonly TransactionSource CONTROL_PANEL = new TransactionSource("control_panel");
+ public static readonly TransactionSource RECURRING = new TransactionSource("recurring");
+ public static readonly TransactionSource UNRECOGNIZED = new TransactionSource("unrecognized");
- public static readonly String[] ALL = { API, CONTROL_PANEL, RECURRING };
+ public static readonly TransactionSource[] ALL = { API, CONTROL_PANEL, RECURRING };
+
+ protected TransactionSource(String name) : base(name) {}
}
public class TransactionType : Enumeration
@@ -85,8 +88,11 @@ public class Transaction
public String ProcessorAuthorizationCode { get; protected set; }
public String ProcessorResponseCode { get; protected set; }
public String ProcessorResponseText { get; protected set; }
+ public String RefundedTransactionId { get; protected set; }
+ public String RefundId { get; protected set; }
public Address ShippingAddress { get; protected set; }
public TransactionStatus Status { get; protected set; }
+ public StatusEvent[] StatusHistory { get; protected set; }
public String SubscriptionId { get; protected set; }
public TransactionType Type { get; protected set; }
public DateTime? UpdatedAt { get; protected set; }
@@ -103,11 +109,21 @@ internal Transaction(NodeWrapper node)
AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code");
OrderId = node.GetString("order-id");
Status = (TransactionStatus)CollectionUtil.Find(TransactionStatus.ALL, node.GetString("status"), TransactionStatus.UNRECOGNIZED);
+
+ List<NodeWrapper> statusNodes = node.GetList("status-history/status-event");
+ StatusHistory = new StatusEvent[statusNodes.Count];
+ for (int i = 0; i < statusNodes.Count; i++)
+ {
+ StatusHistory[i] = new StatusEvent(statusNodes[i]);
+ }
+
Type = (TransactionType)CollectionUtil.Find(TransactionType.ALL, node.GetString("type"), TransactionType.UNRECOGNIZED);
MerchantAccountId = node.GetString("merchant-account-id");
ProcessorAuthorizationCode = node.GetString("processor-authorization-code");
ProcessorResponseCode = node.GetString("processor-response-code");
ProcessorResponseText = node.GetString("processor-response-text");
+ RefundedTransactionId = node.GetString("refunded-transaction-id");
+ RefundId = node.GetString("refund-id");
SubscriptionId = node.GetString("subscription-id");
CustomFields = node.GetDictionary("custom-fields");
CreditCard = new CreditCard(node.GetNode("credit-card"));
View
2 Braintree/TransactionGateway.cs
@@ -11,11 +11,13 @@ namespace Braintree
/// </summary>
public class TransactionGateway
{
+ [Obsolete("Use gateway.TransparentRedirect.Url")]
public virtual String TransparentRedirectURLForCreate()
{
return Configuration.BaseMerchantURL() + "/transactions/all/create_via_transparent_redirect_request";
}
+ [Obsolete("Use gateway.TransparentRedirect.Confirm()")]
public virtual Result<Transaction> ConfirmTransparentRedirect(String queryString)
{
TransparentRedirectRequest trRequest = new TransparentRedirectRequest(queryString);
View
5 Braintree/TransactionRequest.cs
@@ -44,6 +44,11 @@ public TransactionRequest()
CustomFields = new Dictionary<String, String>();
}
+ public override String Kind()
+ {
+ return TransparentRedirectGateway.CREATE_TRANSACTION;
+ }
+
public override String ToXml()
{
return ToXml("transaction");
View
49 Braintree/TransparentRedirectGateway.cs
@@ -0,0 +1,49 @@
+#pragma warning disable 1591
+
+using System;
+using System.Xml;
+
+namespace Braintree
+{
+ public class TransparentRedirectGateway
+ {
+ public const String CREATE_CUSTOMER = "create_customer";
+ public const String UPDATE_CUSTOMER = "update_customer";
+ public const String CREATE_PAYMENT_METHOD = "create_payment_method";
+ public const String UPDATE_PAYMENT_METHOD = "update_payment_method";
+ public const String CREATE_TRANSACTION = "create_transaction";
+
+ public String Url
+ {
+ get { return Configuration.BaseMerchantURL() + "/transparent_redirect_requests"; }
+ }
+
+ public TransparentRedirectGateway()
+ {
+ }
+
+ public virtual Result<Transaction> ConfirmTransaction(String queryString)
+ {
+ TransparentRedirectRequest trRequest = new TransparentRedirectRequest(queryString);
+ XmlNode node = WebServiceGateway.Post("/transparent_redirect_requests/" + trRequest.Id + "/confirm", trRequest);
+
+ return new Result<Transaction>(new NodeWrapper(node));
+ }
+
+ public virtual Result<Customer> ConfirmCustomer(String queryString)
+ {
+ TransparentRedirectRequest trRequest = new TransparentRedirectRequest(queryString);
+ XmlNode node = WebServiceGateway.Post("/transparent_redirect_requests/" + trRequest.Id + "/confirm", trRequest);
+
+ return new Result<Customer>(new NodeWrapper(node));
+ }
+
+ public virtual Result<CreditCard> ConfirmCreditCard(String queryString)
+ {
+ TransparentRedirectRequest trRequest = new TransparentRedirectRequest(queryString);
+ XmlNode node = WebServiceGateway.Post("/transparent_redirect_requests/" + trRequest.Id + "/confirm", trRequest);
+
+ return new Result<CreditCard>(new NodeWrapper(node));
+ }
+ }
+}
View
3 Braintree/TransparentRedirectRequest.cs
@@ -11,7 +11,8 @@ namespace Braintree
{
public class TransparentRedirectRequest : Request
{
- private String Id;
+
+ public String Id { get; protected set; }
public TransparentRedirectRequest(String queryString)
{
View
21 Braintree/ValidationErrorCode.cs
@@ -26,27 +26,29 @@ public enum ValidationErrorCode
CREDIT_CARD_BILLING_ADDRESS_ID_IS_INVALID = 91702,
CREDIT_CARD_CARDHOLDER_NAME_IS_TOO_LONG = 81723,
CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED = 81703,
- CREDIT_CARD_CUSTOMER_ID_IS_REQUIRED = 91704,
+ CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED_BY_SUBSCRIPTION_MERCHANT_ACCOUNT = 81718,
CREDIT_CARD_CUSTOMER_ID_IS_INVALID = 91705,
- CREDIT_CARD_CVV_IS_REQUIRED = 81706,
+ CREDIT_CARD_CUSTOMER_ID_IS_REQUIRED = 91704,
CREDIT_CARD_CVV_IS_INVALID = 81707,
+ CREDIT_CARD_CVV_IS_REQUIRED = 81706,
CREDIT_CARD_EXPIRATION_DATE_CONFLICT = 91708,
- CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED = 81709,
CREDIT_CARD_EXPIRATION_DATE_IS_INVALID = 81710,
+ CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED = 81709,
CREDIT_CARD_EXPIRATION_DATE_YEAR_IS_INVALID = 81711,
CREDIT_CARD_EXPIRATION_MONTH_IS_INVALID = 81712,
CREDIT_CARD_EXPIRATION_YEAR_IS_INVALID = 81713,
- CREDIT_CARD_NUMBER_IS_REQUIRED = 81714,
- CREDIT_CARD_NUMBER_IS_INVALID = 81715,
CREDIT_CARD_NUMBER_HAS_INVALID_LENGTH = 81716,
+ CREDIT_CARD_NUMBER_IS_INVALID = 81715,
+ CREDIT_CARD_NUMBER_IS_REQUIRED = 81714,
CREDIT_CARD_NUMBER_MUST_BE_TEST_NUMBER = 81717,
+ CREDIT_CARD_OPTIONS_UPDATE_EXISTING_TOKEN_IS_INVALID = 91723,
CREDIT_CARD_TOKEN_INVALID = 91718,
CREDIT_CARD_TOKEN_IS_IN_USE = 91719,
- CREDIT_CARD_TOKEN_IS_TOO_LONG = 91720,
CREDIT_CARD_TOKEN_IS_NOT_ALLOWED = 91721,
CREDIT_CARD_TOKEN_IS_REQUIRED = 91722,
+ CREDIT_CARD_TOKEN_IS_TOO_LONG = 91720,
- CUSTOMER_COMPANYIS_TOO_LONG = 81601,
+ CUSTOMER_COMPANY_IS_TOO_LONG = 81601,
CUSTOMER_CUSTOM_FIELD_IS_INVALID = 91602,
CUSTOMER_CUSTOM_FIELD_IS_TOO_LONG = 81603,
CUSTOMER_EMAIL_IS_INVALID = 81604,
@@ -66,6 +68,10 @@ public enum ValidationErrorCode
SUBSCRIPTION_CANNOT_EDIT_CANCELED_SUBSCRIPTION = 81901,
SUBSCRIPTION_ID_IS_IN_USE = 81902,
SUBSCRIPTION_MERCHANT_ACCOUNT_ID_IS_INVALID = 91901,
+ SUBSCRIPTION_PAYMENT_METHOD_TOKEN_CARD_TYPE_IS_NOT_ACCEPTED = 91902,
+ SUBSCRIPTION_PAYMENT_METHOD_TOKEN_IS_INVALID = 91903,
+ SUBSCRIPTION_PAYMENT_METHOD_TOKEN_NOT_ASSOCIATED_WITH_CUSTOMER = 91905,
+ SUBSCRIPTION_PLAN_ID_IS_INVALID = 91904,
SUBSCRIPTION_PRICE_CANNOT_BE_BLANK = 81903,
SUBSCRIPTION_PRICE_FORMAT_IS_INVALID = 81904,
SUBSCRIPTION_STATUS_IS_CANCELED = 81905,
@@ -78,6 +84,7 @@ public enum ValidationErrorCode
TRANSACTION_AMOUNT_IS_REQUIRED = 81502,
TRANSACTION_AMOUNT_IS_INVALID = 81503,
TRANSACTION_AMOUNT_IS_TOO_LARGE = 81528,
+ TRANSACTION_BILLING_ADDRESS_CONFLICT = 91530,
TRANSACTION_CANNOT_BE_VOIDED = 91504,
TRANSACTION_CANNOT_REFUND_CREDIT = 91505,
TRANSACTION_CANNOT_REFUND_UNLESS_SETTLED = 91506,
View
9 CHANGELOG.md
@@ -1,3 +1,12 @@
+## 2.4.0
+
+* Added unified TransparentRedirect url and confirm methods and deprecated old methods
+* Renamed CreditCard.Default to IsDefault
+* Added methods to CreditCardGateway to allow searching on expiring and expired credit cards
+* Added ability to update a customer, credit card, and billing address in one request
+* Allow updating the payment method token on a subscription
+* Added methods to navigate between a Transaction and its refund (in both directions)
+
## 2.3.0
* Return AvsErrorResponseCode, AvsPostalCodeResponseCode, AvsStreetAddressResponseCode, CurrencyIsoCode, CvvResponseCode with Transaction
View
6 braintree.shfbproj
@@ -19,8 +19,8 @@
<FrameworkVersion>2.0.50727</FrameworkVersion>
<HelpFileFormat>Website</HelpFileFormat>
<DocumentationSources>
- <DocumentationSource sourceFile="Braintree\bin\Debug\Braintree-2.2.0.dll" />
-<DocumentationSource sourceFile="Braintree\bin\Debug\Braintree-2.2.0.xml" /></DocumentationSources>
+ <DocumentationSource sourceFile="Braintree\bin\Debug\Braintree-2.4.0.dll" />
+<DocumentationSource sourceFile="Braintree\bin\Debug\Braintree-2.4.0.xml" /></DocumentationSources>
<NamingMethod>MemberName</NamingMethod>
<NamespaceSummaries>
<NamespaceSummaryItem name="Braintree" isDocumented="True">Quick Start Example:
@@ -86,4 +86,4 @@ namespace BraintreeExample
</PropertyGroup>
<!-- Import the SHFB build targets -->
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
-</Project>
+</Project>

0 comments on commit c007571

Please sign in to comment.
Something went wrong with that request. Please try again.