Skip to content

Commit

Permalink
5.21.0
Browse files Browse the repository at this point in the history
Co-authored-by: Sara Vasquez <[email protected]>
Co-authored-by: Debra Do <[email protected]>
  • Loading branch information
3 people committed Nov 8, 2023
1 parent a80e296 commit a62595d
Show file tree
Hide file tree
Showing 25 changed files with 1,355 additions and 29 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 5.21.0
- Add `DateOfBirth` and `CountryCode` to `IndustryDataRequest`
- Add `BillingAddress` and `ShippingAddress` to `VenmoProfileData`
- Add `VerificationAddOns` and `AdditionalProcessorResponse` to `UsBankAccountVerification`
- Add `MetaCheckoutCard` and `MetaCheckoutToken` to payment method
- Add `MetaCheckoutCardDetails` nd `MetaCheckoutTokenDetails` to Transaction

## 5.20.0
- Add `SUBSCRIPTIONBILLINGSKIPPED` webhook notification support
- Add `implicitlyVaultedPaymentMethodToken` and `implicitlyVaultedPaymentMethodGlobalId` to `LocalPaymentDetails`
Expand Down
9 changes: 6 additions & 3 deletions src/Braintree/Braintree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
<PropertyGroup>
<Description>Braintree Client Library</Description>
<Copyright>Copyright © Braintree, a division of PayPal, Inc. 2021</Copyright>
<VersionPrefix>5.20.0</VersionPrefix>
<VersionPrefix>5.21.0</VersionPrefix>
<Authors>Braintree</Authors>
<!-- We target NET standard 2.0 so that we can support NET Core 2.1. When NET Core 2.1 reaches EOL, we can update to Net Standard 2.1 -->
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<AssemblyName>Braintree</AssemblyName>
<PackageId>Braintree</PackageId>
<PackageTags>braintree;paypal;venmo;intenational;payments;gateway;currencies;money;visa;mastercard;bitcoin;maestro;apple pay;android pay;amex;jcb;diners club;discover;american express</PackageTags>
<PackageReleaseNotes>
- Add `SUBSCRIPTIONBILLINGSKIPPED` webhook notification support
- Add `implicitlyVaultedPaymentMethodToken` and `implicitlyVaultedPaymentMethodGlobalId` to `LocalPaymentDetails`
- Add `DateOfBirth` and `CountryCode` to `IndustryDataRequest`
- Add `BillingAddress` and `ShippingAddress` to `VenmoProfileData`
- Add `VerificationAddOns` and `AdditionalProcessorResponse` to `UsBankAccountVerification`
- Add `MetaCheckoutCard` and `MetaCheckoutToken` to payment method
- Add `MetaCheckoutCardDetails` nd `MetaCheckoutTokenDetails` to Transaction
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/braintree/braintree_dotnet</PackageProjectUrl>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
Expand Down
6 changes: 5 additions & 1 deletion src/Braintree/IndustryDataRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ public class IndustryDataRequest : Request
public DateTime? ArrivalDate { get; set; }
public string CheckInDate { get; set; }
public string CheckOutDate { get; set; }
public string CountryCode { get; set; }
public string CustomerCode { get; set; }
public string DateOfBirth { get; set; }
public string DepartureDate { get; set; }
public decimal? FareAmount { get; set; }
public decimal? FeeAmount { get; set; }
Expand Down Expand Up @@ -75,7 +77,9 @@ protected virtual RequestBuilder BuildRequest(string root)
AddElement("ticket-number", TicketNumber).
AddElement("issuing-carrier-code", IssuingCarrierCode).
AddElement("customer-code", CustomerCode).
AddElement("property-phone", PropertyPhone);
AddElement("property-phone", PropertyPhone).
AddElement("date-of-birth", DateOfBirth).
AddElement("country-code", CountryCode);

if (RoomRate != null)
builder.AddElement("room-rate", RoomRate.ToString());
Expand Down
148 changes: 148 additions & 0 deletions src/Braintree/MetaCheckoutCard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#pragma warning disable 1591

using System;
using System.Collections.Generic;

