braintree 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/braintree.gemspec +1 -1
  3. data/lib/braintree.rb +2 -1
  4. data/lib/braintree/account_updater_daily_report.rb +1 -1
  5. data/lib/braintree/address.rb +1 -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 +3 -3
  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 +2 -2
  19. data/lib/braintree/customer_search.rb +1 -1
  20. data/lib/braintree/disbursement.rb +1 -1
  21. data/lib/braintree/dispute.rb +1 -1
  22. data/lib/braintree/dispute_gateway.rb +2 -2
  23. data/lib/braintree/dispute_search.rb +2 -2
  24. data/lib/braintree/document_upload.rb +1 -1
  25. data/lib/braintree/error_codes.rb +7 -0
  26. data/lib/braintree/google_pay_card.rb +1 -1
  27. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  28. data/lib/braintree/graphql_client.rb +7 -7
  29. data/lib/braintree/http.rb +3 -3
  30. data/lib/braintree/local_payment_completed.rb +1 -1
  31. data/lib/braintree/local_payment_reversed.rb +19 -0
  32. data/lib/braintree/merchant.rb +1 -1
  33. data/lib/braintree/merchant_account.rb +1 -1
  34. data/lib/braintree/merchant_account_gateway.rb +1 -1
  35. data/lib/braintree/merchant_gateway.rb +1 -1
  36. data/lib/braintree/modification.rb +1 -1
  37. data/lib/braintree/oauth_credentials.rb +1 -1
  38. data/lib/braintree/oauth_gateway.rb +5 -5
  39. data/lib/braintree/payment_instrument_type.rb +10 -10
  40. data/lib/braintree/payment_method_gateway.rb +3 -3
  41. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  42. data/lib/braintree/plan.rb +1 -1
  43. data/lib/braintree/processor_response_types.rb +3 -3
  44. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  45. data/lib/braintree/samsung_pay_card.rb +1 -1
  46. data/lib/braintree/settlement_batch_summary.rb +2 -2
  47. data/lib/braintree/subscription.rb +6 -6
  48. data/lib/braintree/transaction.rb +32 -24
  49. data/lib/braintree/transaction_gateway.rb +23 -4
  50. data/lib/braintree/transaction_line_item.rb +1 -1
  51. data/lib/braintree/transaction_search.rb +3 -1
  52. data/lib/braintree/unknown_payment_method.rb +1 -1
  53. data/lib/braintree/us_bank_account.rb +3 -3
  54. data/lib/braintree/us_bank_account_verification.rb +1 -1
  55. data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
  56. data/lib/braintree/util.rb +4 -4
  57. data/lib/braintree/venmo_account.rb +1 -1
  58. data/lib/braintree/version.rb +1 -1
  59. data/lib/braintree/visa_checkout_card.rb +2 -2
  60. data/lib/braintree/webhook_notification.rb +28 -19
  61. data/lib/braintree/webhook_notification_gateway.rb +5 -5
  62. data/lib/braintree/webhook_testing_gateway.rb +10 -0
  63. data/lib/braintree/xml/generator.rb +5 -4
  64. data/lib/braintree/xml/libxml.rb +1 -1
  65. data/lib/braintree/xml/parser.rb +10 -10
  66. data/spec/integration/braintree/add_on_spec.rb +1 -1
  67. data/spec/integration/braintree/address_spec.rb +24 -24
  68. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  69. data/spec/integration/braintree/apple_pay_spec.rb +3 -3
  70. data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
  71. data/spec/integration/braintree/client_api/client_token_spec.rb +14 -14
  72. data/spec/integration/braintree/client_api/spec_helper.rb +5 -5
  73. data/spec/integration/braintree/credit_card_spec.rb +119 -119
  74. data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
  75. data/spec/integration/braintree/credit_card_verification_spec.rb +1 -1
  76. data/spec/integration/braintree/customer_search_spec.rb +8 -8
  77. data/spec/integration/braintree/customer_spec.rb +165 -165
  78. data/spec/integration/braintree/dispute_search_spec.rb +3 -3
  79. data/spec/integration/braintree/dispute_spec.rb +6 -6
  80. data/spec/integration/braintree/error_codes_spec.rb +1 -1
  81. data/spec/integration/braintree/http_spec.rb +2 -2
  82. data/spec/integration/braintree/merchant_account_spec.rb +25 -26
  83. data/spec/integration/braintree/merchant_spec.rb +12 -12
  84. data/spec/integration/braintree/oauth_spec.rb +11 -11
  85. data/spec/integration/braintree/payment_method_nonce_spec.rb +12 -12
  86. data/spec/integration/braintree/payment_method_spec.rb +165 -165
  87. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +9 -9
  88. data/spec/integration/braintree/paypal_account_spec.rb +28 -28
  89. data/spec/integration/braintree/samsung_pay_card_spec.rb +9 -9
  90. data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
  91. data/spec/integration/braintree/subscription_spec.rb +133 -133
  92. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  93. data/spec/integration/braintree/test_transaction_spec.rb +10 -10
  94. data/spec/integration/braintree/transaction_search_spec.rb +93 -67
  95. data/spec/integration/braintree/transaction_spec.rb +498 -344
  96. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +20 -20
  97. data/spec/integration/braintree/us_bank_account_spec.rb +6 -6
  98. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +7 -7
  99. data/spec/integration/braintree/us_bank_account_verification_spec.rb +8 -8
  100. data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
  101. data/spec/integration/spec_helper.rb +2 -2
  102. data/spec/oauth_test_helper.rb +1 -1
  103. data/spec/script/httpsd.rb +6 -6
  104. data/spec/spec_helper.rb +4 -3
  105. data/spec/unit/braintree/address_spec.rb +1 -1
  106. data/spec/unit/braintree/apple_pay_card_spec.rb +1 -1
  107. data/spec/unit/braintree/client_token_spec.rb +2 -2
  108. data/spec/unit/braintree/configuration_spec.rb +42 -42
  109. data/spec/unit/braintree/credit_card_spec.rb +7 -7
  110. data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
  111. data/spec/unit/braintree/credit_card_verification_spec.rb +2 -2
  112. data/spec/unit/braintree/customer_spec.rb +3 -3
  113. data/spec/unit/braintree/disbursement_spec.rb +7 -7
  114. data/spec/unit/braintree/dispute_spec.rb +8 -8
  115. data/spec/unit/braintree/error_result_spec.rb +5 -5
  116. data/spec/unit/braintree/errors_spec.rb +8 -8
  117. data/spec/unit/braintree/http_spec.rb +5 -5
  118. data/spec/unit/braintree/merchant_account_spec.rb +1 -1
  119. data/spec/unit/braintree/payment_method_spec.rb +1 -1
  120. data/spec/unit/braintree/paypal_account_spec.rb +2 -2
  121. data/spec/unit/braintree/resource_collection_spec.rb +9 -9
  122. data/spec/unit/braintree/subscription_search_spec.rb +1 -1
  123. data/spec/unit/braintree/successful_result_spec.rb +1 -1
  124. data/spec/unit/braintree/three_d_secure_info_spec.rb +1 -1
  125. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +3 -3
  126. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  127. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  128. data/spec/unit/braintree/transaction/paypal_details_spec.rb +1 -1
  129. data/spec/unit/braintree/transaction_search_spec.rb +12 -12
  130. data/spec/unit/braintree/transaction_spec.rb +25 -17
  131. data/spec/unit/braintree/util_spec.rb +18 -18
  132. data/spec/unit/braintree/validation_error_collection_spec.rb +36 -36
  133. data/spec/unit/braintree/webhook_notification_spec.rb +72 -56
  134. data/spec/unit/braintree/xml_spec.rb +31 -31
  135. metadata +3 -3
  136. data/lib/braintree/settlement_batch.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6f4e51f43d816075ea0d94fdf7b9c7cc93b66293d6f03eb2bf2c1b387f25f46
