Skip to content

Commit

Permalink
4.16.0
Browse files Browse the repository at this point in the history
Co-authored-by: Sara Vasquez <saravasquez@paypal.com>
Co-authored-by: Debra Do <debdo@paypal.com>
  • Loading branch information
3 people committed Nov 8, 2023
1 parent 35ec79f commit fe6ecf2
Show file tree
Hide file tree
Showing 152 changed files with 1,475 additions and 424 deletions.
199 changes: 199 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ Layout/IndentationStyle:
Layout/TrailingWhitespace:
Enabled: true

Lint/AmbiguousAssignment:
Enabled: true

Lint/AmbiguousBlockAssociation:
Enabled: true

Lint/AmbiguousOperator:
Enabled: true

Expand All @@ -57,9 +63,20 @@ Lint/CircularArgumentReference:
Lint/ConstantDefinitionInBlock:
Enabled: true

# NEXT_MAJOR_VERSION add ConstantResolution rule and start changing all constants to
# SCREAMING_SNAKE_CASE
Lint/ConstantResolution:
Enabled: false

Lint/Debugger:
Enabled: true

Lint/DeprecatedClassMethods:
Enabled: true

Lint/DeprecatedConstants:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Expand All @@ -78,6 +95,9 @@ Lint/DuplicateHashKey:
Lint/DuplicateMethods:
Enabled: true

Lint/DuplicateRegexpCharacterClassElement:
Enabled: true

Lint/DuplicateRequire:
Enabled: true

Expand All @@ -90,6 +110,15 @@ Lint/EachWithObjectArgument:
Lint/ElseLayout:
Enabled: true

Lint/EmptyBlock:
Enabled: true
AllowComments: true
Exclude:
- spec/integration/braintree/document_upload_spec.rb

Lint/EmptyClass:
Enabled: true

Lint/EmptyConditionalBody:
Enabled: true

Expand All @@ -111,6 +140,176 @@ Lint/EmptyWhen:
Lint/EnsureReturn:
Enabled: true

Lint/FlipFlop:
Enabled: true

Lint/FloatComparison:
Enabled: true

Lint/FloatOutOfRange:
Enabled: true

Lint/FormatParameterMismatch:
Enabled: true

Lint/HashCompareByIdentity:
Enabled: true

Lint/HeredocMethodCallPosition:
Enabled: true

Lint/IdentityComparison:
Enabled: true

Lint/ImplicitStringConcatenation:
Enabled: true

Lint/IneffectiveAccessModifier:
Enabled: true

Lint/InheritException:
Enabled: true

Lint/InterpolationCheck:
Enabled: true

Lint/LambdaWithoutLiteralBlock:
Enabled: true

Lint/LiteralAsCondition:
Enabled: true

Lint/LiteralInInterpolation:
Enabled: true

Lint/Loop:
Enabled: true

Lint/MissingCopEnableDirective:
Enabled: true

Lint/MultipleComparison:
Enabled: true

Lint/NestedMethodDefinition:
Enabled: true

Lint/NestedPercentLiteral:
Enabled: true

Lint/NextWithoutAccumulator:
Enabled: true

Lint/NonDeterministicRequireOrder:
Enabled: true

Lint/NoReturnInBeginEndBlocks:
Enabled: true

Lint/NonLocalExitFromIterator:
Enabled: true

Lint/NumberedParameterAssignment:
Enabled: true

Lint/OrAssignmentToConstant:
Enabled: true

Lint/OrderedMagicComments:
Enabled: true

Lint/OutOfRangeRegexpRef:
Enabled: true

Lint/ParenthesesAsGroupedExpression:
Enabled: true

Lint/PercentStringArray:
Enabled: true

Lint/PercentSymbolArray:
Enabled: true

Lint/RaiseException:
Enabled: true

Lint/RandOne:
Enabled: true

Lint/RedundantCopDisableDirective:
Enabled: true

Lint/RedundantCopEnableDirective:
Enabled: true

Lint/RedundantDirGlobSort:
Enabled: true

Lint/RedundantRequireStatement:
Enabled: true

Lint/RedundantSafeNavigation:
Enabled: true

Lint/RedundantSplatExpansion:
Enabled: true

Lint/RedundantStringCoercion:
Enabled: true

Lint/RedundantWithIndex:
Enabled: true

Lint/RedundantWithObject:
Enabled: true

Lint/RegexpAsCondition:
Enabled: true

Lint/RequireParentheses:
Enabled: true

Lint/RescueException:
Enabled: true

Lint/RescueType:
Enabled: true

Lint/ReturnInVoidContext:
Enabled: true

Lint/SafeNavigationChain:
Enabled: true

Lint/SafeNavigationConsistency:
Enabled: true

Lint/SafeNavigationWithEmpty:
Enabled: true

Lint/ScriptPermission:
Enabled: true

Lint/SelfAssignment:
Enabled: true

Lint/SendWithMixinArgument:
Enabled: true

Lint/ShadowedArgument:
Enabled: true

Lint/ShadowedException:
Enabled: true

Lint/ShadowingOuterLocalVariable:
Enabled: true
Exclude:
- spec/**/*

Lint/StructNewOverride:
Enabled: true

Lint/SuppressedException:
Enabled: false

Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Changelog

