braintree 3.1.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/braintree.gemspec +3 -3
  3. data/lib/braintree.rb +8 -1
  4. data/lib/braintree/account_updater_daily_report.rb +1 -1
  5. data/lib/braintree/address.rb +2 -1
  6. data/lib/braintree/apple_pay.rb +1 -1
  7. data/lib/braintree/apple_pay_card.rb +1 -1
  8. data/lib/braintree/apple_pay_options.rb +1 -1
  9. data/lib/braintree/authorization_adjustment.rb +1 -1
  10. data/lib/braintree/client_token.rb +1 -1
  11. data/lib/braintree/configuration.rb +11 -11
  12. data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
  13. data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
  14. data/lib/braintree/credit_card.rb +2 -2
  15. data/lib/braintree/credit_card_gateway.rb +14 -4
  16. data/lib/braintree/credit_card_verification.rb +5 -5
  17. data/lib/braintree/credit_card_verification_search.rb +1 -1
  18. data/lib/braintree/customer.rb +6 -4
  19. data/lib/braintree/customer_gateway.rb +2 -0
  20. data/lib/braintree/customer_search.rb +1 -1
  21. data/lib/braintree/disbursement.rb +1 -1
  22. data/lib/braintree/dispute.rb +15 -1
  23. data/lib/braintree/dispute/paypal_message.rb +15 -0
  24. data/lib/braintree/dispute_gateway.rb +2 -2
  25. data/lib/braintree/dispute_search.rb +3 -2
  26. data/lib/braintree/document_upload.rb +1 -1
  27. data/lib/braintree/error_codes.rb +12 -4
  28. data/lib/braintree/google_pay_card.rb +1 -1
  29. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  30. data/lib/braintree/graphql_client.rb +7 -7
  31. data/lib/braintree/http.rb +3 -3
  32. data/lib/braintree/local_payment_completed.rb +1 -1
  33. data/lib/braintree/local_payment_reversed.rb +19 -0
  34. data/lib/braintree/merchant.rb +1 -1
  35. data/lib/braintree/merchant_account.rb +1 -1
  36. data/lib/braintree/merchant_account_gateway.rb +1 -1
  37. data/lib/braintree/merchant_gateway.rb +1 -1
  38. data/lib/braintree/modification.rb +1 -1
  39. data/lib/braintree/oauth_credentials.rb +1 -1
  40. data/lib/braintree/oauth_gateway.rb +5 -5
  41. data/lib/braintree/payment_instrument_type.rb +10 -10
  42. data/lib/braintree/payment_method_gateway.rb +11 -8
  43. data/lib/braintree/payment_method_nonce.rb +1 -1
  44. data/lib/braintree/payment_method_nonce_details.rb +37 -0
  45. data/lib/braintree/payment_method_nonce_details_payer_info.rb +32 -0
  46. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  47. data/lib/braintree/plan.rb +1 -1
  48. data/lib/braintree/processor_response_types.rb +3 -3
  49. data/lib/braintree/resource_collection.rb +8 -3
  50. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  51. data/lib/braintree/risk_data.rb +3 -1
  52. data/lib/braintree/samsung_pay_card.rb +1 -1
  53. data/lib/braintree/settlement_batch_summary.rb +2 -2
  54. data/lib/braintree/subscription.rb +6 -6
  55. data/lib/braintree/test/credit_card.rb +1 -0
  56. data/lib/braintree/three_d_secure_info.rb +22 -12
  57. data/lib/braintree/transaction.rb +40 -24
  58. data/lib/braintree/transaction/installment.rb +28 -0
  59. data/lib/braintree/transaction/installment/adjustment.rb +33 -0
  60. data/lib/braintree/transaction_gateway.rb +27 -6
  61. data/lib/braintree/transaction_line_item.rb +1 -1
  62. data/lib/braintree/transaction_search.rb +3 -1
  63. data/lib/braintree/unknown_payment_method.rb +1 -1
  64. data/lib/braintree/us_bank_account.rb +3 -3
  65. data/lib/braintree/us_bank_account_verification.rb +1 -1
  66. data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
  67. data/lib/braintree/util.rb +4 -4
  68. data/lib/braintree/venmo_account.rb +1 -1
  69. data/lib/braintree/version.rb +1 -1
  70. data/lib/braintree/visa_checkout_card.rb +2 -2
  71. data/lib/braintree/webhook_notification.rb +30 -20
  72. data/lib/braintree/webhook_notification_gateway.rb +5 -5
  73. data/lib/braintree/webhook_testing_gateway.rb +30 -0
  74. data/lib/braintree/xml/generator.rb +5 -4
  75. data/lib/braintree/xml/libxml.rb +0 -1
  76. data/lib/braintree/xml/parser.rb +22 -12
  77. data/lib/braintree/xml/rexml.rb +70 -0
  78. data/spec/integration/braintree/add_on_spec.rb +1 -1
  79. data/spec/integration/braintree/address_spec.rb +28 -24
  80. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  81. data/spec/integration/braintree/apple_pay_spec.rb +3 -3
  82. data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
  83. data/spec/integration/braintree/client_api/client_token_spec.rb +14 -14
  84. data/spec/integration/braintree/client_api/spec_helper.rb +5 -5
  85. data/spec/integration/braintree/credit_card_spec.rb +213 -122
  86. data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
  87. data/spec/integration/braintree/credit_card_verification_spec.rb +1 -1
  88. data/spec/integration/braintree/customer_search_spec.rb +8 -8
  89. data/spec/integration/braintree/customer_spec.rb +433 -149
  90. data/spec/integration/braintree/dispute_search_spec.rb +28 -3
  91. data/spec/integration/braintree/dispute_spec.rb +6 -6
  92. data/spec/integration/braintree/error_codes_spec.rb +1 -1
  93. data/spec/integration/braintree/http_spec.rb +2 -2
  94. data/spec/integration/braintree/merchant_account_spec.rb +25 -26
  95. data/spec/integration/braintree/merchant_spec.rb +14 -14
  96. data/spec/integration/braintree/oauth_spec.rb +11 -11
  97. data/spec/integration/braintree/payment_method_nonce_spec.rb +26 -35
  98. data/spec/integration/braintree/payment_method_spec.rb +430 -149
  99. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +17 -13
  100. data/spec/integration/braintree/paypal_account_spec.rb +28 -28
  101. data/spec/integration/braintree/samsung_pay_card_spec.rb +9 -9
  102. data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
  103. data/spec/integration/braintree/subscription_spec.rb +133 -133
  104. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  105. data/spec/integration/braintree/test_transaction_spec.rb +10 -10
  106. data/spec/integration/braintree/transaction_search_spec.rb +93 -67
  107. data/spec/integration/braintree/transaction_spec.rb +752 -383
  108. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -26
  109. data/spec/integration/braintree/us_bank_account_spec.rb +6 -6
  110. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +7 -7
  111. data/spec/integration/braintree/us_bank_account_verification_spec.rb +8 -8
  112. data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
  113. data/spec/integration/spec_helper.rb +9 -3
  114. data/spec/oauth_test_helper.rb +1 -1
  115. data/spec/script/httpsd.rb +6 -6
  116. data/spec/spec_helper.rb +6 -3
  117. data/spec/unit/braintree/address_spec.rb +1 -1
  118. data/spec/unit/braintree/apple_pay_card_spec.rb +1 -1
  119. data/spec/unit/braintree/client_token_spec.rb +2 -2
  120. data/spec/unit/braintree/configuration_spec.rb +42 -42
  121. data/spec/unit/braintree/credit_card_spec.rb +13 -13
  122. data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
  123. data/spec/unit/braintree/credit_card_verification_spec.rb +8 -4
  124. data/spec/unit/braintree/customer_spec.rb +21 -10
  125. data/spec/unit/braintree/disbursement_spec.rb +7 -7
  126. data/spec/unit/braintree/dispute_search_spec.rb +1 -0
  127. data/spec/unit/braintree/dispute_spec.rb +34 -9
  128. data/spec/unit/braintree/error_result_spec.rb +5 -5
  129. data/spec/unit/braintree/errors_spec.rb +8 -8
  130. data/spec/unit/braintree/http_spec.rb +5 -5
  131. data/spec/unit/braintree/merchant_account_spec.rb +1 -1
  132. data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +31 -0
  133. data/spec/unit/braintree/payment_method_nonce_details_spec.rb +43 -0
  134. data/spec/unit/braintree/payment_method_spec.rb +1 -1
  135. data/spec/unit/braintree/paypal_account_spec.rb +2 -2
  136. data/spec/unit/braintree/resource_collection_spec.rb +30 -1
  137. data/spec/unit/braintree/risk_data_spec.rb +9 -5
  138. data/spec/unit/braintree/subscription_search_spec.rb +1 -1
  139. data/spec/unit/braintree/successful_result_spec.rb +1 -1
  140. data/spec/unit/braintree/three_d_secure_info_spec.rb +32 -14
  141. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +3 -3
  142. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  143. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  144. data/spec/unit/braintree/transaction/installment_spec.rb +25 -0
  145. data/spec/unit/braintree/transaction/paypal_details_spec.rb +1 -1
  146. data/spec/unit/braintree/transaction_search_spec.rb +12 -12
  147. data/spec/unit/braintree/transaction_spec.rb +25 -17
  148. data/spec/unit/braintree/util_spec.rb +18 -18
  149. data/spec/unit/braintree/validation_error_collection_spec.rb +36 -36
  150. data/spec/unit/braintree/webhook_notification_spec.rb +88 -56
  151. data/spec/unit/braintree/xml/rexml_spec.rb +51 -0
  152. data/spec/unit/braintree/xml_spec.rb +31 -31
  153. metadata +18 -8
  154. data/lib/braintree/settlement_batch.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fd29c86922c84315bcc22c0318136adefa3b5023ffec6b805578ad9e9f9be0d
