Skip to content

Commit

Permalink
5.28.0
Browse files Browse the repository at this point in the history
Co-authored-by: klaguerre <klaguerre@paypal.com>
Co-authored-by: saravasquez <saravasquez@paypal.com>
  • Loading branch information
3 people committed Oct 30, 2024
1 parent a18cba8 commit e56a663
Show file tree
Hide file tree
Showing 34 changed files with 342 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @braintree/team-sdk-server
* @PayPal-Braintree/team-sdk-server
5 changes: 4 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Checklist

- [ ] Added changelog entry
- [ ] Ran unit tests (See README for instructions)
- [ ] Ran unit tests (Check the README for instructions)
- [ ] I alphabetized all attributes, parameters, and methods by name in any class file I changed
- [ ] I have linked the JIRA ticket in the summary section
- [ ] I have reviewed the JIRA ticket to ensure all AC's are met
- [ ] I understand that unless this is a Draft PR or has a DO NOT MERGE label, this PR is considered to be in a deploy ready state and can be deployed if merged to main

<!-- **For Braintree Developers only, don't forget:**
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 5.28.0
- Add `fail_on_duplicate_payment_method_for_customer` option to
- `ClientToken`
- `PaymentMethod`
- `CreditCard`
- Fix billing address bug for credit card verification.
- Add `blik_aliases` to LocalPaymentCompleted webhook and LocalPaymentDetail
- Deprecate `SamsungPayCard`

## 5.27.0
- Add `PayerName`, `Bic` and `IbanLastChars` to LocalPaymentCompleted webhook
- Add `edit_paypal_vault_id` to `PayPalAccount`
Expand Down
21 changes: 21 additions & 0 deletions src/Braintree/BlikAlias.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.ComponentModel;

namespace Braintree
{

public class BlikAlias
{
public virtual string Key { get; protected set; }
public virtual string Label { get; protected set; }

protected internal BlikAlias(NodeWrapper node)
{
Key = node.GetString("key");
Label = node.GetString("label");
}

[Obsolete("Mock Use Only")]
protected internal BlikAlias() { }
}
}
17 changes: 8 additions & 9 deletions src/Braintree/Braintree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
<PropertyGroup>
<Description>Braintree Client Library</Description>
<Copyright>Copyright © Braintree, a division of PayPal, Inc. 2021</Copyright>
<VersionPrefix>5.27.0</VersionPrefix>
<VersionPrefix>5.28.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 `PayerName`, `Bic` and `IbanLastChars` to LocalPaymentCompleted webhook
- Add `edit_paypal_vault_id` to `PayPalAccount`
- Add `AniFirstNameResponseCode` and `AniLastNameResponseCode` to `CreditCardVerification`
- Add `ShippingTaxAmount` to `Transaction` and `TransactionRequest`
- Add `networkTokenizationAttributes` to `TransactionCreditCardRequest`
- Add `NetworkTokenizationAttributesRequest` class
- Add validation error codes:
- `CREDIT_CARD_NETWORK_TOKENIZATION_ATTRIBUTE_CRYPTOGRAM_IS_REQUIRED`
- Add `fail_on_duplicate_payment_method_for_customer` option to
- `ClientToken`
- `PaymentMethod`
- `CreditCard`
- Fix billing address bug for credit card verification.
- Add `blik_aliases` to LocalPaymentCompleted webhook and LocalPaymentDetail
- Deprecate `SamsungPayCard`
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/braintree/braintree_dotnet</PackageProjectUrl>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
Expand Down
4 changes: 4 additions & 0 deletions src/Braintree/ClientTokenGateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ private void VerifyOptions(ClientTokenRequest request)
{
invalidOptions.Add("FailOnDuplicatePaymentMethod");
}
if (request.Options.FailOnDuplicatePaymentMethodForCustomer != null)
{
invalidOptions.Add("FailOnDuplicatePaymentMethodForCustomer");
}