4
- data.tar.gz: b0318dcc9f2a0d539a2dd43090e93bd2deaaedc339a7fe56844714b3a2d0e794
3
+ metadata.gz: 85d22ee560b343f4bbd3f71272f4e9d5cfaa83672ddc36fceb9fc383b25772e3
4
+ data.tar.gz: 8d29ee6fcd9b7f6ccbab6680029b66c70e53867448b369af806feb454cfdb18c
5
5
  SHA512:
6
- metadata.gz: 5db81d38673b53ee88428054ede01e065ae0ff4399548ddddd951676e34dc5cde4ca87654a39f9f3ef3a50403974a895e4347c876d85139bea88937dadc5e55f
7
- data.tar.gz: 1bb19f771028a007c21da653a5efc1ca484f5c237da528eafab7bb783840973739df2c88cd7ea54ad21e1ec9bad592eebc62ff4eddf96965ba8307eccd91d6c4
6
+ metadata.gz: d35fdc8ebf0d555649b08e401b4b16f6ac58ee52ca3fdb6a0ce899b10a4c7b2db94873fdb940649941c105cf9ca44686a415a9760619be4e7f5d7d9b33883e81
7
+ data.tar.gz: 687c698cd56953bc23694112256bfe422b53e0a0f0697e5c6626567933ecaab332a1fc6732f4085747ef68178a1d76d6f76a372ec070feb365c8557db8301f51
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"
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"
@@ -71,6 +71,7 @@ require "braintree/gateway"
71
71
  require "braintree/graphql_client"