4
- data.tar.gz: f35f8eef6ccc321816005117c7bd0323a3b1d1e707ddc93ea082f43597ad75e6
3
+ metadata.gz: d934c307cf9a97cf867edc42477230eba5680d7183c73ce691aef287abbb01d6
4
+ data.tar.gz: b817ec7febb2c2e050c2ed3a19820e67b93890a34211fc5364ba4fc0f1487778
5
5
  SHA512:
6
- metadata.gz: a286c7e29b1f24de08aa3da6818f6061904f1ab52f581c44b7ce80e37fc7ff42a54a5bdcf39a70255c53965a3e580965d07677a56053d643652a56d39aef1f80
7
- data.tar.gz: 7b9f4bef3725bd17dac212babe68a9382a23bde7bacb458c5ca970c2137d374792a84247c222168f5e68518f22917891efd1720d90e2786e85e3a1ba40edd6e1
6
+ metadata.gz: d527fd7a32ac2240f108531ad040d6525ecc7a87fd23e18b5de3e4674ebc1daf7197ccb260ecad6e58bd6ed77132aac25249ed90f1d3e630054c3995eb28171e
7
+ data.tar.gz: 2e8ff42991a0120a0aef55705780b0659576b550cb62c6f499f44011c5b7bab441d64f3d6ad3ee27dd6f16b2787e24f849d01d8429c7bcf415d356e621cee81f
data/braintree.gemspec CHANGED
@@ -1,5 +1,5 @@
1
1
  $:.push File.expand_path("../lib", __FILE__)
