Browse files

2.19.0

  • Loading branch information...
1 parent d2ee953 commit 16caab1c1231cf644a8c06d3ebc6ba82c56d24bf @braintreeps braintreeps committed Nov 12, 2012
View
4 Braintree.Tests/AddressTest.cs
@@ -101,12 +101,12 @@ public void Find_FindsErrorsOutOnWhitespaceIds()
try {
gateway.Address.Find(" ", "address_id");
Assert.Fail("Should throw NotFoundException");
- } catch (NotFoundException ok) {}
+ } catch (NotFoundException) {}
try {
gateway.Address.Find("customer_id", " ");
Assert.Fail("Should throw NotFoundException");
- } catch (NotFoundException ok) {}
+ } catch (NotFoundException) {}
}
[Test]
View
1 Braintree.Tests/Braintree.Tests.csproj
@@ -57,6 +57,7 @@
<Compile Include="ConfigurationTest.cs" />
<Compile Include="CreditCardTest.cs" />
<Compile Include="CreditCardNumbers.cs" />
+ <Compile Include="CreditCardDefaults.cs" />
<Compile Include="CreditCardVerificationTest.cs" />
<Compile Include="CryptoTest.cs" />
<Compile Include="CustomerTest.cs" />
View
8 Braintree.Tests/CreditCardDefaults.cs
@@ -0,0 +1,8 @@
+namespace Braintree.Tests
+{
+ class CreditCardDefaults
+ {
+ public static readonly string CountryOfIssuance = "USA";
+ public static readonly string IssuingBank = "NETWORK ONLY";
+ }
+}
View
18 Braintree.Tests/CreditCardNumbers.cs
@@ -4,14 +4,16 @@ namespace CreditCardNumbers
{
public class CardTypeIndicators
{
- public static readonly string Prepaid = "4111111111111210";
- public static readonly string Commercial = "4111111111131010";
- public static readonly string Payroll = "4111111114101010";
- public static readonly string Healthcare = "4111111510101010";
- public static readonly string DurbinRegulated = "4111161010101010";
- public static readonly string Debit = "4117101010101010";
- public static readonly string Unknown = "4111111111112101";
- public static readonly string No = "4111111111310101";
+ public static readonly string Prepaid = "4111111111111210";
+ public static readonly string Commercial = "4111111111131010";
+ public static readonly string Payroll = "4111111114101010";
+ public static readonly string Healthcare = "4111111510101010";
+ public static readonly string DurbinRegulated = "4111161010101010";
+ public static readonly string Debit = "4117101010101010";
+ public static readonly string Unknown = "4111111111112101";
+ public static readonly string No = "4111111111310101";
+ public static readonly string IssuingBank = "4111111141010101";
+ public static readonly string CountryOfIssuance = "4111111111121102";
}
public class FailsSandboxVerification
{
View
45 Braintree.Tests/CreditCardTest.cs
@@ -329,7 +329,7 @@ public void Find_FindsErrorsOutOnWhitespaceIds()
try {
gateway.CreditCard.Find(" ");
Assert.Fail("Should throw NotFoundException");
- } catch (NotFoundException ok) {}
+ } catch (NotFoundException) {}
}
[Test]
@@ -921,6 +921,47 @@ public void DurbinRegulated()
Assert.AreEqual(Braintree.CreditCardDurbinRegulated.YES, creditCard.DurbinRegulated);
}
+ [Test]
+ public void CountryOfIssuance()
+ {
+ Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
+ CreditCardRequest request = new CreditCardRequest
+ {
+ CustomerId = customer.Id,
+ CardholderName = "John Doe",
+ CVV = "123",
+ Number = Braintree.Tests.CreditCardNumbers.CardTypeIndicators.CountryOfIssuance,
+ ExpirationDate = "05/12",
+ Options = new CreditCardOptionsRequest
+ {
+ VerifyCard = true
+ }
+ };
+
+ CreditCard creditCard = gateway.CreditCard.Create(request).Target;
+ Assert.AreEqual(Braintree.Tests.CreditCardDefaults.CountryOfIssuance, creditCard.CountryOfIssuance);
+ }
+
+ [Test]
+ public void IssuingBank()
+ {
+ Customer customer = gateway.Customer.Create(new CustomerRequest()).Target;
+ CreditCardRequest request = new CreditCardRequest
+ {
+ CustomerId = customer.Id,
+ CardholderName = "John Doe",
+ CVV = "123",
+ Number = Braintree.Tests.CreditCardNumbers.CardTypeIndicators.IssuingBank,
+ ExpirationDate = "05/12",
+ Options = new CreditCardOptionsRequest
+ {
+ VerifyCard = true
+ }
+ };
+
+ CreditCard creditCard = gateway.CreditCard.Create(request).Target;
+ Assert.AreEqual(Braintree.Tests.CreditCardDefaults.IssuingBank, creditCard.IssuingBank);
+ }
[Test]
public void NegativeCardTypeIndicators()
@@ -972,6 +1013,8 @@ public void MissingCardTypeIndicators()
Assert.AreEqual(Braintree.CreditCardDurbinRegulated.UNKNOWN, creditCard.DurbinRegulated);
Assert.AreEqual(Braintree.CreditCardPayroll.UNKNOWN, creditCard.Payroll);
Assert.AreEqual(Braintree.CreditCardDebit.UNKNOWN, creditCard.Debit);
+ Assert.AreEqual(Braintree.CreditCard.CountryOfIssuanceUnknown, creditCard.CountryOfIssuance);
+ Assert.AreEqual(Braintree.CreditCard.IssuingBankUnknown, creditCard.IssuingBank);
}
}
View
2 Braintree.Tests/SubscriptionTest.cs
@@ -707,7 +707,7 @@ public void Find_FindsErrorsOutOnWhitespaceIds()
try {
gateway.Subscription.Find(" ");
Assert.Fail("Should throw NotFoundException");
- } catch (NotFoundException ok) {}
+ } catch (NotFoundException) {}
}
[Test]
View
2 Braintree.Tests/TransactionTest.cs
@@ -2184,7 +2184,7 @@ public void Find_FindsErrorsOutOnWhitespaceIds()
try {
gateway.Transaction.Find(" ");
Assert.Fail("Should throw NotFoundException");
- } catch (NotFoundException ok) {}
+ } catch (NotFoundException) {}
}
View
40 Braintree/CreditCard.cs
@@ -130,6 +130,9 @@ public class CreditCardCardType : Enumeration
/// </example>
public class CreditCard
{
+ public static readonly String CountryOfIssuanceUnknown = "Unknown";
+ public static readonly String IssuingBankUnknown = "Unknown";
+
public String Bin { get; protected set; }
public String CardholderName { get; protected set; }
public CreditCardCardType CardType { get; protected set; }
@@ -152,6 +155,41 @@ public class CreditCard
public CreditCardCommercial Commercial { get; protected set; }
public CreditCardHealthcare Healthcare { get; protected set; }
public CreditCardDurbinRegulated DurbinRegulated { get; protected set; }
+
+ private String _CountryOfIssuance;
+
+ public String CountryOfIssuance
+ {
+ get
+ {
+ if (_CountryOfIssuance == "")
+ {
+ return CountryOfIssuanceUnknown;
+ }
+ else
+ {
+ return _CountryOfIssuance;
+ }
+ }
+ }
+
+ private String _IssuingBank;
+
+ public String IssuingBank
+ {
+ get
+ {
+ if (_IssuingBank == "")
+ {
+ return IssuingBankUnknown;
+ }
+ else
+ {
+ return _IssuingBank;
+ }
+ }
+ }
+
public String ExpirationDate
{
get
@@ -198,6 +236,8 @@ protected internal CreditCard(NodeWrapper node, BraintreeService service)
Debit = (CreditCardDebit)CollectionUtil.Find(CreditCardDebit.ALL, node.GetString("debit"), CreditCardDebit.UNKNOWN);
Commercial = (CreditCardCommercial)CollectionUtil.Find(CreditCardCommercial.ALL, node.GetString("commercial"), CreditCardCommercial.UNKNOWN);
Healthcare = (CreditCardHealthcare)CollectionUtil.Find(CreditCardHealthcare.ALL, node.GetString("healthcare"), CreditCardHealthcare.UNKNOWN);
+ _CountryOfIssuance = node.GetString("country-of-issuance");
+ _IssuingBank = node.GetString("issuing-bank");
var subscriptionXmlNodes = node.GetList("subscriptions/subscription");
Subscriptions = new Subscription[subscriptionXmlNodes.Count];
View
4 Braintree/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("2.18.0.0")]
-[assembly: AssemblyFileVersion("2.18.0.0")]
+[assembly: AssemblyVersion("2.19.0.0")]
+[assembly: AssemblyFileVersion("2.19.0.0")]
View
4 CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.19.0
+
+* Adds country of issuance and issuing bank
+
## 2.18.0
* Add verification search

0 comments on commit 16caab1

Please sign in to comment.