if (invalidOptions.Count != 0)
{
Expand Down
8 changes: 5 additions & 3 deletions src/Braintree/ClientTokenOptionsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ namespace Braintree
{
public class ClientTokenOptionsRequest : Request
{
public bool? FailOnDuplicatePaymentMethod { get; set; }
public bool? FailOnDuplicatePaymentMethodForCustomer { get; set; }
public bool? MakeDefault { get; set; }
public bool? VerifyCard { get; set; }
public bool? FailOnDuplicatePaymentMethod { get; set; }

public override string ToXml(string root)
{
Expand All @@ -21,9 +22,10 @@ public override string ToQueryString(string root)
protected virtual RequestBuilder BuildRequest(string root)
{
return new RequestBuilder(root).
AddElement("fail-on-duplicate-payment-method", FailOnDuplicatePaymentMethod).
AddElement("fail-on-duplicate-payment-method-for-customer", FailOnDuplicatePaymentMethodForCustomer).
AddElement("make-default", MakeDefault).
AddElement("verify-card", VerifyCard).
AddElement("fail-on-duplicate-payment-method", FailOnDuplicatePaymentMethod);
AddElement("verify-card", VerifyCard);
}
}
}
2 changes: 2 additions & 0 deletions src/Braintree/CreditCardOptionsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Braintree
public class CreditCardOptionsRequest : Request
{
public bool? FailOnDuplicatePaymentMethod { get; set; }
public bool? FailOnDuplicatePaymentMethodForCustomer { get; set; }
public bool? MakeDefault { get; set; }
public bool? SkipAdvancedFraudChecking { get; set; }
public bool? VerifyCard { get; set; }
Expand Down Expand Up @@ -34,6 +35,7 @@ protected virtual RequestBuilder BuildRequest(string root)
{
return new RequestBuilder(root).
AddElement("fail-on-duplicate-payment-method", FailOnDuplicatePaymentMethod).
AddElement("fail-on-duplicate-payment-method-for-customer", FailOnDuplicatePaymentMethodForCustomer).
AddElement("make-default", MakeDefault).
AddElement("skip-advanced-fraud-checking", SkipAdvancedFraudChecking).
AddElement("update-existing-token", UpdateExistingToken).
Expand Down
6 changes: 6 additions & 0 deletions src/Braintree/CreditCardVerificationRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ namespace Braintree
{
public class CreditCardVerificationCreditCardRequest : BaseCreditCardRequest {
public CreditCardAddressRequest BillingAddress { get; set; }

protected override RequestBuilder BuildRequest(string root)
{
return base.BuildRequest(root).
AddElement("billing-address", BillingAddress);
}
}

public class CreditCardVerificationRequest : Request {
Expand Down
7 changes: 7 additions & 0 deletions src/Braintree/LocalPaymentCompleted.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;

namespace Braintree
{
public class LocalPaymentCompleted
{
public virtual string Bic { get; protected set; }
public virtual List<BlikAlias> BlikAliases { get; protected set; }
public virtual string IbanLastChars { get; protected set; }
public virtual string PayerId { get; protected set; }
public virtual string PayerName { get; protected set; }
Expand All @@ -26,6 +28,11 @@ protected internal LocalPaymentCompleted(NodeWrapper node, IBraintreeGateway gat
{
Transaction = new Transaction(transactionNode, gateway);
}

BlikAliases = new List<BlikAlias>();
foreach (var blikAliasNode in node.GetList("blik-aliases/blik-alias")) {
BlikAliases.Add(new BlikAlias(blikAliasNode));
}
}

[Obsolete("Mock Use Only")]
Expand Down
7 changes: 7 additions & 0 deletions src/Braintree/LocalPaymentDetails.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;

namespace Braintree
{
public class LocalPaymentDetails
{
public virtual List<BlikAlias> BlikAliases { get; protected set; }
public virtual string CaptureId { get; protected set; }
public virtual string CustomField { get; protected set; }
public virtual string DebugId { get; protected set; }
Expand Down Expand Up @@ -35,6 +37,11 @@ protected internal LocalPaymentDetails(NodeWrapper node)
RefundId = node.GetString("refund-id");
TransactionFeeAmount = node.GetString("transaction-fee-amount");
TransactionFeeCurrencyIsoCode = node.GetString("transaction-fee-currency-iso-code");

BlikAliases = new List<BlikAlias>();
foreach (var blikAliasNode in node.GetList("blik-aliases/blik-alias")) {
BlikAliases.Add(new BlikAlias(blikAliasNode));
}
}

[Obsolete("Mock Use Only")]
Expand Down
3 changes: 3 additions & 0 deletions src/Braintree/PaymentMethodGateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ private Result<PaymentMethod> ExtractResultFromResponse(NodeWrapper response)
}
else if (response.GetName() == "samsung-pay-card")
{
// NEXT_MAJOR_VERSION remove SamsungPayCard
#pragma warning disable 618
return new ResultImpl<SamsungPayCard>(response, gateway);
#pragma warning restore 618
}
else
{
Expand Down
10 changes: 6 additions & 4 deletions src/Braintree/PaymentMethodOptionsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ namespace Braintree
{
public class PaymentMethodOptionsRequest : Request
{
public PaymentMethodOptionsPayPalRequest OptionsPayPal { get; set; }
public UsBankAccountVerificationMethod? UsBankAccountVerificationMethod { get; set; }
public VerificationAddOns? VerificationAddOns { get; set; }
public bool? FailOnDuplicatePaymentMethod { get; set; }
public bool? FailOnDuplicatePaymentMethodForCustomer { get; set; }
public bool? MakeDefault { get; set; }
public PaymentMethodOptionsPayPalRequest OptionsPayPal { get; set; }
public bool? SkipAdvancedFraudChecking { get; set; }
public bool? VerifyCard { get; set; }
public UsBankAccountVerificationMethod? UsBankAccountVerificationMethod { get; set; }
public string VerificationAccountType { get; set; } // NEXT_MAJOR_VERSION - This should be an enum with [credit, debit]
public VerificationAddOns? VerificationAddOns { get; set; }
public string VerificationAmount { get; set; }
public string VerificationCurrencyIsoCode { get; set; }
public string VerificationMerchantAccountId { get; set; }
public bool? VerifyCard { get; set; }

public override string ToXml(string root)
{
Expand All @@ -30,6 +31,7 @@ protected virtual RequestBuilder BuildRequest(string root)
{
return new RequestBuilder(root).
AddElement("fail-on-duplicate-payment-method", FailOnDuplicatePaymentMethod).
AddElement("fail-on-duplicate-payment-method-for-customer", FailOnDuplicatePaymentMethodForCustomer).
AddElement("make-default", MakeDefault).
AddElement("paypal", OptionsPayPal).
AddElement("skip-advanced-fraud-checking", SkipAdvancedFraudChecking).
Expand Down
3 changes: 3 additions & 0 deletions src/Braintree/PaymentMethodParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public static PaymentMethod ParsePaymentMethod(NodeWrapper response, IBraintreeG
}
else if (response.GetName() == "samsung-pay-card")
{
// NEXT_MAJOR_VERSION remove SamsungPayCard
#pragma warning disable 618
return new SamsungPayCard(response, gateway);
#pragma warning restore 618
}
else if (response.GetName() == "sepa-debit-account")
{
Expand Down
4 changes: 2 additions & 2 deletions src/Braintree/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("5.27.0.0")]
[assembly: AssemblyFileVersion("5.27.0.0")]
[assembly: AssemblyVersion("5.28.0.0")]
[assembly: AssemblyFileVersion("5.28.0.0")]
3 changes: 3 additions & 0 deletions src/Braintree/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@ private T newInstanceFromResponse(NodeWrapper node, IBraintreeGateway gateway)
{
return new VisaCheckoutCard(node, gateway) as T;
}
#pragma warning disable 618
else if (typeof(T) == typeof(SamsungPayCard))
{
// NEXT_MAJOR_VERSION remove SamsungPayCard
return new SamsungPayCard(node, gateway) as T;
}
#pragma warning restore 618
else if (typeof(T) == typeof(UnknownPaymentMethod))
{
return new UnknownPaymentMethod(node) as T;
Expand Down
3 changes: 3 additions & 0 deletions src/Braintree/SamsungPayCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
using System;
using System.Collections.Generic;

// NEXT_MAJOR_VERSION remove this class
// SamsungPayCard has been deprecated
namespace Braintree
{
[Obsolete("SamsungPayCard has been deprecated", false)]
public class SamsungPayCard : PaymentMethod
{
public virtual string Bin { get; protected set; }
Expand Down
3 changes: 3 additions & 0 deletions src/Braintree/SamsungPayCardDetails.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using System;

// NEXT_MAJOR_VERSION remove this class
// SamsungPayCard has been deprecated
namespace Braintree
{
[Obsolete("SamsungPayCard has been deprecated", false)]
public class SamsungPayCardDetails
{
public virtual string Bin { get; protected set; }
Expand Down
1 change: 1 addition & 0 deletions src/Braintree/Test/Nonce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Nonce
public const string ProcessorDeclinedMasterCard = "fake-processor-declined-mastercard-nonce";
public const string ProcessorDeclinedVisa = "fake-processor-declined-visa-nonce";
public const string ProcessorFailureJCB = "fake-processor-failure-jcb-nonce";
// NEXT_MAJOR_VERSION SamsungPayCard has been deprecated, remove all associated nonces
public const string SamsungPayAmEx = "tokensam_fake_american_express";
public const string SamsungPayDiscover = "tokensam_fake_discover";
public const string SamsungPayMasterCard = "tokensam_fake_mastercard";
Expand Down
6 changes: 6 additions & 0 deletions src/Braintree/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ public class Transaction
public virtual string RetrievalReferenceNumber { get; protected set; }
public virtual List<String> RetryIds { get; protected set; }
public virtual RiskData RiskData { get; protected set; }
// NEXT_MAJOR_VERSION remove SamsungPayCardDetails
#pragma warning disable 618
public virtual SamsungPayCardDetails SamsungPayCardDetails { get; protected set; }
#pragma warning restore 618
public virtual string ScaExemptionRequested { get; protected set; }
public virtual SepaDirectDebitAccountDetails SepaDirectDebitAccountDetails { get; protected set; }
public virtual string SepaDirectDebitReturnCode { get; protected set; }
Expand Down Expand Up @@ -378,10 +381,13 @@ protected internal Transaction(NodeWrapper node, IBraintreeGateway gateway)
{
VisaCheckoutCardDetails = new VisaCheckoutCardDetails(visaCheckoutNode);
}
// NEXT_MAJOR_VERSION SamsungPayCard has been deprecated, remove all associated references
var samsungPayNode = node.GetNode("samsung-pay-card");
if (samsungPayNode != null)
{
#pragma warning disable 618
SamsungPayCardDetails = new SamsungPayCardDetails(samsungPayNode);
#pragma warning restore 618
}

var billingAddressNode = node.GetNode("billing");
Expand Down
3 changes: 3 additions & 0 deletions src/Braintree/ValidationErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public enum ValidationErrorCode

CLIENT_TOKEN_CUSTOMER_DOES_NOT_EXIST = 92804,
CLIENT_TOKEN_FAIL_ON_DUPLICATE_PAYMENT_METHOD_REQUIRES_CUSTOMER_ID = 92803,
CLIENT_TOKEN_FAIL_ON_DUPLICATE_PAYMENT_METHOD_FOR_CUSTOMER_REQUIRES_CUSTOMER_ID = 92805,
CLIENT_TOKEN_INVALID_DOMAIN_FORMAT = 92011,
CLIENT_TOKEN_MAKE_DEFAULT_REQUIRES_CUSTOMER_ID = 92801,
CLIENT_TOKEN_MERCHANT_ACCOUNT_DOES_NOT_EXIST = 92807,
Expand All @@ -98,6 +99,7 @@ public enum ValidationErrorCode
CREDIT_CARD_CVV_IS_REQUIRED = 81706,
CREDIT_CARD_CVV_VERIFICATION_FAILED = 81736,
CREDIT_CARD_DUPLICATE_CARD_EXISTS = 81724,
CREDIT_CARD_DUPLICATE_CARD_EXISTS_FOR_CUSTOMER = 81763,
CREDIT_CARD_EXPIRATION_DATE_CONFLICT = 91708,
CREDIT_CARD_EXPIRATION_DATE_IS_INVALID = 81710,
CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED = 81709,
Expand All @@ -106,6 +108,7 @@ public enum ValidationErrorCode
CREDIT_CARD_EXPIRATION_YEAR_IS_INVALID = 81713,
CREDIT_CARD_INVALID_PARAMS_FOR_CREDIT_CARD_UPDATE = 91745,
CREDIT_CARD_INVALID_VENMO_SDK_PAYMENT_METHOD_CODE = 91727,
CREDIT_CARD_LIMIT_EXCEEDED_FOR_DUPLICATE_PAYMENT_METHOD_CHECK_FOR_CUSTOMER = 81764,
CREDIT_CARD_NETWORK_TOKENIZATION_ATTRIBUTE_CRYPTOGRAM_IS_REQUIRED = 81762,
CREDIT_CARD_NUMBER_HAS_INVALID_LENGTH = 81716,
CREDIT_CARD_NUMBER_IS_INVALID = 81715,
Expand Down
Loading

0 comments on commit e56a663

Please sign in to comment.