2
- require 'braintree/version'
2
+ require "braintree/version"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "braintree"
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
  s.homepage = "https://www.braintreepayments.com/"
13
13
  s.files = Dir.glob ["README.rdoc", "LICENSE", "lib/**/*.{rb,crt}", "spec/**/*", "*.gemspec"]
14
14
  s.add_dependency "builder", ">= 3.2.4"
15
- s.add_dependency "libxml-ruby", ">= 3.2.0"
16
- s.required_ruby_version = ">=2.5.0"
15
+ s.add_dependency "rexml", ">= 3.1.9" # Use rexml version associated with minimum supported Ruby version
16
+ s.required_ruby_version = ">=2.6.0"
17
17
  s.metadata = {
18
18
  "bug_tracker_uri" => "https://github.com/braintree/braintree_ruby/issues",
19
19
  "changelog_uri" => "https://github.com/braintree/braintree_ruby/blob/master/CHANGELOG.md",
data/lib/braintree.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'base64'
1
+ require "base64"
2
2
  require "bigdecimal"
3
3
  require "cgi"
4
4
  require "date"
@@ -59,6 +59,7 @@ require "braintree/discount_gateway"
59
59
  require "braintree/dispute"
60
60
  require "braintree/dispute_gateway"
61
61
  require "braintree/dispute/evidence"
62
+ require "braintree/dispute/paypal_message"
62
63
  require "braintree/dispute/status_history"
63
64
  require "braintree/dispute/transaction"
64
65
  require "braintree/dispute/transaction_details"
@@ -71,6 +72,7 @@ require "braintree/gateway"
71
72
  require "braintree/graphql_client"
72
73
  require "braintree/google_pay_card"
73
74
  require "braintree/local_payment_completed"
75
+ require "braintree/local_payment_reversed"
74
76
  require "braintree/transaction/local_payment_details"
75
77
  require "braintree/merchant"
76
78
  require "braintree/merchant_gateway"
@@ -86,6 +88,8 @@ require "braintree/payment_instrument_type"
86
88
  require "braintree/payment_method"
87
89
  require "braintree/payment_method_gateway"
88
90
  require "braintree/payment_method_nonce"
91
+ require "braintree/payment_method_nonce_details"
92
+ require "braintree/payment_method_nonce_details_payer_info"
89
93
  require "braintree/payment_method_nonce_gateway"
90
94
  require "braintree/payment_method_parser"
91
95
  require "braintree/paypal_account"
@@ -141,6 +145,8 @@ require "braintree/transaction/status_details"
141
145
  require "braintree/transaction/venmo_account_details"
142
146
  require "braintree/transaction/visa_checkout_card_details"
143
147
  require "braintree/transaction/samsung_pay_card_details"
148
+ require "braintree/transaction/installment"
149
+ require "braintree/transaction/installment/adjustment"
144
150
  require "braintree/unknown_payment_method"
145
151
  require "braintree/disbursement"
146
152
  require "braintree/dispute_search"
@@ -157,4 +163,5 @@ require "braintree/webhook_testing_gateway"
157
163
  require "braintree/xml"
158
164
  require "braintree/xml/generator"
159
165
  require "braintree/xml/libxml"
166
+ require "braintree/xml/rexml"
160
167
  require "braintree/xml/parser"
@@ -8,7 +8,7 @@ module Braintree
8
8
  class << self
9
9
  protected :new
10
10
  def _new(*args) # :nodoc:
11
- self.new *args
11
+ self.new(*args)
12
12
  end
13
13
  end
14
14
 
@@ -14,6 +14,7 @@ module Braintree
14
14
  attr_reader :id
15
15
  attr_reader :last_name
16
16
  attr_reader :locality
17
+ attr_reader :phone_number
17
18
  attr_reader :postal_code
18
19
  attr_reader :region
19
20
  attr_reader :street_address
@@ -58,7 +59,7 @@ module Braintree
58
59
  end
59
60
 
60
61
  def self._new(*args) # :nodoc:
61
- self.new *args
62
+ self.new(*args)
62
63
  end
63
64
  end
64
65
  end
@@ -11,7 +11,7 @@ module Braintree
11
11
  end
12
12
 
13
13
  def self._new(*args) # :nodoc:
14
- self.new *args
14
+ self.new(*args)
15
15
  end
16
16
 
17
17
  def self.register_domain(domain)
@@ -45,7 +45,7 @@ module Braintree
45
45
  end
46
46
 
47
47
  def self._new(*args) # :nodoc:
48
- self.new *args
48
+ self.new(*args)
49
49
  end
50
50
  end
51
51
  end
@@ -13,7 +13,7 @@ module Braintree
13
13
  end
14
14
 
15
15
  def self._new(*args) # :nodoc:
16
- self.new *args
16
+ self.new(*args)
17
17
  end
18
18
  end
19
19
  end
@@ -12,7 +12,7 @@ module Braintree
12
12
  class << self
13
13
  protected :new
14
14
  def _new(*args) # :nodoc:
15
- self.new *args
15
+ self.new(*args)
16
16
  end
17
17
  end
18
18
 
@@ -1,4 +1,4 @@
1
- require 'json'
1
+ require "json"
2
2
 
3
3
  module Braintree
4
4
  module ClientToken
@@ -40,12 +40,12 @@ module Braintree
40
40
  ]