72
72
  require "braintree/google_pay_card"
73
73
  require "braintree/local_payment_completed"
74
+ require "braintree/local_payment_reversed"
74
75
  require "braintree/transaction/local_payment_details"
75
76
  require "braintree/merchant"
76
77
  require "braintree/merchant_gateway"
@@ -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
 
@@ -58,7 +58,7 @@ module Braintree
58
58
  end
59
59
 
60
60
  def self._new(*args) # :nodoc:
61
- self.new *args
61
+ self.new(*args)
62
62
  end
63
63
  end
64
64
  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
@@ -145,7 +145,7 @@ module Braintree
145
145
  def _fetch_expiring_between(formatted_start_date, formatted_end_date, ids) # :nodoc:
146
146
  response = @config.http.post(
147
147
  "#{@config.base_merchant_path}/payment_methods/all/expiring?start=#{formatted_start_date}&end=#{formatted_end_date}",
148
- :search => {:ids => ids}
148
+ :search => {:ids => ids},
149
149
  )
150
150
  attributes = response[:payment_methods]
151
151
  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
@@ -42,7 +42,7 @@ module Braintree
42
42
  end
43
43
 
44
44
  def self.credit!(customer_id, transaction_attributes)
45
- return_object_or_raise(:transaction){ credit(customer_id, transaction_attributes) }
45
+ return_object_or_raise(:transaction) { credit(customer_id, transaction_attributes) }
46
46
  end
47
47
 
48
48
  def self.delete(*args)
@@ -142,7 +142,7 @@ module Braintree
142
142
  end
143
143
 
144
144
  def self._new(*args) # :nodoc:
145
- self.new *args
145
+ self.new(*args)
146
146
  end
147
147
 
148
148
  def self._attributes # :nodoc:
@@ -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
 
@@ -68,7 +68,7 @@ module Braintree
68
68
  class << self
69
69
  protected :new
70
70
  def _new(*args) # :nodoc:
71
- self.new *args
71
+ self.new(*args)
72
72
  end
73
73
  end
74
74
 
@@ -25,7 +25,7 @@ module Braintree
25
25
  raise ArgumentError, "dispute_id cannot be blank" if dispute_id.nil? || dispute_id.to_s.strip == ""
26
26
  raise ArgumentError, "document_id_or_request cannot be blank" if document_id_or_request.nil?
27
27
 
28
- request = document_id_or_request.is_a?(Hash) ? document_id_or_request : { document_id: document_id_or_request }
28
+ request = document_id_or_request.is_a?(Hash) ? document_id_or_request : {document_id: document_id_or_request}
29
29
 
30
30
  raise ArgumentError, "document_id contains invalid characters" unless request[:document_id].to_s =~ /\A[\w-]+\z/
31
31
  raise ArgumentError, "document_id cannot be blank" if request[:document_id].nil? || dispute_id.to_s.strip == ""
@@ -55,7 +55,7 @@ module Braintree
55
55
  raise ArgumentError, "dispute_id cannot be blank" if dispute_id.nil? || dispute_id.to_s.strip == ""
56
56
  raise ArgumentError, "content_or_request cannot be blank" if content_or_request.nil?
57
57
 
58
- request = content_or_request.is_a?(String) ? { content: content_or_request } : content_or_request
58
+ request = content_or_request.is_a?(String) ? {content: content_or_request} : content_or_request
59
59
 
60
60
  raise ArgumentError, "content cannot be blank" if request[:content].nil? || request[:content].to_s.strip == ""
61
61
  raise ArgumentError, "request can only contain the keys [:content, :category, :sequence_number]" if (request.keys - [:category, :content, :sequence_number]).any?
@@ -5,7 +5,7 @@ module Braintree
5
5
  :customer_id,
6
6
  :id,
7
7
  :reference_number,
8
- :transaction_id
8
+ :transaction_id,
9
9
  )
10
10
 
11
11
  multiple_value_field :kind, :allows => Dispute::Kind::All
@@ -21,7 +21,7 @@ module Braintree
21
21
  :disbursement_date,
22
22
  :effective_date,
23
23
  :received_date,
24
- :reply_by_date
24
+ :reply_by_date,
25
25
  )
26
26
  end
27
27
  end
@@ -30,7 +30,7 @@ module Braintree
30
30
  class << self