namespace Braintree
{
public class MetaCheckoutCard : PaymentMethod
{
public virtual string Bin { get; protected set; }
public virtual string CardholderName { get; protected set; }
public virtual CreditCardCardType CardType { get; protected set; }
public virtual CreditCardCommercial Commercial { get; protected set; }
public virtual string ContainerId { get; protected set; }
public virtual DateTime? CreatedAt { get; protected set; }
public virtual string CustomerId { get; protected set; }
public virtual CreditCardCustomerLocation CustomerLocation { get; protected set; }
public virtual CreditCardDebit Debit { get; protected set; }
public virtual CreditCardDurbinRegulated DurbinRegulated { get; protected set; }
public virtual string ExpirationMonth { get; protected set; }
public virtual string ExpirationYear { get; protected set; }
public virtual CreditCardHealthcare Healthcare { get; protected set; }
public virtual string ImageUrl { get; protected set; }
public virtual bool? IsDefault { get; protected set; }
public virtual bool? IsExpired { get; protected set; }
public virtual string LastFour { get; protected set; }
public virtual CreditCardPayroll Payroll { get; protected set; }
public virtual CreditCardPrepaid Prepaid { get; protected set; }
public virtual string Token { get; protected set; }
public virtual string UniqueNumberIdentifier { get; protected set; }
public virtual DateTime? UpdatedAt { get; protected set; }
public virtual CreditCardVerification Verification { get; protected set; }

private string _CountryOfIssuance;

public virtual string CountryOfIssuance
{
get
{
if (_CountryOfIssuance == "")
{
return CreditCard.CountryOfIssuanceUnknown;
}
else
{
return _CountryOfIssuance;
}
}
}

private string _IssuingBank;

public virtual string IssuingBank
{
get
{
if (_IssuingBank == "")
{
return CreditCard.IssuingBankUnknown;
}
else
{
return _IssuingBank;
}
}
}

private string _ProductId;

public virtual string ProductId
{
get
{
if (_ProductId == "")
{
return CreditCard.ProductIdUnknown;
}
else
{
return _ProductId;
}
}
}

public virtual string ExpirationDate
{
get => ExpirationMonth + "/" + ExpirationYear;
protected set
{
if (string.IsNullOrEmpty(value)) return;
ExpirationMonth = value.Split('/')[0];
ExpirationYear = value.Split('/')[1];
}
}

public string MaskedNumber => $"{Bin}******{LastFour}";

protected internal MetaCheckoutCard(NodeWrapper node, IBraintreeGateway gateway)
{
if (node == null) return;

Bin = node.GetString("bin");
CardholderName = node.GetString("cardholder-name");
CardType = node.GetEnum("card-type", CreditCardCardType.UNRECOGNIZED);
Commercial = node.GetEnum("commercial", CreditCardCommercial.UNKNOWN);
ContainerId = node.GetString("container-id");
CustomerId = node.GetString("customer-id");
CustomerLocation = node.GetEnum("customer-location", CreditCardCustomerLocation.UNRECOGNIZED);
CreatedAt = node.GetDateTime("created-at");
Debit = node.GetEnum("debit", CreditCardDebit.UNKNOWN);
DurbinRegulated = node.GetEnum("durbin-regulated", CreditCardDurbinRegulated.UNKNOWN);
ExpirationMonth = node.GetString("expiration-month");
ExpirationYear = node.GetString("expiration-year");
IsDefault = node.GetBoolean("default");
IsExpired = node.GetBoolean("expired");
LastFour = node.GetString("last-4");
Token = node.GetString("token");
UpdatedAt = node.GetDateTime("updated-at");
Prepaid = node.GetEnum("prepaid", CreditCardPrepaid.UNKNOWN);
Payroll = node.GetEnum("payroll", CreditCardPayroll.UNKNOWN);
Healthcare = node.GetEnum("healthcare", CreditCardHealthcare.UNKNOWN);
UniqueNumberIdentifier = node.GetString("unique-number-identifier");
_CountryOfIssuance = node.GetString("country-of-issuance");
_IssuingBank = node.GetString("issuing-bank");
_ProductId = node.GetString("product-id");
ImageUrl = node.GetString("image-url");

var verificationNodes = node.GetList("verifications/verification");
Verification = FindLatestVerification(verificationNodes, gateway);
}

private CreditCardVerification FindLatestVerification(List<NodeWrapper> verificationNodes, IBraintreeGateway gateway) {
if(verificationNodes.Count > 0)
{
verificationNodes.Sort(delegate(NodeWrapper first, NodeWrapper second) {
DateTime time1 = (DateTime)first.GetDateTime("created-at");
DateTime time2 = (DateTime)second.GetDateTime("created-at");

return DateTime.Compare(time2, time1);
});

return new CreditCardVerification(verificationNodes[0], gateway);
}

return null;
}
}
}
121 changes: 121 additions & 0 deletions src/Braintree/MetaCheckoutCardDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
using System;

