Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Oct 19, 2020
1 parent 295b40a commit 309913e
Show file tree
Hide file tree
Showing 84 changed files with 633 additions and 3,760 deletions.
2 changes: 0 additions & 2 deletions ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ The Braintree SDK uses code from the following libraries:

* [builder](https://github.com/jimweirich/builder), MIT License
* [libxml-ruby](https://github.com/xml4r/libxml-ruby), MIT License
* [rspec](https://github.com/rspec/rspec), MIT License
* [rake](https://github.com/ruby/rake), MIT License
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
# Changelog

## 3.0.0

* Add `CreditCardVerification::GatewayRejectionReason`
* Memory improvements related to XML parsing (addresses #159)
* Breaking changes:
* Remove support for Transparent Redirect, Coinbase, iDEAL, Amex Express Checkout and Masterpass
* Rename `DownForMaintenanceError` to `ServiceUnavailableError`
* Update `Transaction.search` to raise an `UnexpectedError` if the search yields unexpected results
* Add `GatewayTimeoutError` and `RequestTimeoutError`
* Remove `ForgedQueryString` error
* Remove error codes:
* EuropeBankAccount.IBANIsRequired
* EuropeBankAccount.BICIsRequired
* EuropeBankAccount.AccountHolderNameIsRequired
* SEPAMandate.AccountHolderNameIsRequired
* SEPAMandate.BICIsRequired
* SEPAMandate.IBANIsRequired
* SEPAMandate.TypeIsRequired
* SEPAMandate.IBANInvalidCharacter
* SEPAMandate.BICInvalidCharacter
* SEPAMandate.BICLengthIsInvalid
* SEPAMandate.BICUnsupportedCountry
* SEPAMandate.IBANUnsupportedCountry
* SEPAMandate.IBANInvalidFormat
* SEPAMandate.LocaleIsUnsupported
* SEPAMandate.BillingAddressIsInvalid
* SEPAMandate.TypeIsInvalid
* Transaction.AmountDoesNotMatchIdealPaymentAmount
* Transaction.IdealPaymentNotComplete
* Transaction.IdealPaymentsCannotBeVaulted
* Transaction.MerchantAccountDoesNotMatchIdealPaymentMerchantAccount
* Transaction.OrderIdDoesNotMatchIdealPaymentOrderId
* Transaction.OrderIdIsRequiredWithIdealPayment
* TransactionLineItem.DiscountAmountMustBeGreaterThanZero
* TransactionLineItem.UnitTaxAmountMustBeGreaterThanZero
* Remove deprecated methods:
* Address#delete
* Address#update and Address#update!
* CreditCard.grant
* CreditCard#credit and CreditCard#credit!
* CreditCard#delete
* CreditCard#sale and CreditCard#sale!
* CreditCard#update and CreditCard#update!
* CreditCardGateway#grant
* Customer#default_credit_card
* Customer#sale and Customer#sale!
* Customer#update and Customer#update!
* Dispute#forwarded_comments
* Subscription#next_bill_amount
* Transaction#refund
* Transaction#refund_id
* Transaction#submit_for_settlement and Transaction#submit_for_settlement!
* Transaction#void and Transaction#void!
* Remove unused WebhookNotification::Kind::GrantedPaymentInstrumentUpdate
* Rename all Android Pay classes and methods to Google Pay
* Rename Dispute::HistoryEvent to Dispute::StatusHistory
* Update the following methods to return `Date`s instead of `Strings` (fixes #161):
* DisbursementDetails#disbursement_date
* StatusHistory#disbursement_date
* StatusHistory#effective_date
* Subscription#billing_period_end_date
* Subscription#billing_period_start_date
* Subscription#first_billing_date
* Subscription#next_billing_date
* Subscription#paid_through_date
* SubscriptionDetails#billing_period_end_date
* SubscriptionDetails#billing_period_start_date
* Bump API version to support declined refund objects
* Remove deprecated parameters:
- `device_session_id` from CreditCard#create, Transaction#sale, PaymentMethod#create, and Customer#create
- `fraud_merchant_id` from CreditCard#create, Transaction#sale, PaymentMethod#create, and Customer#create
- `recurring` from Transaction#sale
* Update builder dependency to >= 3.2.4
* Update libxml-ruby dependency to >= 3.2.0
* Update gemspec to require ruby >= 2.5.0

## 2.104.1

* Update `LocalPaymentCompleted` webhook to handle no transaction being created for unbranded local payment methods
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM debian:jessie
FROM debian:buster

RUN apt-get update
RUN apt-get -y install gnupg curl procps build-essential libxml2-dev
RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN curl -sSL https://get.rvm.io | bash
RUN bash -l -c "rvm requirements"
RUN bash -l -c "rvm install 2.4.4"
RUN bash -l -c "rvm install 2.5.8"
RUN bash -l -c "gem install bundler"

WORKDIR /braintree-ruby
19 changes: 5 additions & 14 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
source "https://rubygems.org"

gem 'builder', '2.1.2'

if RUBY_VERSION.start_with?('1.8')
gem 'libxml-ruby', '1.1.3'
gem 'json', '1.8.3'
else
gem 'libxml-ruby', '2.8.0'
end

gem 'rake_commit', '1.0.1'
gem 'rake', '10.3.2'
gem 'rspec', '3.1.0'
gem 'rspec_junit_formatter'
gem 'builder', '3.2.4'
gem 'libxml-ruby', '3.2.0'

group :development do
gem 'pry', '0.12.2'
gem 'pry', '0.13.1'
gem 'rake', '13.0.1'
gem 'rspec', '3.9.0'
end
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2017 Braintree, a division of PayPal, Inc.
Copyright (c) 2009-2020 Braintree, a division of PayPal, Inc.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ The Braintree gem provides integration access to the Braintree Gateway.
# Please Note
**The Payment Card Industry (PCI) Council has [mandated](https://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls) that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, Braintree is updating its services to require TLS 1.2 for all HTTPS connections. Braintree will also require HTTP/1.1 for all connections. Please see our [technical documentation](https://github.com/paypal/tls-update) for more information.**

## Dependencies

* builder
* libxml-ruby

## Installation

```ruby
Expand All @@ -22,6 +17,28 @@ Or add to your Gemfile:
gem 'braintree'
```

## Dependencies

* builder
* libxml-ruby

The Braintree Ruby SDK is tested against Ruby versions 2.5.8 and 2.7.2.

_The Ruby core development community has released [End-of-Life branches](https://www.ruby-lang.org/en/downloads/branches/) for Ruby versions lower than 2.5, and are no longer receiving security updates. As a result, Braintree no longer supports these versions of Ruby. **We have updated our gem specifications to reflect these updates.**_

## Versions

Braintree employs a deprecation policy for our SDKs. For more information on the statuses of an SDK check our [developer docs](https://developers.braintreepayments.com/reference/general/server-sdk-deprecation-policy). [Minimum supported versions](https://developers.braintreepayments.com/reference/general/best-practices/ruby#server-sdk-versions) are also available in our developer docs.

| Major version number | Status | Released | Deprecated | Unsupported |
| -------------------- | ----------- | ------------- | ------------ | ------------ |
| 3.x.x | Active | October 2020 | TBA | TBA |
| 2.x.x | Inactive | April 2010 | October 2022 | October 2023 |

## Documentation

* [Official documentation](https://developers.braintreepayments.com/start/hello-server/ruby)

## Quick Start Example

```ruby
Expand Down Expand Up @@ -90,10 +107,6 @@ end
We recommend using the bang methods when you assume that the data is valid and do not expect validations to fail.
Otherwise, we recommend using the non-bang methods.

## More Information

* [Documentation](https://developers.braintreepayments.com/ruby/sdk/server/overview)

## Developing (Docker)

The `Makefile` and `Dockerfile` will build an image containing the dependencies and drop you to a terminal where you can run tests.
Expand Down
7 changes: 0 additions & 7 deletions braintree-ruby.gems

This file was deleted.

9 changes: 6 additions & 3 deletions braintree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ require 'braintree/version'

Gem::Specification.new do |s|
s.name = "braintree"
s.summary = "Braintree Gateway Ruby Client Library"
s.description = "Ruby library for integrating with the Braintree Gateway"
s.summary = "Braintree Ruby Server SDK"
s.description = "Resources and tools for developers to integrate Braintree's global payments platform."
s.version = Braintree::Version::String
s.license = "MIT"
s.author = "Braintree"
s.email = "code@getbraintree.com"
s.homepage = "https://www.braintreepayments.com/"
s.files = Dir.glob ["README.rdoc", "LICENSE", "lib/**/*.{rb,crt}", "spec/**/*", "*.gemspec"]
s.add_dependency "builder", ">= 2.0.0"
s.add_dependency "builder", ">= 3.2.4"
s.add_dependency "libxml-ruby", ">= 3.2.0"
s.required_ruby_version = ">=2.5.0"
s.metadata = {
"bug_tracker_uri" => "https://github.com/braintree/braintree_ruby/issues",
"changelog_uri" => "https://github.com/braintree/braintree_ruby/blob/master/CHANGELOG.md",
"source_code_uri" => "https://github.com/braintree/braintree_ruby",
"documentation_uri" => "https://developers.braintreepayments.com/"
}
end

20 changes: 3 additions & 17 deletions lib/braintree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
require "braintree/address/country_names"
require "braintree/address_gateway"
require "braintree/advanced_search"
require "braintree/android_pay_card"
require "braintree/amex_express_checkout_card"
require "braintree/apple_pay"
require "braintree/apple_pay_card"
require "braintree/apple_pay_gateway"
Expand All @@ -41,7 +39,6 @@
require "braintree/bin_data"
require "braintree/client_token"
require "braintree/client_token_gateway"
require "braintree/coinbase_account"
require "braintree/configuration"
require "braintree/connected_merchant_status_transitioned"
require "braintree/connected_merchant_paypal_status_changed"
Expand All @@ -62,7 +59,7 @@
require "braintree/dispute"
require "braintree/dispute_gateway"
require "braintree/dispute/evidence"
require "braintree/dispute/history_event"
require "braintree/dispute/status_history"
require "braintree/dispute/transaction"
require "braintree/dispute/transaction_details"
require "braintree/document_upload"
Expand All @@ -72,9 +69,7 @@
require "braintree/errors"
require "braintree/gateway"
require "braintree/graphql_client"
require "braintree/ideal_payment"
require "braintree/ideal_payment_gateway"
require "braintree/transaction/ideal_payment_details"
require "braintree/google_pay_card"
require "braintree/local_payment_completed"
require "braintree/transaction/local_payment_details"
require "braintree/merchant"
Expand Down Expand Up @@ -108,8 +103,6 @@
require "braintree/revoked_payment_method_metadata"
require "braintree/paginated_collection"
require "braintree/paginated_result"
require "braintree/europe_bank_account"
require "braintree/europe_bank_account_gateway"
require "braintree/us_bank_account"
require "braintree/us_bank_account_verification"
require "braintree/us_bank_account_verification_gateway"
Expand All @@ -134,12 +127,10 @@
require "braintree/test_transaction"
require "braintree/transaction/address_details"
require "braintree/transaction/apple_pay_details"
require "braintree/transaction/android_pay_details"
require "braintree/transaction/amex_express_checkout_details"
require "braintree/transaction/coinbase_details"
require "braintree/transaction/credit_card_details"
require "braintree/transaction/customer_details"
require "braintree/transaction/disbursement_details"
require "braintree/transaction/google_pay_details"
require "braintree/transaction/paypal_details"
require "braintree/transaction/paypal_here_details"
require "braintree/transaction/subscription_details"
Expand All @@ -149,19 +140,15 @@
require "braintree/transaction/status_details"
require "braintree/transaction/venmo_account_details"
require "braintree/transaction/visa_checkout_card_details"
require "braintree/transaction/masterpass_card_details"
require "braintree/transaction/samsung_pay_card_details"
require "braintree/unknown_payment_method"
require "braintree/disbursement"
require "braintree/dispute_search"
require "braintree/transparent_redirect"
require "braintree/transparent_redirect_gateway"
require "braintree/validation_error"
require "braintree/validation_error_collection"
require "braintree/venmo_account"
require "braintree/version"
require "braintree/visa_checkout_card"
require "braintree/masterpass_card"
require "braintree/samsung_pay_card"
require "braintree/webhook_notification"
require "braintree/webhook_notification_gateway"
Expand All @@ -170,5 +157,4 @@
require "braintree/xml"
require "braintree/xml/generator"
require "braintree/xml/libxml"
require "braintree/xml/rexml"
require "braintree/xml/parser"
22 changes: 0 additions & 22 deletions lib/braintree/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,6 @@ def ==(other) # :nodoc:
id == other.id && customer_id == other.customer_id
end

# Deprecated. Use Braintree::Address.delete
def delete
warn "[DEPRECATED] delete as an instance method is deprecated. Please use Address.delete"
@gateway.address.delete(customer_id, self.id)
end

# Deprecated. Use Braintree::Address.update
def update(attributes)
warn "[DEPRECATED] update as an instance method is deprecated. Please use Address.update"
result = @gateway.address.update(customer_id, id, attributes)
if result.success?
copy_instance_variables_from_object result.address
end
result
end

# Deprecated. Use Braintree::Address.update!
def update!(attributes)
warn "[DEPRECATED] update! as an instance method is deprecated. Please use Address.update!"
return_object_or_raise(:address) { update(attributes) }
end

class << self
protected :new
end
Expand Down
40 changes: 0 additions & 40 deletions lib/braintree/amex_express_checkout_card.rb

This file was deleted.

6 changes: 6 additions & 0 deletions lib/braintree/base_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def set_instance_variables_from_hash(hash)
hash.each do |key, value|
if key == :global_id
instance_variable_set "@graphql_id", value
elsif key == :android_pay_cards
instance_variable_set "@google_pay_cards", value
elsif key == :android_pay_card
instance_variable_set "@google_pay_card", value
elsif key == :android_pay_details
instance_variable_set "@google_pay_details", value
end

instance_variable_set "@#{key}", value
Expand Down
Loading

0 comments on commit 309913e

Please sign in to comment.