31
31
  protected :new
32
32
  def _new(*args) # :nodoc:
33
- self.new *args
33
+ self.new(*args)
34
34
  end
35
35
  end
36
36
  end
@@ -271,6 +271,7 @@ module Braintree
271
271
  end
272
272
 
273
273
  module Transaction
274
+ AdjustmentAmountMustBeGreaterThanZero = "95605"
274
275
  AmountCannotBeNegative = "81501"
275
276
  AmountDoesNotMatch3DSecureAmount = "91585"
276
277
  AmountFormatIsInvalid = "81503" # Keep for backwards compatibility
@@ -322,6 +323,7 @@ module Braintree
322
323
  MerchantAccountIdDoesNotMatchSubscription = "915180"
323
324
  MerchantAccountIdIsInvalid = "91513"
324
325
  MerchantAccountIsSuspended = "91514"
326
+ NoNetAmountToPerformAuthAdjustment = "95606"
325
327
  OrderIdIsTooLong = "91501"
326
328
  PayPalAuthExpired = "91579"
327
329
  PayPalNotEnabled = "91576"
@@ -343,8 +345,11 @@ module Braintree
343
345
  ProcessorAuthorizationCodeCannotBeSet = "91519"
344
346
  ProcessorAuthorizationCodeIsInvalid = "81520"
345
347
  ProcessorDoesNotSupportAuths = "915104"
348
+ ProcessorDoesNotSupportAuthAdjustment = "915222"
346
349
  ProcessorDoesNotSupportCredits = "91546"
350
+ ProcessorDoesNotSupportIncrementalAuth = "915220"
347
351
  ProcessorDoesNotSupportMotoForCardType = "915195"
352
+ ProcessorDoesNotSupportPartialAuthReversal = "915221"
348
353
  ProcessorDoesNotSupportPartialSettlement = "915102"
349
354
  ProcessorDoesNotSupportUpdatingDescriptor = "915108"
350
355
  ProcessorDoesNotSupportUpdatingOrderId = "915107"
@@ -398,6 +403,8 @@ module Braintree
398
403
  ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "915197"
399
404
  ThreeDSecureXidIsRequired = "915115"
400
405
  TooManyLineItems = "915157"
406
+ TransactionIsNotEligibleForAdjustment = "915219"
407
+ TransactionMustBeInStateAuthorized = "915218"
401
408
  TransactionSourceIsInvalid = "915133"
402
409
  TypeIsInvalid = "91523"
403
410
  TypeIsRequired = "91524"
@@ -46,7 +46,7 @@ module Braintree
46
46
  end
47
47
 
48
48
  def self._new(*args) # :nodoc:
49
- self.new *args
49
+ self.new(*args)
50
50
  end
51
51
  end
52
52
  end
@@ -16,7 +16,7 @@ module Braintree
16
16
  class << self
17
17
  protected :new
18
18
  def _new(*args) # :nodoc:
19
- self.new *args
19
+ self.new(*args)
20
20
  end
21
21
  end
22
22
  end
@@ -4,9 +4,9 @@ module Braintree
4
4
  def initialize(config)
5
5
  @config = config
6
6
  @graphql_headers = {
7
- 'Accept' => 'application/json',
8
- 'Braintree-Version' => @config.graphql_api_version,
9
- 'Content-Type' => 'application/json'
7
+ "Accept" => "application/json",
8
+ "Braintree-Version" => @config.graphql_api_version,
9
+ "Content-Type" => "application/json"
10
10
  }
11
11
  end
12
12
 
@@ -14,9 +14,9 @@ module Braintree
14
14
  graphql_connection = _setup_connection(@config.graphql_server, @config.graphql_port)
15
15
 
16
16
  request = {}
17
- request['query'] = definition
18
- request['operationName'] = operationName if operationName
19
- request['variables'] = variables
17
+ request["query"] = definition
18
+ request["operationName"] = operationName if operationName
19
+ request["variables"] = variables
20
20
 
21
21
  response = _http_do Net::HTTP::Post, @config.graphql_base_url, request.to_json, nil, graphql_connection, @graphql_headers
22
22
  data = _parse_response(response)
@@ -27,7 +27,7 @@ module Braintree
27
27
 
28
28
  def _parse_response(response)
29
29
  body = response.body
30
- body = Zlib::GzipReader.new(StringIO.new(body)).read if response.header['Content-Encoding'] == "gzip"
30
+ body = Zlib::GzipReader.new(StringIO.new(body)).read if response.header["Content-Encoding"] == "gzip"
31
31
  JSON.parse(body, :symbolize_names => true)
32
32
  end
33
33
  end