41
41
 
42
42
  class << self
43
- attr_writer *WRITABLE_ATTRIBUTES
44
- attr_reader *NON_REQUIRED_READABLE_ATTRIBUTES
43
+ attr_writer(*WRITABLE_ATTRIBUTES)
44
+ attr_reader(*NON_REQUIRED_READABLE_ATTRIBUTES)
45
45
  end
46
- attr_reader *READABLE_ATTRIBUTES
47
- attr_reader *NON_REQUIRED_READABLE_ATTRIBUTES
48
- attr_writer *WRITABLE_ATTRIBUTES
46
+ attr_reader(*READABLE_ATTRIBUTES)
47
+ attr_reader(*NON_REQUIRED_READABLE_ATTRIBUTES)
48
+ attr_writer(*WRITABLE_ATTRIBUTES)
49
49
 
50
50
  def self.expectant_reader(*attributes) # :nodoc:
51
51
  attributes.each do |attribute|
@@ -56,7 +56,7 @@ module Braintree
56
56
  end
57
57
  end
58
58
  end
59
- expectant_reader *READABLE_ATTRIBUTES
59
+ expectant_reader(*READABLE_ATTRIBUTES)
60
60
 
61
61
  # Sets the Braintree environment to use. Valid values are <tt>:sandbox</tt> and <tt>:production</tt>