## 4.16.0

- Add `meta_checkout_card` and `meta_checkout_token` payment methods
- Add `meta_checkout_card_details` and `meta_checkout_token_details` to Transaction
- Add `industry_data` to `Transaction.submit_for_settlement` options
- Add `dateOfBirth` and `countryCode` parameters to `Transaction.sale.industry.data`
- Add `billing_address` and `shipping_address` to `VenmoProfileData`
- Add `additional_processor_response` to `UsBankAccountVerification`
- Add `verification_add_ons` to `PaymentMethod` create options for `ACH NetworkCheck`
- Add `Maestro` to `DebitNetwork` enum

## 4.15.0

- Add `retry_ids`, `retried_transaction_id`, and `debit_network` to `Transaction`
- Add `evidence_submittable` to Dispute
- Add `implicitly_vaulted_payment_method_token` and `implicitly_vaulted_payment_method_global_id` to `LocalPaymentDetails`
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ group :development do
gem "pry", "0.13.1"
gem "rake", "13.0.1"
gem "rspec", "3.9.0"
gem "rubocop", "~>1.12.0"
gem "rubocop", "1.50.2"
gem "webrick", "~>1.7.0"
end

Expand Down
5 changes: 4 additions & 1 deletion lib/braintree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "cgi"
require "date"
require "digest/sha1"
require "enumerator"
require "forwardable"
require "logger"
require "net/http"
Expand Down Expand Up @@ -91,6 +90,8 @@
require "braintree/merchant_account/business_details"
require "braintree/merchant_account/funding_details"
require "braintree/merchant_account/address_details"
require "braintree/meta_checkout_card"
require "braintree/meta_checkout_token"
require "braintree/oauth_gateway"
require "braintree/oauth_credentials"
require "braintree/payment_instrument_type"
Expand Down Expand Up @@ -153,6 +154,8 @@
require "braintree/transaction/payment_receipt"
require "braintree/transaction/payment_receipt/card_present_data.rb"
require "braintree/transaction/payment_receipt/merchant_address.rb"
require "braintree/transaction/meta_checkout_card_details"
require "braintree/transaction/meta_checkout_token_details"
require "braintree/transaction/paypal_details"
require "braintree/transaction/paypal_here_details"
require "braintree/transaction/samsung_pay_card_details"
Expand Down
6 changes: 3 additions & 3 deletions lib/braintree/account_updater_daily_report.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module Braintree
class AccountUpdaterDailyReport # :nodoc:
class AccountUpdaterDailyReport
include BaseModule

attr_reader :report_date
attr_reader :report_url

class << self
protected :new
def _new(*args) # :nodoc:
def _new(*args)
self.new(*args)
end
end

def initialize(attributes) # :nodoc:
def initialize(attributes)
set_instance_variables_from_hash(attributes)
@report_date = Date.parse(report_date)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/ach_mandate.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Braintree
class AchMandate
include BaseModule # :nodoc:
include BaseModule

attr_reader :accepted_at
attr_reader :text
Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/add_on_gateway.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Braintree
class AddOnGateway # :nodoc
class AddOnGateway
def initialize(gateway)
@gateway = gateway
@config = gateway.config
Expand Down
8 changes: 4 additions & 4 deletions lib/braintree/address.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Braintree
class Address
include BaseModule # :nodoc:
include BaseModule

attr_reader :company
attr_reader :country_code_alpha2
Expand Down Expand Up @@ -44,12 +44,12 @@ def self.update!(*args)
Configuration.gateway.address.update!(*args)
end

def initialize(gateway, attributes) # :nodoc:
def initialize(gateway, attributes)
@gateway = gateway
set_instance_variables_from_hash(attributes)
end

def ==(other) # :nodoc:
def ==(other)
return false unless other.is_a?(Address)
id == other.id && customer_id == other.customer_id
end
Expand All @@ -58,7 +58,7 @@ class << self
protected :new
end

def self._new(*args) # :nodoc:
def self._new(*args)
self.new(*args)
end
end
Expand Down
10 changes: 5 additions & 5 deletions lib/braintree/address_gateway.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Braintree
class AddressGateway # :nodoc
class AddressGateway
include BaseModule

def initialize(gateway)
Expand Down Expand Up @@ -62,25 +62,25 @@ def update!(*args)
return_object_or_raise(:address) { update(*args) }
end

def _determine_customer_id(customer_or_customer_id) # :nodoc:
def _determine_customer_id(customer_or_customer_id)
customer_id = customer_or_customer_id.is_a?(Customer) ? customer_or_customer_id.id : customer_or_customer_id
unless customer_id =~ /\A[\w_-]+\z/
raise ArgumentError, "customer_id contains invalid characters"
end
customer_id
end

def self._create_signature # :nodoc:
def self._create_signature
_shared_signature + [:customer_id]
end

def self._shared_signature # :nodoc:
def self._shared_signature
[:company, :country_code_alpha2, :country_code_alpha3, :country_code_numeric,
:country_name, :extended_address, :first_name, :last_name, :locality, :phone_number,
:postal_code, :region, :street_address]
end

def self._update_signature # :nodoc:
def self._update_signature
_create_signature
end
end
Expand Down
Loading

0 comments on commit fe6ecf2

Please sign in to comment.