Skip to content

Commit

Permalink
5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Aug 25, 2020
1 parent 34a5e8d commit 18dc68b
Show file tree
Hide file tree
Showing 271 changed files with 25,045 additions and 60,556 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ tags
.vs/
**/*.lock.json
large_file.png
test/fixtures/empty_file.png
84 changes: 83 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,86 @@
# 4.18.0
## 5.0.0
- Add `RequestTimeoutException` and `GatewayTimeoutException`
- Add `RISK_THRESHOLD` to GatewayRejectionReason constants
- Add `processedWithNetworkToken` to `Transaction`
- Add `isNetworkTokenized` to `CreditCard`
Breaking changes:
- Drop support for .NET Core versions less than 2.1 (v1.0, v1.3, v2.0, etc)
- Drop .NET Standard 1.3 from `TargetFrameworks`
- Remove deprecated `TransparentRedirect`, `iDEAL`, `Coinbase`, and `IbanAccount` classes
- Remove deprecated SEPA mandate and Europe Bank Account error codes, test payment method nonces, and payment intrument types
- Remove `ForwardedComments` from `Dispute`
- Remove `PayPalVaultWithoutUpgrade` from `PaymentMethodRequest`
- Remove deprecated validation error codes:
- `SEPA_BANK_ACCOUNT_ACCOUNT_HOLDER_NAME_IS_REQUIRED`
- `SEPA_BANK_ACCOUNT_BIC_IS_REQUIRED`
- `SEPA_BANK_ACCOUNT_IBAN_IS_REQUIRED`
- `SEPA_MANDATE_ACCOUNT_HOLDER_NAME_IS_REQUIRED`
- `SEPA_MANDATE_BIC_INVALID_CHARACTER`
- `SEPA_MANDATE_BIC_IS_REQUIRED`
- `SEPA_MANDATE_BIC_LENGTH_IS_INVALID`
- `SEPA_MANDATE_BIC_UNSUPPORTED_COUNTRY`
- `SEPA_MANDATE_BILLING_ADDRESS_CONFLICT`
- `SEPA_MANDATE_BILLING_ADDRESS_ID_IS_INVALID`
- `SEPA_MANDATE_IBAN_INVALID_CHARACTER`
- `SEPA_MANDATE_IBAN_INVALID_FORMAT`
- `SEPA_MANDATE_IBAN_IS_REQUIRED`
- `SEPA_MANDATE_IBAN_UNSUPPORTED_COUNTRY`
- `SEPA_MANDATE_LOCALE_IS_UNSUPPORTED`
- `SEPA_MANDATE_TYPE_IS_REQUIRED`
- `TRANSACTION_AMOUNT_DOES_NOT_MATCH_IDEAL_PAYMENT_AMOUNT`
- `TRANSACTION_IDEAL_PAYMENT_NOT_COMPLETE`
- `TRANSACTION_IDEAL_PAYMENTS_CANNOT_BE_VAULTED`
- `TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_MATCH_IDEAL_PAYMENT_MERCHANT_ACCOUNT`
- `TRANSACTION_ORDER_ID_DOES_NOT_MATCH_IDEAL_PAYMENT_ORDER_ID`
- `TRANSACTION_ORDER_ID_IS_REQUIRED_WITH_IDEAL_PAYMENT`
- Remove deprecated webhook kinds:
- `GRANTED_PAYMENT_INSTRUMENT_UPDATE`
- `IDEAL_PAYMENT_COMPLETE`
- `IDEAL_PAYMENT_FAILED`
- Rename `DownForMaintenanceException` to `ServiceUnavailableException`
- Transaction searches and Transaction Line Items FindAll calls throw `UnexpectedException` instead of `DownForMaintenance` when search response yields unexpected results
- Remove `UseStaticHttpClient` configuration option for .NET Core integrations
- Remove `MasterpassCard` payment method
- Remove `AmexExpressCheckoutCard` payment method
- Bump API version to support declined refund objects
- Convert custom `Enumeration` subclasses to C# `Enum` types (fixes #86):
- `CreditCardCardType`
- `CreditCardCommercial`
- `CreditCardCustomerLocation`
- `CreditCardDebit`
- `CreditCardDurbinRegulated`
- `CreditCardHealthcare`
- `CreditCardPayroll`
- `CreditCardPrepaid`
- `DisbursementType`
- `DisputeKind`
- `DisputeReason`
- `DisputeStatus`
- `DocumentUploadKind`
- `FundingDestination`
- `IndustryDataAdditionalChargeKind`
- `MerchantAccountStatus`
- `PaymentInstrumentType`
- `PlanDurationUnit`
- `ProcessorResponseType`
- `ShippingMethod`
- `SubscriptionDurationUnit`
- `SubscriptionSource`
- `SubscriptionStatus`
- `TransactionCreatedUsing`
- `TransactionEscrowStatus`
- `TransactionGatewayRejectionReason`
- `TransactionIndustryType`
- `TransactionLineItemKind`
- `TransactionSource`
- `TransactionStatus`
- `TransactionType`
- `UsBankAccountVerificationMethod`
- `UsBankAccountVerificationStatus`
- `VerificationStatus`
- `WebhookKind`

## 4.18.0
- Add `ThreeDSecurePassThru` to `CreditCard.create()`, `CreditCard.update()`, `Customer.create()`, `Customer.update()`, `PaymentMethod.create()` and `PaymentMethod.update()`
- Add ThreeDSecure test payment method nonces
- Add test `AuthenticationId`s
Expand Down
27 changes: 9 additions & 18 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,41 @@

## Development environment

The Makefile and Dockerfile will build images containing mono and dotnetcore 1.x and 2.x and will drop you to a terminal where you can run tests.
The Makefile and Dockerfile will build images containing mono and dotnetcore 3.1, and will drop you into a terminal where you can run tests.

```
make mono
```

```
make core
```

```
make core2
make core3
```

## Running tests

The unit specs can be run by anyone on any system, but the integration specs are meant to be run against a local development server of our gateway code. These integration specs are not meant for public consumption and will likely fail if run on your system. To run unit tests use rake (`rake mono:test:unit`, `rake core:test:unit` or `rake core2:test:unit`) or run the unit tests manually. Here is an example of how to run unit tests using the dotnet CLI tool from within /test/Braintree.Tests:
The unit specs can be run by anyone on any system, but the integration specs are meant to be run against a local development server of our gateway code. These integration specs are not meant for public consumption and will likely fail if run on your system. To run unit tests use rake (`rake mono:test:unit` or `rake core3:test:unit`) or run the unit tests manually. Here is an example of how to run unit tests using the dotnet CLI tool from within /test/Braintree.Tests:

#### On Mac OS X or Unix-like environment
```
dotnet restore
dotnet build -f netcoreapp1.0
dotnet test . -f netcoreapp1.0
```

Or for .NET Core 2.x:
For .NET Core 3.1:
```
dotnet restore
dotnet build -f netcoreapp2.0
dotnet test . -f netcoreapp2.0
dotnet test . -f netcoreapp3.1
```

#### On a Windows environment

```
dotnet restore
dotnet build
dotnet test .
```

## Adding new libraries and dependencies
.NET Framework dependencies need to be added to the .csproj in the `'$(TargetFramework)' == 'net452'` ItemGroup. .NET Standard 1.3 dependencies need to be added to the .csproj in the `'$(TargetFramework)' == 'netstandard1.3'` ItemGroup.
.NET Framework dependencies need to be added to the .csproj in the `'$(TargetFramework)' == 'net452'` ItemGroup. .NET Standard 2.0 dependencies need to be added to the .csproj in the `'$(TargetFramework)' == 'netstandard2.0'` ItemGroup.

## Cross-compatibility
We support .NET Framework 4.5.2+ and .NET Standard 1.3 (aka .NET Core 1.0). All new code and tests need to compile against both. If the standard library methods being used are not shared, use preprocessor directives:
We support .NET Framework 4.5.2+ and .NET Standard 2.0 (This is so we can continue to support NET Core 2.1. For more information, see Microsoft's docs on [NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard)). All new code and tests need to compile against both. If the standard library methods being used are not shared, use preprocessor directives:

```csharp
#if netcore
Expand All @@ -55,4 +46,4 @@ NetFramework.Method();
#end
```

You will need to use the dotnet tool to check that it compiles against .NET Standard 1.3.
You will need to use the dotnet tool to check that it compiles against .NET Standard 2.0.
6 changes: 0 additions & 6 deletions Dockerfile-core2

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile-core → Dockerfile-core3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM microsoft/dotnet:1-sdk
FROM mcr.microsoft.com/dotnet/core/sdk:3.1

RUN apt-get update
RUN apt-get -y install rake
Expand Down
11 changes: 5 additions & 6 deletions Dockerfile-mono
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM debian:stretch
FROM debian:buster

RUN apt-get update
RUN apt-get -y install rake gnupg curl

RUN apt-get -y install rake gnupg curl apt-transport-https dirmngr gnupg ca-certificates
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/debian stretch main" | tee /etc/apt/sources.list.d/mono-official.list
RUN echo "deb http://download.mono-project.com/repo/debian buster main" | tee /etc/apt/sources.list.d/mono-official.list
RUN apt-get update

RUN apt-get -y install mono-devel mono-complete mono-dbg referenceassemblies-pcl ca-certificates-mono mono-xsp4 mono-xbuild mono-vbnc binutils fsharp nuget libnewtonsoft-json-cil-dev libnewtonsoft-json5.0-cil
Expand All @@ -13,8 +12,8 @@ RUN apt-get -y install curl libunwind8 gettext apt-transport-https
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
RUN mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" | tee /etc/apt/sources.list.d/dotnetdev.list
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-buster-prod buster main" | tee /etc/apt/sources.list.d/dotnetdev.list
RUN apt-get update
RUN apt-get -y install dotnet-sdk-2.0.0
RUN apt-get -y install dotnet-sdk-3.1

WORKDIR /home/admin/bt/braintree-dotnet
20 changes: 7 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
.PHONY: console mono core core2 build build-mono build-core build-core2
.PHONY: console mono build build-mono build-core3

console: core2
console: core3

mono: build-mono
docker run -it -v="$(PWD):/home/admin/bt/braintree-dotnet" --net="host" braintree-dotnet-mono /bin/bash -l

core: build-core
docker run -it -v="$(PWD):/home/admin/bt/braintree-dotnet" --net="host" braintree-dotnet-core /bin/bash -l -c "dotnet restore;bash"
core3: build-core3
docker run -it -v="$(PWD):/home/admin/bt/braintree-dotnet" --net="host" braintree-dotnet-core3 /bin/bash -l -c "dotnet restore;bash"

core2: build-core2
docker run -it -v="$(PWD):/home/admin/bt/braintree-dotnet" --net="host" braintree-dotnet-core2 /bin/bash -l -c "dotnet restore;bash"

build: build-mono build-core
build: build-mono build-core3

build-mono:
docker build -t braintree-dotnet-mono -f Dockerfile-mono .

build-core:
docker build -t braintree-dotnet-core -f Dockerfile-core .

build-core2:
docker build -t braintree-dotnet-core2 -f Dockerfile-core2 .
build-core3:
docker build -t braintree-dotnet-core3 -f Dockerfile-core3 .
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ The Braintree .NET library provides integration access to the Braintree Gateway.
## Dependencies

* .NET Core 1.0, .NET Core 2.0, or .NET Framework 4.5.2+
* The Braintree .NET library targets Net Framework 4.5.2 and Net Standard 2.0. It is tested against .NET Framework 4.5.2 (via Mono) and NET Core 3.1.

## Versions

Braintree employs a deprecation policy for our SDKs. For more information on the statuses of an SDK check our [developer docs](http://developers.braintreepayments.com/reference/general/server-sdk-deprecation-policy).

| Major version number | Status | Released | Deprecated | Unsupported |
| -------------------- | ----------- | --------------- | ------------ | ------------ |
| 5.x.x | Active | August 2020 | TBA | TBA |
| 4.x.x | Inactive | March 2018 | June 2022 | June 2023 |
| 3.x.x | Unsupported | September 2016 | March 2018 | March 2018 |
| 2.x.x | Unsupported | April 2010 | March 2018 | March 2018 |
| 1.x.x | Unsupported | April 2010 | March 2018 | March 2018 |


## Quick Start Example

Expand Down Expand Up @@ -68,21 +81,6 @@ namespace BraintreeExample
}
```

## Static HTTP Client

In .NET core, if your integration does not require a Web Proxy or a custom Timeout setting, you can optimize your integration by re-using the same HTTP client instance.

```csharp
var gateway = new BraintreeGateway
{
Environment = Braintree.Environment.SANDBOX,
MerchantId = "the_merchant_id",
PublicKey = "a_public_key",
PrivateKey = "a_private_key"
};
gateway.Configuration.UseStaticHttpClient = true;
```

## Documentation

* [Official documentation](https://developers.braintreepayments.com/dotnet/sdk/server/overview)
Expand Down
Loading

0 comments on commit 18dc68b

Please sign in to comment.