62
62
  def self.environment=(env)
@@ -86,7 +86,7 @@ module Braintree
86
86
  :proxy_port => proxy_port,
87
87
  :proxy_user => proxy_user,
88
88
  :proxy_pass => proxy_pass,
89
- :ssl_version => ssl_version
89
+ :ssl_version => ssl_version,
90
90
  )
91
91
  end
92
92
 
@@ -205,7 +205,7 @@ module Braintree
205
205
  def port # :nodoc:
206
206
  case @environment
207
207
  when :development, :integration
208
- ENV['GATEWAY_PORT'] || 3000
208
+ ENV["GATEWAY_PORT"] || 3000
209
209
  when :production, :qa, :sandbox
210
210
  443
211
211
  end
@@ -214,7 +214,7 @@ module Braintree
214
214
  def graphql_port # :nodoc:
215
215
  case @environment
216
216
  when :development, :integration
217
- ENV['GRAPHQL_PORT'] || 8080
217
+ ENV["GRAPHQL_PORT"] || 8080
218
218
  when :production, :qa, :sandbox
219
219
  443
220
220
  end
@@ -235,7 +235,7 @@ module Braintree
235
235
  def server # :nodoc:
236
236
  case @environment
237
237
  when :development, :integration
238
- ENV['GATEWAY_HOST'] || "localhost"
238
+ ENV["GATEWAY_HOST"] || "localhost"
239
239
  when :production
240
240
  "#{endpoint}.braintreegateway.com"
241
241
  when :qa
@@ -248,7 +248,7 @@ module Braintree
248
248
  def graphql_server # :nodoc:
249
249
  case @environment
250
250
  when :development, :integration
251
- ENV['GRAPHQL_HOST'] || "graphql.bt.local"
251
+ ENV["GRAPHQL_HOST"] || "graphql.bt.local"
252
252
  when :production
253
253
  "payments.braintree-api.com"
254
254
  when :qa
@@ -15,7 +15,7 @@ module Braintree
15
15
  class << self
16
16
  protected :new
17
17
  def _new(*args) # :nodoc:
18
- self.new *args
18
+ self.new(*args)
19
19
  end
20
20
  end
21
21
  end
@@ -15,7 +15,7 @@ module Braintree
15
15
  class << self
16
16
  protected :new
17
17
  def _new(*args) # :nodoc:
18
- self.new *args
18
+ self.new(*args)
19
19
  end
20
20
  end
21
21
  end
@@ -123,7 +123,7 @@ module Braintree
123
123
  end
124
124
 
125
125
  def _most_recent_verification(attributes)
126
- verification = (attributes[:verifications] || []).sort_by{ |verification| verification[:created_at] }.reverse.first
126
+ verification = (attributes[:verifications] || []).sort_by { |verification| verification[:created_at] }.reverse.first
127
127
  CreditCardVerification._new(verification) if verification
128
128
  end
129
129
 
@@ -181,7 +181,7 @@ module Braintree
181
181
  end
182
182
 
183
183
  def self._new(*args) # :nodoc:
184
- self.new *args
184
+ self.new(*args)
185
185
  end
186
186
  end
187
187
  end
@@ -38,8 +38,8 @@ module Braintree
38
38
  end
39
39
 
40
40
  def expiring_between(start_date, end_date, options = {})
41
- formatted_start_date = start_date.strftime('%m%Y')
42
- formatted_end_date = end_date.strftime('%m%Y')
41
+ formatted_start_date = start_date.strftime("%m%Y")
42
+ formatted_end_date = end_date.strftime("%m%Y")
43
43
  response = @config.http.post("#{@config.base_merchant_path}/payment_methods/all/expiring_ids?start=#{formatted_start_date}&end=#{formatted_end_date}")