namespace Braintree
{
public class MetaCheckoutCardDetails
{
public virtual string Bin { get; protected set; }
public virtual string CardholderName { get; protected set; }
public virtual CreditCardCardType CardType { get; protected set; }
public virtual CreditCardCommercial Commercial { get; protected set; }
public virtual string ContainerId { get; protected set; }
public virtual DateTime? CreatedAt { get; protected set; }
public virtual CreditCardCustomerLocation CustomerLocation { get; protected set; }
public virtual CreditCardDebit Debit { get; protected set; }
public virtual CreditCardDurbinRegulated DurbinRegulated { get; protected set; }
public virtual string ExpirationMonth { get; protected set; }
public virtual string ExpirationYear { get; protected set; }
public virtual CreditCardHealthcare Healthcare { get; protected set; }
public virtual string ImageUrl { get; protected set; }
public virtual bool? IsExpired { get; protected set; }
public virtual string LastFour { get; protected set; }
public virtual CreditCardPayroll Payroll { get; protected set; }
public virtual CreditCardPrepaid Prepaid { get; protected set; }
public virtual string Token { get; protected set; }
public virtual string UniqueNumberIdentifier { get; protected set; }
public virtual DateTime? UpdatedAt { get; protected set; }

private string _CountryOfIssuance;

public virtual string CountryOfIssuance
{
get
{
if (_CountryOfIssuance == "")
{
return CreditCard.CountryOfIssuanceUnknown;
}
else
{
return _CountryOfIssuance;
}
}
}

private string _IssuingBank;

public virtual string IssuingBank
{
get
{
if (_IssuingBank == "")
{
return CreditCard.IssuingBankUnknown;
}
else
{
return _IssuingBank;
}
}
}

private string _ProductId;

public virtual string ProductId
{
get
{
if (_ProductId == "")
{
return CreditCard.ProductIdUnknown;
}
else
{
return _ProductId;
}
}
}

public virtual string ExpirationDate
{
get => ExpirationMonth + "/" + ExpirationYear;
protected set
{
if (string.IsNullOrEmpty(value)) return;
ExpirationMonth = value.Split('/')[0];
ExpirationYear = value.Split('/')[1];
}
}

public string MaskedNumber => $"{Bin}******{LastFour}";

protected internal MetaCheckoutCardDetails(NodeWrapper node)
{
if (node == null) return;

Bin = node.GetString("bin");
ContainerId = node.GetString("container-id");
CardholderName = node.GetString("cardholder-name");
CardType = node.GetEnum("card-type", CreditCardCardType.UNRECOGNIZED);
ExpirationMonth = node.GetString("expiration-month");
ExpirationYear = node.GetString("expiration-year");
IsExpired = node.GetBoolean("expired");
CustomerLocation = node.GetEnum("customer-location", CreditCardCustomerLocation.UNRECOGNIZED);
LastFour = node.GetString("last-4");
UniqueNumberIdentifier = node.GetString("unique-number-identifier");
Token = node.GetString("token");
CreatedAt = node.GetDateTime("created-at");
UpdatedAt = node.GetDateTime("updated-at");
Prepaid = node.GetEnum("prepaid", CreditCardPrepaid.UNKNOWN);
Payroll = node.GetEnum("payroll", CreditCardPayroll.UNKNOWN);
DurbinRegulated = node.GetEnum("durbin-regulated", CreditCardDurbinRegulated.UNKNOWN);
Debit = node.GetEnum("debit", CreditCardDebit.UNKNOWN);
Commercial = node.GetEnum("commercial", CreditCardCommercial.UNKNOWN);
Healthcare = node.GetEnum("healthcare", CreditCardHealthcare.UNKNOWN);
_CountryOfIssuance = node.GetString("country-of-issuance");
_IssuingBank = node.GetString("issuing-bank");
_ProductId = node.GetString("product-id");
ImageUrl = node.GetString("image-url");
}
}
}
Loading

0 comments on commit a62595d

Please sign in to comment.