44
44
  ResourceCollection.new(response) { |ids| _fetch_expiring_between(formatted_start_date, formatted_end_date, ids) }
45
45
  end
@@ -79,7 +79,17 @@ module Braintree
79
79
 
80
80
  def self._signature(type) # :nodoc:
81
81
  billing_address_params = AddressGateway._shared_signature
82
- options = [:make_default, :verification_merchant_account_id, :verify_card, :verification_amount, :venmo_sdk_session, :fail_on_duplicate_payment_method, :verification_account_type]
82
+ options = [
83
+ :fail_on_duplicate_payment_method,
84
+ :make_default,
85
+ :skip_advanced_fraud_checking,
86
+ :venmo_sdk_session,
87
+ :verification_account_type,
88
+ :verification_amount,
89
+ :verification_currency_iso_code,
90
+ :verification_merchant_account_id,
91
+ :verify_card
92
+ ]
83
93
  signature = [
84
94
  :billing_address_id, :cardholder_name, :cvv, :expiration_date, :expiration_month,
85
95
  :expiration_year, :number, :token, :venmo_sdk_payment_method_code, :device_data,
@@ -145,7 +155,7 @@ module Braintree
145
155
  def _fetch_expiring_between(formatted_start_date, formatted_end_date, ids) # :nodoc:
146
156
  response = @config.http.post(
147
157
  "#{@config.base_merchant_path}/payment_methods/all/expiring?start=#{formatted_start_date}&end=#{formatted_end_date}",
148
- :search => {:ids => ids}
158
+ :search => {:ids => ids},
149
159
  )
150
160
  attributes = response[:payment_methods]
151
161
  Util.extract_attribute_as_array(attributes, :credit_card).map { |attrs| CreditCard._new(@gateway, attrs) }
@@ -17,10 +17,10 @@ module Braintree
17
17
  end
18
18
 
19
19
  module Status
20
- Failed = 'failed'
21
- GatewayRejected = 'gateway_rejected'
22
- ProcessorDeclined = 'processor_declined'
23
- Verified = 'verified'
20
+ Failed = "failed"
21
+ GatewayRejected = "gateway_rejected"
22
+ ProcessorDeclined = "processor_declined"
23
+ Verified = "verified"
24
24
 
25
25
  All = [Failed, GatewayRejected, ProcessorDeclined, Verified]
26
26
  end
@@ -92,7 +92,7 @@ module Braintree
92
92
  end
93
93
 
94
94
  def self._new(*args) # :nodoc:
95
- self.new *args
95
+ self.new(*args)
96
96
  end
97
97
 
98
98
  def self.find(*args)
@@ -6,7 +6,7 @@ module Braintree
6
6
  :customer_email,
7
7
  :customer_id,
8
8
  :id,
9
- :payment_method_token
9
+ :payment_method_token,
10
10
  )
11
11
 
12
12
  equality_fields :credit_card_expiration_date
@@ -19,6 +19,7 @@ module Braintree
19
19
  attr_reader :paypal_accounts
20
20
  attr_reader :phone
21
21
  attr_reader :samsung_pay_cards
22
+ attr_reader :tax_identifiers
22
23
  attr_reader :updated_at
23
24
  attr_reader :us_bank_accounts
24
25
  attr_reader :venmo_accounts
@@ -42,7 +43,7 @@ module Braintree
42
43
  end
43
44
 
44
45
  def self.credit!(customer_id, transaction_attributes)
45
- return_object_or_raise(:transaction){ credit(customer_id, transaction_attributes) }
46
+ return_object_or_raise(:transaction) { credit(customer_id, transaction_attributes) }
46
47
  end
47
48
 
48
49
  def self.delete(*args)
@@ -90,6 +91,7 @@ module Braintree
90
91
  @visa_checkout_cards = (@visa_checkout_cards|| []).map { |pm| VisaCheckoutCard._new gateway, pm }
91
92
  @samsung_pay_cards = (@samsung_pay_cards|| []).map { |pm| SamsungPayCard._new gateway, pm }
92
93
  @addresses = (@addresses || []).map { |addr| Address._new gateway, addr }
94
+ @tax_identifiers = (@tax_identifiers || []).map { |addr| TaxIdentifier._new gateway, addr }
93
95
  @custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
94
96
  end
95
97
 
@@ -124,7 +126,7 @@ module Braintree
124
126
 
125
127
  def inspect # :nodoc:
126
128
  first = [:id]
127
- last = [:addresses, :credit_cards, :paypal_accounts]
129
+ last = [:addresses, :credit_cards, :paypal_accounts, :tax_identifiers]
128
130
  order = first + (self.class._attributes - first - last) + last
129
131
  nice_attributes = order.map do |attr|
130
132
  "#{attr}: #{send(attr).inspect}"
@@ -142,13 +144,13 @@ module Braintree
142
144
  end
143
145
 
144
146
  def self._new(*args) # :nodoc:
145
- self.new *args
147
+ self.new(*args)
146
148
  end
147
149
 
148
150
  def self._attributes # :nodoc:
149
151
  [
150
152
  :addresses, :company, :credit_cards, :email, :fax, :first_name, :id, :last_name, :phone, :website,
151
- :created_at, :updated_at
153
+ :created_at, :updated_at, :tax_identifiers
152
154
  ]
153
155
  end
154
156
 
@@ -80,6 +80,7 @@ module Braintree
80
80
  {:risk_data => [:customer_browser, :customer_ip]},
81
81
  {:credit_card => credit_card_signature},
82
82
  {:paypal_account => paypal_account_signature},
83
+ {:tax_identifiers => [:country_code, :identifier]},
83
84
  {:options => options},
84
85
  {:custom_fields => :_any_key_}
85
86
  ]
@@ -141,6 +142,7 @@ module Braintree
141
142
  :company, :email, :fax, :first_name, :id, :last_name, :phone, :website,
142
143
  :device_data, :payment_method_nonce, :default_payment_method_token,
143
144
  {:credit_card => credit_card_signature},
145
+ {:tax_identifiers => [:country_code, :identifier]},
144
146
  {:options => options},
145
147
  {:custom_fields => :_any_key_}
146
148
  ]
@@ -19,7 +19,7 @@ module Braintree
19
19
  :payment_method_token,
20
20
  :paypal_account_email,
21
21
  :phone,
22
- :website
22
+ :website,
23
23
  )
24
24
 
25
25
  is_fields :payment_method_token_with_duplicates
@@ -52,7 +52,7 @@ module Braintree
52
52
  class << self
53
53
  protected :new
54
54
  def _new(*args) # :nodoc:
55
- self.new *args
55
+ self.new(*args)
56
56
  end
57
57
  end
58
58
 
@@ -7,6 +7,7 @@ module Braintree
7
7
  attr_reader :amount_disputed
8
8
  attr_reader :amount_won
9
9
  attr_reader :case_number
10
+ attr_reader :chargeback_protection_level
10
11
  attr_reader :created_at
11
12
  attr_reader :currency_iso_code
12
13
  attr_reader :date_opened
@@ -17,6 +18,7 @@ module Braintree
17
18
  attr_reader :kind
18
19
  attr_reader :merchant_account_id
19
20
  attr_reader :original_dispute_id
21
+ attr_reader :paypal_messages
20
22
  attr_reader :processor_comments
21
23
  attr_reader :reason
22
24
  attr_reader :reason_code
@@ -65,10 +67,18 @@ module Braintree
65
67
  All = constants.map { |c| const_get(c) }
66
68
  end
67
69
 
70
+ module ChargebackProtectionLevel
71
+ Effortless = "effortless"
72
+ Standard = "standard"
73
+ NotProtected = "not_protected"
74
+
75
+ All = constants.map { |c| const_get(c) }
76
+ end
77
+
68
78
  class << self
69
79
  protected :new
70
80
  def _new(*args) # :nodoc:
71
- self.new *args
81
+ self.new(*args)
72
82
  end
73
83
  end
74
84
 
@@ -114,6 +124,10 @@ module Braintree
114
124
  Braintree::Dispute::Evidence.new(record)
115
125
  end unless evidence.nil?
116
126
 
127
+ @paypal_messages = paypal_messages.map do |record|
128
+ Braintree::Dispute::PayPalMessage.new(record)
129
+ end unless paypal_messages.nil?
130
+
117
131
  @transaction_details = TransactionDetails.new(transaction)
118
132
  @transaction = Transaction.new(transaction)
119
133