braintree 2.60.0 → 2.61.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.
@@ -278,6 +278,7 @@ module Braintree
278
278
  CannotReleaseFromEscrow = "91561"
279
279
  CannotSimulateTransactionSettlement = "91575"
280
280
  CannotSubmitForSettlement = "91507"
281
+ CannotUpdateTransactionDetailsNotSubmittedForSettlement = "915129"
281
282
  ChannelIsTooLong = "91550"
282
283
  CreditCardIsRequired = "91508"
283
284
  CustomFieldIsInvalid = "91526"
@@ -313,6 +314,7 @@ module Braintree
313
314
  ProcessorDoesNotSupportAuths = "915104"
314
315
  ProcessorDoesNotSupportUpdatingOrderId = "915107"
315
316
  ProcessorDoesNotSupportUpdatingDescriptor = "915108"
317
+ ProcessorDoesNotSupportUpdatingTransactionDetails = "915130"
316
318
  ProcessorDoesNotSupportCredits = "91546"
317
319
  ProcessorDoesNotSupportPartialSettlement = "915102"
318
320
  ProcessorDoesNotSupportVoiceAuthorizations = "91545"
@@ -22,6 +22,8 @@ module Braintree # :nodoc:
22
22
 
23
23
  class SSLCertificateError < BraintreeError; end
24
24
 
25
+ class TooManyRequestsError < BraintreeError; end
26
+
25
27
  class UnexpectedError < BraintreeError; end
26
28
 
27
29
  class UpgradeRequiredError < BraintreeError; end
@@ -22,6 +22,8 @@ module Braintree
22
22
  :individual_details, :business_details, :funding_details,
23
23
  :currency_iso_code, :default
24
24
 
25
+ alias_method :default?, :default
26
+
25
27
  def self.create(attributes)
26
28
  Configuration.gateway.merchant_account.create(attributes)
27
29
  end
@@ -215,6 +215,14 @@ module Braintree
215
215
  return_object_or_raise(:transaction) { submit_for_settlement(transaction_id, amount, options) }
216
216
  end
217
217
 
218
+ def self.update_details(transaction_id, options = {})
219
+ Configuration.gateway.transaction.update_details(transaction_id, options)
220
+ end
221
+
222
+ def self.update_details!(transaction_id, options = {})
223
+ return_object_or_raise(:transaction) { update_details(transaction_id, options) }
224
+ end
225
+
218
226
  def self.submit_for_partial_settlement(authorized_transaction_id, amount = nil, options = {})
219
227
  Configuration.gateway.transaction.submit_for_partial_settlement(authorized_transaction_id, amount, options)
220
228
  end
@@ -106,6 +106,13 @@ module Braintree
106
106
  _handle_transaction_response(response)
107
107
  end
108
108
 
109
+ def update_details(transaction_id, options = {})
110
+ raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/
111
+ Util.verify_keys(TransactionGateway._update_details_signature, options)
112
+ response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/update_details", :transaction => options)
113
+ _handle_transaction_response(response)
114
+ end
115
+
109
116
  def submit_for_partial_settlement(authorized_transaction_id, amount = nil, options = {})
110
117
  raise ArgumentError, "authorized_transaction_id is invalid" unless authorized_transaction_id =~ /\A[0-9a-z]+\z/
111
118
  Util.verify_keys(TransactionGateway._submit_for_settlement_signature, options)
@@ -170,6 +177,14 @@ module Braintree
170
177
  ]
171
178
  end
172
179
 
180
+ def self._update_details_signature # :nodoc:
181
+ [
182
+ :amount,
183
+ :order_id,
184
+ {:descriptor => [:name, :phone, :url]},
185
+ ]
186
+ end
187
+
173
188
  def _do_create(path, params=nil) # :nodoc:
174
189
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
175
190
  _handle_transaction_response(response)
@@ -55,6 +55,8 @@ module Braintree
55
55
  raise NotFoundError
56
56
  when 426
57
57
  raise UpgradeRequiredError, "Please upgrade your client library."
58
+ when 429
59
+ raise TooManyRequestsError
58
60
  when 500
59
61
  raise ServerError
60
62
  when 503
@@ -1,7 +1,7 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 2
4
- Minor = 60
4
+ Minor = 61
5
5
  Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
@@ -1 +1 @@
1
- 21966
1
+ 28189
@@ -33,8 +33,8 @@ describe Braintree::AddOn do
33
33
 
34
34
  it "raises with a helpful error if public_key and private_key are not set" do
35
35
  gateway = Braintree::Gateway.new(
36
- :client_id => "client_id$development$integration_client_id",
37
- :client_secret => "client_secret$development$integration_client_secret",
36
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
37
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
38
38
  :logger => Logger.new("/dev/null")
39
39
  )
40
40
 
@@ -99,6 +99,16 @@ class ClientApiHttp
99
99
  raise Braintree::SSLCertificateError
100
100
  end
101
101
 
102
+ def _verify_ssl_certificate(preverify_ok, ssl_context)
103
+ if preverify_ok != true || ssl_context.error != 0
104
+ err_msg = "SSL Verification failed -- Preverify: #{preverify_ok}, Error: #{ssl_context.error_string} (#{ssl_context.error})"
105
+ @config.logger.error err_msg
106
+ false
107
+ else
108
+ true
109
+ end
110
+ end
111
+
102
112
  def get_payment_methods
103
113
  encoded_fingerprint = Braintree::Util.url_encode(@options[:authorization_fingerprint])
104
114
  url = "/merchants/#{@config.merchant_id}/client_api/v1/payment_methods?"
@@ -33,7 +33,7 @@ describe Braintree::CreditCardVerification, "search" do
33
33
  result = Braintree::CreditCardVerification.create(verification_params)
34
34
 
35
35
  result.success?.should == false
36
- result.verification.id.should =~ /^\w{6}$/
36
+ result.verification.id.should =~ /^\w{6,}$/
37
37
  result.verification.status.should == Braintree::CreditCardVerification::Status::ProcessorDeclined
38
38
  result.verification.processor_response_code.should == "2000"
39
39
  result.verification.processor_response_text.should == "Do Not Honor"
@@ -56,8 +56,8 @@ describe Braintree::Customer do
56
56
 
57
57
  it "returns a successful result if successful using an access token" do
58
58
  oauth_gateway = Braintree::Gateway.new(
59
- :client_id => "client_id$development$integration_client_id",
60
- :client_secret => "client_secret$development$integration_client_secret",
59
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
60
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
61
61
  :logger => Logger.new("/dev/null")
62
62
  )
63
63
  access_token = Braintree::OAuthTestHelper.create_token(oauth_gateway, {
@@ -90,30 +90,42 @@ describe Braintree::Http do
90
90
 
91
91
  describe "ssl verification" do
92
92
  it "rejects when the certificate isn't verified by our certificate authority (self-signed)" do
93
- config = Braintree::Configuration.instantiate
94
- config.stub(:ssl?).and_return(true)
95
- config.stub(:port).and_return(SSL_TEST_PORT)
96
-
97
- start_ssl_server do
98
- expect do
99
- config.http._http_do(Net::HTTP::Get, "/login")
100
- end.to raise_error(Braintree::SSLCertificateError)
93
+ begin
94
+ original_env = Braintree::Configuration.environment
95
+ Braintree::Configuration.environment = :development
96
+ config = Braintree::Configuration.instantiate
97
+ config.stub(:ssl?).and_return(true)
98
+ config.stub(:port).and_return(SSL_TEST_PORT)
99
+
100
+ start_ssl_server do
101
+ expect do
102
+ config.http._http_do(Net::HTTP::Get, "/login")
103
+ end.to raise_error(Braintree::SSLCertificateError)
104
+ end
105
+ ensure
106
+ Braintree::Configuration.environment = original_env
101
107
  end
102
108
  end
103
109
 
104
110
  it "rejects when the certificate is signed by a different (but valid) root CA" do
105
- # Random CA root file from a different certificate authority
106
- config = Braintree::Configuration.instantiate
107
- config.stub(:ca_file).and_return(
108
- File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "ssl", "geotrust_global.crt"))
109
- )
110
- config.stub(:ssl?).and_return(true)
111
- config.stub(:port).and_return(SSL_TEST_PORT)
112
-
113
- start_ssl_server do
114
- expect do
115
- config.http._http_do(Net::HTTP::Get, "/login")
116
- end.to raise_error(Braintree::SSLCertificateError)
111
+ begin
112
+ original_env = Braintree::Configuration.environment
113
+ Braintree::Configuration.environment = :development
114
+ # Random CA root file from a different certificate authority
115
+ config = Braintree::Configuration.instantiate
116
+ config.stub(:ca_file).and_return(
117
+ File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "ssl", "geotrust_global.crt"))
118
+ )
119
+ config.stub(:ssl?).and_return(true)
120
+ config.stub(:port).and_return(SSL_TEST_PORT)
121
+
122
+ start_ssl_server do
123
+ expect do
124
+ config.http._http_do(Net::HTTP::Get, "/login")
125
+ end.to raise_error(Braintree::SSLCertificateError)
126
+ end
127
+ ensure
128
+ Braintree::Configuration.environment = original_env
117
129
  end
118
130
  end
119
131
 
@@ -4,8 +4,8 @@ describe Braintree::MerchantGateway do
4
4
  describe "create" do
5
5
  it "creates a merchant" do
6
6
  gateway = Braintree::Gateway.new(
7
- :client_id => "client_id$development$integration_client_id",
8
- :client_secret => "client_secret$development$integration_client_secret",
7
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
8
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
9
9
  :logger => Logger.new("/dev/null")
10
10
  )
11
11
 
@@ -35,8 +35,8 @@ describe Braintree::MerchantGateway do
35
35
 
36
36
  it "gives an error when using invalid payment_methods" do
37
37
  gateway = Braintree::Gateway.new(
38
- :client_id => "client_id$development$integration_client_id",
39
- :client_secret => "client_secret$development$integration_client_secret",
38
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
39
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
40
40
  :logger => Logger.new("/dev/null")
41
41
  )
42
42
 
@@ -3,8 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
3
3
  describe "OAuth" do
4
4
  before(:each) do
5
5
  @gateway = Braintree::Gateway.new(
6
- :client_id => "client_id$development$integration_client_id",
7
- :client_secret => "client_secret$development$integration_client_secret",
6
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
7
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
8
8
  :logger => Logger.new("/dev/null")
9
9
  )
10
10
  end
@@ -87,6 +87,7 @@ describe "OAuth" do
87
87
  :redirect_uri => "http://bar.example.com",
88
88
  :scope => "read_write",
89
89
  :state => "baz_state",
90
+ :landing_page => "signup",
90
91
  :user => {
91
92
  :country => "USA",
92
93
  :email => "foo@example.com",
@@ -123,15 +124,16 @@ describe "OAuth" do
123
124
  )
124
125
 
125
126
  uri = URI.parse(url)
126
- uri.host.should == "localhost"
127
+ uri.host.should == Braintree::Configuration.instantiate.server
127
128
  uri.path.should == "/oauth/connect"
128
129
 
129
130
  query = CGI.parse(uri.query)
130
131
  query["merchant_id"].should == ["integration_merchant_id"]
131
- query["client_id"].should == ["client_id$development$integration_client_id"]
132
+ query["client_id"].should == ["client_id$#{Braintree::Configuration.environment}$integration_client_id"]
132
133
  query["redirect_uri"].should == ["http://bar.example.com"]
133
134
  query["scope"].should == ["read_write"]
134
135
  query["state"].should == ["baz_state"]
136
+ query["landing_page"].should == ["signup"]
135
137
 
136
138
  query["user[country]"].should == ["USA"]
137
139
  query["business[name]"].should == ["14 Ladders"]
@@ -179,7 +181,7 @@ describe "OAuth" do
179
181
  )
180
182
 
181
183
  uri = URI.parse(url)
182
- uri.host.should == "localhost"
184
+ uri.host.should == Braintree::Configuration.instantiate.server
183
185
  uri.path.should == "/oauth/connect"
184
186
 
185
187
  query = CGI.parse(CGI.unescape(uri.query))
@@ -191,6 +193,11 @@ describe "OAuth" do
191
193
 
192
194
  describe "_compute_signature" do
193
195
  it "computes the correct signature" do
196
+ @gateway = Braintree::Gateway.new(
197
+ :client_id => "client_id$development$integration_client_id",
198
+ :client_secret => "client_secret$development$integration_client_secret",
199
+ :logger => Logger.new("/dev/null")
200
+ )
194
201
  url = "http://localhost:3000/oauth/connect?business%5Bname%5D=We+Like+Spaces&client_id=client_id%24development%24integration_client_id"
195
202
  signature = @gateway.oauth._compute_signature(url)
196
203
 
@@ -1256,7 +1256,7 @@ describe Braintree::PaymentMethod do
1256
1256
  :merchant_id => "integration_merchant_public_id",
1257
1257
  :public_key => "oauth_app_partner_user_public_key",
1258
1258
  :private_key => "oauth_app_partner_user_private_key",
1259
- :environment => :development,
1259
+ :environment => Braintree::Configuration.environment,
1260
1260
  :logger => Logger.new("/dev/null")
1261
1261
  )
1262
1262
  customer = partner_merchant_gateway.customer.create(
@@ -1276,8 +1276,8 @@ describe Braintree::PaymentMethod do
1276
1276
  ).credit_card
1277
1277
 
1278
1278
  oauth_gateway = Braintree::Gateway.new(
1279
- :client_id => "client_id$development$integration_client_id",
1280
- :client_secret => "client_secret$development$integration_client_secret",
1279
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
1280
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
1281
1281
  :logger => Logger.new("/dev/null")
1282
1282
  )
1283
1283
  access_token = Braintree::OAuthTestHelper.create_token(oauth_gateway, {
@@ -92,10 +92,11 @@ describe Braintree::TestTransaction do
92
92
  end
93
93
 
94
94
  it "does not raise an exception when using non-global, non-production gateway" do
95
+ original_env = Braintree::Configuration.environment
95
96
  expect do
96
97
  in_prod do
97
98
  config = Braintree::Configuration.new(
98
- :environment => :development,
99
+ :environment => (original_env == :production ? :development : original_env),
99
100
  :merchant_id => 'integration_merchant_id',
100
101
  :public_key => 'integration_public_key',
101
102
  :private_key => 'integration_private_key',
@@ -140,7 +140,7 @@ describe Braintree::Transaction, "search" do
140
140
  search.user.is "integration_user_public_id"
141
141
  end
142
142
 
143
- collection.first.id.should == transaction.id
143
+ collection.any?{ |t| t.id == transaction.id }.should == true
144
144
  end
145
145
 
146
146
  it "searches on paypal transactions" do
@@ -837,7 +837,7 @@ describe Braintree::Transaction, "search" do
837
837
  search.dispute_date >= disputed_time - 1
838
838
  end
839
839
 
840
- collection.maximum_size.should == 2
840
+ collection.maximum_size.should == 1
841
841
  collection.first.id.should == transaction_id
842
842
 
843
843
  collection = Braintree::Transaction.search do |search|
@@ -887,7 +887,7 @@ describe Braintree::Transaction, "search" do
887
887
  search.dispute_date >= now - 60
888
888
  end
889
889
 
890
- collection.maximum_size.should == 2
890
+ collection.maximum_size.should == 1
891
891
  collection.first.id.should == transaction_id
892
892
 
893
893
  collection = Braintree::Transaction.search do |search|
@@ -255,7 +255,7 @@ describe Braintree::Transaction do
255
255
  }
256
256
  )
257
257
  result.success?.should == true
258
- result.transaction.id.should =~ /^\w{6}$/
258
+ result.transaction.id.should =~ /^\w{6,}$/
259
259
  result.transaction.type.should == "sale"
260
260
  result.transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
261
261
  result.transaction.processor_authorization_code.should_not be_nil
@@ -268,8 +268,8 @@ describe Braintree::Transaction do
268
268
 
269
269
  it "returns a successful result using an access token" do
270
270
  oauth_gateway = Braintree::Gateway.new(
271
- :client_id => "client_id$development$integration_client_id",
272
- :client_secret => "client_secret$development$integration_client_secret",
271
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
272
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
273
273
  :logger => Logger.new("/dev/null")
274
274
  )
275
275
  access_token = Braintree::OAuthTestHelper.create_token(oauth_gateway, {
@@ -292,7 +292,7 @@ describe Braintree::Transaction do
292
292
  )
293
293
 
294
294
  result.success?.should == true
295
- result.transaction.id.should =~ /^\w{6}$/
295
+ result.transaction.id.should =~ /^\w{6,}$/
296
296
  result.transaction.type.should == "sale"
297
297
  result.transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
298
298
  result.transaction.processor_authorization_code.should_not be_nil
@@ -349,7 +349,7 @@ describe Braintree::Transaction do
349
349
  }
350
350
  )
351
351
  result.success?.should == false
352
- result.transaction.id.should =~ /^\w{6}$/
352
+ result.transaction.id.should =~ /^\w{6,}$/
353
353
  result.transaction.type.should == "sale"
354
354
  result.transaction.status.should == Braintree::Transaction::Status::ProcessorDeclined
355
355
  result.transaction.processor_response_code.should == "2000"
@@ -500,8 +500,8 @@ describe Braintree::Transaction do
500
500
 
501
501
  it "exposes the application incomplete gateway rejection reason" do
502
502
  gateway = Braintree::Gateway.new(
503
- :client_id => "client_id$development$integration_client_id",
504
- :client_secret => "client_secret$development$integration_client_secret",
503
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
504
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
505
505
  :logger => Logger.new("/dev/null")
506
506
  )
507
507
  result = gateway.merchant.create(
@@ -1932,7 +1932,7 @@ describe Braintree::Transaction do
1932
1932
  :expiration_date => "05/2009"
1933
1933
  }
1934
1934
  )
1935
- transaction.id.should =~ /^\w{6}$/
1935
+ transaction.id.should =~ /^\w{6,}$/
1936
1936
  transaction.type.should == "sale"
1937
1937
  transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
1938
1938
  transaction.credit_card_details.bin.should == Braintree::Test::CreditCardNumbers::Visa[0, 6]
@@ -2052,7 +2052,7 @@ describe Braintree::Transaction do
2052
2052
  }
2053
2053
  )
2054
2054
  result.success?.should == true
2055
- result.transaction.id.should =~ /^\w{6}$/
2055
+ result.transaction.id.should =~ /^\w{6,}$/
2056
2056
  result.transaction.type.should == "sale"
2057
2057
  result.transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
2058
2058
  result.transaction.credit_card_details.bin.should == Braintree::Test::CreditCardNumbers::Visa[0, 6]
@@ -2105,7 +2105,7 @@ describe Braintree::Transaction do
2105
2105
  )
2106
2106
  result.success?.should == true
2107
2107
  transaction = result.transaction
2108
- transaction.id.should =~ /\A\w{6}\z/
2108
+ transaction.id.should =~ /\A\w{6,}\z/
2109
2109
  transaction.type.should == "sale"
2110
2110
  transaction.status.should == Braintree::Transaction::Status::Authorized
2111
2111
  transaction.amount.should == BigDecimal.new("100.00")
@@ -2599,7 +2599,7 @@ describe Braintree::Transaction do
2599
2599
  :expiration_date => "05/2009"
2600
2600
  }
2601
2601
  )
2602
- transaction.id.should =~ /^\w{6}$/
2602
+ transaction.id.should =~ /^\w{6,}$/
2603
2603
  transaction.type.should == "sale"
2604
2604
  transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
2605
2605
  transaction.credit_card_details.bin.should == Braintree::Test::CreditCardNumbers::Visa[0, 6]
@@ -2783,6 +2783,167 @@ describe Braintree::Transaction do
2783
2783
  end
2784
2784
  end
2785
2785
 
2786
+ describe "update details" do
2787
+ context "when status is submitted_for_settlement" do
2788
+ let(:transaction) do
2789
+ Braintree::Transaction.sale!(
2790
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
2791
+ :merchant_account_id => SpecHelper::DefaultMerchantAccountId,
2792
+ :descriptor => {
2793
+ :name => '123*123456789012345678',
2794
+ :phone => '3334445555',
2795
+ :url => "ebay.com"
2796
+ },
2797
+ :order_id => '123',
2798
+ :credit_card => {
2799
+ :number => Braintree::Test::CreditCardNumbers::Visa,
2800
+ :expiration_date => "06/2009"
2801
+ },
2802
+ :options => {
2803
+ :submit_for_settlement => true
2804
+ }
2805
+ )
2806
+ end
2807
+
2808
+ it "successfully updates details" do
2809
+ result = Braintree::Transaction.update_details(transaction.id, {
2810
+ :amount => Braintree::Test::TransactionAmounts::Authorize.to_f - 1,
2811
+ :descriptor => {
2812
+ :name => '456*123456789012345678',
2813
+ :phone => '3334445555',
2814
+ :url => "ebay.com",
2815
+ },
2816
+ :order_id => '456',
2817
+ })
2818
+ result.success?.should == true
2819
+ result.transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize) - 1
2820
+ result.transaction.order_id.should == '456'
2821
+ result.transaction.descriptor.name.should == '456*123456789012345678'
2822
+ end
2823
+
2824
+ it "raises an error when a key is invalid" do
2825
+ expect do
2826
+ Braintree::Transaction.update_details(transaction.id, {
2827
+ :invalid_key => Braintree::Test::TransactionAmounts::Authorize.to_f - 1,
2828
+ :descriptor => {
2829
+ :name => '456*123456789012345678',
2830
+ :phone => '3334445555',
2831
+ :url => "ebay.com",
2832
+ },
2833
+ :order_id => '456',
2834
+ })
2835
+ end.to raise_error(ArgumentError)
2836
+ end
2837
+
2838
+ describe "errors" do
2839
+ it "returns an error response when the settlement amount is invalid" do
2840
+ result = Braintree::Transaction.update_details(transaction.id, {
2841
+ :amount => "10000",
2842
+ :descriptor => {
2843
+ :name => '456*123456789012345678',
2844
+ :phone => '3334445555',
2845
+ :url => "ebay.com",
2846
+ },
2847
+ :order_id => '456',
2848
+ })
2849
+ result.success?.should == false
2850
+ result.errors.for(:transaction).on(:amount)[0].code.should == Braintree::ErrorCodes::Transaction::SettlementAmountIsTooLarge
2851
+ end
2852
+
2853
+ it "returns an error response when the descriptor is invalid" do
2854
+ result = Braintree::Transaction.update_details(transaction.id, {
2855
+ :amount => Braintree::Test::TransactionAmounts::Authorize.to_f - 1,
2856
+ :descriptor => {
2857
+ :name => 'invalid descriptor name',
2858
+ :phone => 'invalid phone',
2859
+ :url => '12345678901234'
2860
+ },
2861
+ :order_id => '456',
2862
+ })
2863
+ result.success?.should == false
2864
+ result.errors.for(:transaction).for(:descriptor).on(:name)[0].code.should == Braintree::ErrorCodes::Descriptor::NameFormatIsInvalid
2865
+ result.errors.for(:transaction).for(:descriptor).on(:phone)[0].code.should == Braintree::ErrorCodes::Descriptor::PhoneFormatIsInvalid
2866
+ result.errors.for(:transaction).for(:descriptor).on(:url)[0].code.should == Braintree::ErrorCodes::Descriptor::UrlFormatIsInvalid
2867
+ end
2868
+
2869
+ it "returns an error response when the order_id is invalid" do
2870
+ result = Braintree::Transaction.update_details(transaction.id, {
2871
+ :amount => Braintree::Test::TransactionAmounts::Authorize.to_f - 1,
2872
+ :descriptor => {
2873
+ :name => '456*123456789012345678',
2874
+ :phone => '3334445555',
2875
+ :url => "ebay.com",
2876
+ },
2877
+ :order_id => 'x' * 256,
2878
+ })
2879
+ result.success?.should == false
2880
+ result.errors.for(:transaction).on(:order_id)[0].code.should == Braintree::ErrorCodes::Transaction::OrderIdIsTooLong
2881
+ end
2882
+
2883
+ it "returns an error on an unsupported processor" do
2884
+ transaction = Braintree::Transaction.sale!(
2885
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
2886
+ :merchant_account_id => SpecHelper::FakeAmexDirectMerchantAccountId,
2887
+ :descriptor => {
2888
+ :name => '123*123456789012345678',
2889
+ :phone => '3334445555',
2890
+ :url => "ebay.com"
2891
+ },
2892
+ :order_id => '123',
2893
+ :credit_card => {
2894
+ :number => Braintree::Test::CreditCardNumbers::AmexPayWithPoints::Success,
2895
+ :expiration_date => "05/2009"
2896
+ },
2897
+ :options => {
2898
+ :submit_for_settlement => true
2899
+ }
2900
+ )
2901
+ result = Braintree::Transaction.update_details(transaction.id, {
2902
+ :amount => Braintree::Test::TransactionAmounts::Authorize.to_f - 1,
2903
+ :descriptor => {
2904
+ :name => '456*123456789012345678',
2905
+ :phone => '3334445555',
2906
+ :url => "ebay.com",
2907
+ },
2908
+ :order_id => '456',
2909
+ })
2910
+ result.success?.should == false
2911
+ result.errors.for(:transaction).on(:base)[0].code.should == Braintree::ErrorCodes::Transaction::ProcessorDoesNotSupportUpdatingTransactionDetails
2912
+ end
2913
+ end
2914
+ end
2915
+
2916
+ context "when status is not submitted_for_settlement" do
2917
+ it "returns an error" do
2918
+ transaction = Braintree::Transaction.sale!(
2919
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
2920
+ :merchant_account_id => SpecHelper::DefaultMerchantAccountId,
2921
+ :descriptor => {
2922
+ :name => '123*123456789012345678',
2923
+ :phone => '3334445555',
2924
+ :url => "ebay.com"
2925
+ },
2926
+ :order_id => '123',
2927
+ :credit_card => {
2928
+ :number => Braintree::Test::CreditCardNumbers::Visa,
2929
+ :expiration_date => "06/2009"
2930
+ },
2931
+ )
2932
+ result = Braintree::Transaction.update_details(transaction.id, {
2933
+ :amount => Braintree::Test::TransactionAmounts::Authorize.to_f - 1,
2934
+ :descriptor => {
2935
+ :name => '456*123456789012345678',
2936
+ :phone => '3334445555',
2937
+ :url => "ebay.com",
2938
+ },
2939
+ :order_id => '456',
2940
+ })
2941
+ result.success?.should == false
2942
+ result.errors.for(:transaction).on(:base)[0].code.should == Braintree::ErrorCodes::Transaction::CannotUpdateTransactionDetailsNotSubmittedForSettlement
2943
+ end
2944
+ end
2945
+
2946
+ end
2786
2947
 
2787
2948
  describe "submit for partial settlement" do
2788
2949
  it "successfully submits multiple times for partial settlement" do
@@ -3097,7 +3258,7 @@ describe Braintree::Transaction do
3097
3258
  }
3098
3259
  )
3099
3260
  result.success?.should == true
3100
- result.transaction.id.should =~ /^\w{6}$/
3261
+ result.transaction.id.should =~ /^\w{6,}$/
3101
3262
  result.transaction.type.should == "credit"
3102
3263
  result.transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
3103
3264
  result.transaction.credit_card_details.bin.should == Braintree::Test::CreditCardNumbers::Visa[0, 6]
@@ -3172,7 +3333,7 @@ describe Braintree::Transaction do
3172
3333
  :expiration_date => "05/2009"
3173
3334
  }
3174
3335
  )
3175
- transaction.id.should =~ /^\w{6}$/
3336
+ transaction.id.should =~ /^\w{6,}$/
3176
3337
  transaction.type.should == "credit"
3177
3338
  transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
3178
3339
  transaction.credit_card_details.bin.should == Braintree::Test::CreditCardNumbers::Visa[0, 6]
@@ -3300,7 +3461,7 @@ describe Braintree::Transaction do
3300
3461
  result = Braintree::Transaction.create_from_transparent_redirect(query_string_response)
3301
3462
 
3302
3463
  transaction = result.transaction
3303
- transaction.id.should =~ /\A\w{6}\z/
3464
+ transaction.id.should =~ /\A\w{6,}\z/
3304
3465
  transaction.type.should == "sale"
3305
3466
  transaction.status.should == Braintree::Transaction::Status::Authorized
3306
3467
  transaction.amount.should == BigDecimal.new("100.00")
@@ -4116,7 +4277,7 @@ describe Braintree::Transaction do
4116
4277
  :merchant_id => "integration_merchant_public_id",
4117
4278
  :public_key => "oauth_app_partner_user_public_key",
4118
4279
  :private_key => "oauth_app_partner_user_private_key",
4119
- :environment => :development,
4280
+ :environment => Braintree::Configuration.environment,
4120
4281
  :logger => Logger.new("/dev/null")
4121
4282
  )
4122
4283
  @customer = partner_merchant_gateway.customer.create(
@@ -4141,8 +4302,8 @@ describe Braintree::Transaction do
4141
4302
  ).credit_card
4142
4303
 
4143
4304
  oauth_gateway = Braintree::Gateway.new(
4144
- :client_id => "client_id$development$integration_client_id",
4145
- :client_secret => "client_secret$development$integration_client_secret",
4305
+ :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
4306
+ :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
4146
4307
  :logger => Logger.new("/dev/null")
4147
4308
  )
4148
4309
  access_token = Braintree::OAuthTestHelper.create_token(oauth_gateway, {
@@ -4164,7 +4325,7 @@ describe Braintree::Transaction do
4164
4325
  :amount => Braintree::Test::TransactionAmounts::Authorize
4165
4326
  )
4166
4327
  result.transaction.facilitator_details.should_not == nil
4167
- result.transaction.facilitator_details.oauth_application_client_id.should == "client_id$development$integration_client_id"
4328
+ result.transaction.facilitator_details.oauth_application_client_id.should == "client_id$#{Braintree::Configuration.environment}$integration_client_id"
4168
4329
  result.transaction.facilitator_details.oauth_application_name.should == "PseudoShop"
4169
4330
  end
4170
4331
 
@@ -4187,7 +4348,7 @@ describe Braintree::Transaction do
4187
4348
  :amount => Braintree::Test::TransactionAmounts::Authorize
4188
4349
  )
4189
4350
  result.transaction.facilitator_details.should_not == nil
4190
- result.transaction.facilitator_details.oauth_application_client_id.should == "client_id$development$integration_client_id"
4351
+ result.transaction.facilitator_details.oauth_application_client_id.should == "client_id$#{Braintree::Configuration.environment}$integration_client_id"
4191
4352
  result.transaction.facilitator_details.oauth_application_name.should == "PseudoShop"
4192
4353
  end
4193
4354
  end
@@ -23,7 +23,7 @@ unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
23
23
  end
24
24
 
25
25
  def create_modification_for_tests(attributes)
26
- config = Braintree::Configuration.gateway.config
26
+ config = Braintree::Configuration.instantiate
27
27
  config.http.post("#{config.base_merchant_path}/modifications/create_modification_for_tests", :modification => attributes)
28
28
  end
29
29
 
@@ -82,7 +82,7 @@ unless defined?(SPEC_HELPER_LOADED)
82
82
 
83
83
  TestMerchantConfig = Braintree::Configuration.new(
84
84
  :logger => Logger.new("/dev/null"),
85
- :environment => :development,
85
+ :environment => Braintree::Configuration.environment,
86
86
  :merchant_id => "test_merchant_id",
87
87
  :public_key => "test_public_key",
88
88
  :private_key => "test_private_key"
@@ -126,7 +126,9 @@ unless defined?(SPEC_HELPER_LOADED)
126
126
 
127
127
  def self.simulate_form_post_for_tr(tr_data_string, form_data_hash, url = Braintree::TransparentRedirect.url)
128
128
  response = nil
129
- Net::HTTP.start("localhost", Braintree::Configuration.instantiate.port) do |http|
129
+ config = Braintree::Configuration.instantiate
130
+ Net::HTTP.start(config.server, config.port) do |http|
131
+ http.use_ssl = config.ssl?
130
132
  request = Net::HTTP::Post.new("/" + url.split("/", 4)[3])
131
133
  request.add_field "Content-Type", "application/x-www-form-urlencoded"
132
134
  request.body = Braintree::Util.hash_to_query_string({:tr_data => tr_data_string}.merge(form_data_hash))
@@ -91,8 +91,8 @@ describe Braintree::CreditCard do
91
91
 
92
92
  describe "self.create_credit_card_url" do
93
93
  it "returns the url" do
94
- port = Braintree::Configuration.instantiate.port
95
- Braintree::CreditCard.create_credit_card_url.should == "http://localhost:#{port}/merchants/integration_merchant_id/payment_methods/all/create_via_transparent_redirect_request"
94
+ config = Braintree::Configuration.instantiate
95
+ Braintree::CreditCard.create_credit_card_url.should == "http#{config.ssl? ? 's' : ''}://#{config.server}:#{config.port}/merchants/integration_merchant_id/payment_methods/all/create_via_transparent_redirect_request"
96
96
  end
97
97
  end
98
98
 
@@ -20,5 +20,14 @@ describe Braintree::MerchantAccount do
20
20
  account.inspect.should == "#<Braintree::MerchantAccount: id: \"merchant_account\", status: \"active\", master_merchant_account: #{master_merchant_account}>"
21
21
  end
22
22
  end
23
+
24
+ describe "default?" do
25
+ it "is an alias of default" do
26
+ account = Braintree::MerchantAccount._new(nil, :default => false)
27
+ account.default?.should == false
28
+ account = Braintree::MerchantAccount._new(nil, :default => true)
29
+ account.default?.should == true
30
+ end
31
+ end
23
32
  end
24
33
 
@@ -47,8 +47,8 @@ describe Braintree::Transaction do
47
47
 
48
48
  describe "self.create_transaction_url" do
49
49
  it "returns the url" do
50
- port = Braintree::Configuration.instantiate.port
51
- Braintree::Transaction.create_transaction_url.should == "http://localhost:#{port}/merchants/integration_merchant_id/transactions/all/create_via_transparent_redirect_request"
50
+ config = Braintree::Configuration.instantiate
51
+ Braintree::Transaction.create_transaction_url.should == "http#{config.ssl? ? 's' : ''}://#{config.server}:#{config.port}/merchants/integration_merchant_id/transactions/all/create_via_transparent_redirect_request"
52
52
  end
53
53
  end
54
54
 
@@ -60,6 +60,14 @@ describe Braintree::Transaction do
60
60
  end
61
61
  end
62
62
 
63
+ describe "self.update_details" do
64
+ it "raises an ArgumentError if transaction_id is an invalid format" do
65
+ expect do
66
+ Braintree::Transaction.update_details("invalid-transaction-id")
67
+ end.to raise_error(ArgumentError, "transaction_id is invalid")
68
+ end
69
+ end
70
+
63
71
  describe "initialize" do
64
72
  it "sets up customer attributes in customer_details" do
65
73
  transaction = Braintree::Transaction._new(
@@ -218,6 +218,12 @@ describe Braintree::Util do
218
218
  end.to raise_error(Braintree::UpgradeRequiredError, "Please upgrade your client library.")
219
219
  end
220
220
 
221
+ it "raises a TooManyRequestsError if the rate limit threshold is exceeded" do
222
+ expect do
223
+ Braintree::Util.raise_exception_for_status_code(429)
224
+ end.to raise_error(Braintree::TooManyRequestsError)
225
+ end
226
+
221
227
  it "raises a ServerError if the server 500's" do
222
228
  expect do
223
229
  Braintree::Util.raise_exception_for_status_code(500)
metadata CHANGED
@@ -1,262 +1,263 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
- version: !ruby/object:Gem::Version
4
- version: 2.60.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.61.0
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Braintree
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2016-04-18 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+ date: 2016-05-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
15
  name: builder
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
21
  version: 2.0.0
22
22
  type: :runtime
23
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0
24
30
  description: Ruby library for integrating with the Braintree Gateway
25
31
  email: code@getbraintree.com
26
32
  executables: []
27
-
28
33
  extensions: []
29
-
30
34
  extra_rdoc_files: []
31
-
32
- files:
35
+ files:
33
36
  - README.rdoc
34
37
  - LICENSE
35
- - lib/braintree/credit_card_verification.rb
36
- - lib/braintree/venmo_account.rb
37
- - lib/braintree/advanced_search.rb
38
- - lib/braintree/payment_method.rb
39
- - lib/braintree/payment_method_nonce_gateway.rb
40
- - lib/braintree/credit_card_verification_search.rb
38
+ - lib/braintree.rb
39
+ - lib/braintree/paypal_account.rb
40
+ - lib/braintree/account_updater_daily_report.rb
41
+ - lib/braintree/address.rb
42
+ - lib/braintree/europe_bank_account.rb
43
+ - lib/braintree/credit_card_verification_gateway.rb
41
44
  - lib/braintree/settlement_batch.rb
42
- - lib/braintree/webhook_testing_gateway.rb
43
- - lib/braintree/gateway.rb
44
- - lib/braintree/merchant_account_gateway.rb
45
- - lib/braintree/three_d_secure_info.rb
46
- - lib/braintree/xml.rb
47
- - lib/braintree/webhook_notification.rb
48
- - lib/braintree/address_gateway.rb
49
- - lib/braintree/facilitator_details.rb
50
- - lib/braintree/merchant.rb
51
- - lib/braintree/subscription_search.rb
52
- - lib/braintree/credentials_parser.rb
45
+ - lib/braintree/validation_error_collection.rb
46
+ - lib/braintree/resource_collection.rb
53
47
  - lib/braintree/transaction.rb
54
- - lib/braintree/payment_instrument_type.rb
55
- - lib/braintree/add_on.rb
56
- - lib/braintree/util.rb
57
- - lib/braintree/test_transaction.rb
58
- - lib/braintree/configuration.rb
59
- - lib/braintree/transaction/customer_details.rb
60
- - lib/braintree/transaction/address_details.rb
61
- - lib/braintree/transaction/subscription_details.rb
62
- - lib/braintree/transaction/paypal_details.rb
63
- - lib/braintree/transaction/coinbase_details.rb
64
- - lib/braintree/transaction/android_pay_details.rb
65
- - lib/braintree/transaction/amex_express_checkout_details.rb
66
- - lib/braintree/transaction/disbursement_details.rb
67
- - lib/braintree/transaction/status_details.rb
68
- - lib/braintree/transaction/credit_card_details.rb
69
- - lib/braintree/transaction/apple_pay_details.rb
70
- - lib/braintree/transaction/venmo_account_details.rb
71
- - lib/braintree/europe_bank_account.rb
72
- - lib/braintree/amex_express_checkout_card.rb
73
- - lib/braintree/plan.rb
74
- - lib/braintree/subscription_gateway.rb
75
- - lib/braintree/android_pay_card.rb
48
+ - lib/braintree/exceptions.rb
49
+ - lib/braintree/dispute/transaction_details.rb
50
+ - lib/braintree/testing_gateway.rb
51
+ - lib/braintree/xml.rb
52
+ - lib/braintree/customer_gateway.rb
53
+ - lib/braintree/error_codes.rb
54
+ - lib/braintree/settlement_batch_summary.rb
55
+ - lib/braintree/paypal_account_gateway.rb
56
+ - lib/braintree/address/country_names.rb
57
+ - lib/braintree/advanced_search.rb
76
58
  - lib/braintree/base_module.rb
77
- - lib/braintree/xml/rexml.rb
78
- - lib/braintree/xml/parser.rb
79
- - lib/braintree/xml/generator.rb
80
- - lib/braintree/xml/libxml.rb
81
- - lib/braintree/address.rb
82
- - lib/braintree/paypal_account.rb
83
- - lib/braintree/account_updater_daily_report.rb
84
- - lib/braintree/successful_result.rb
85
- - lib/braintree/discount.rb
86
- - lib/braintree/transaction_gateway.rb
87
- - lib/braintree/customer_search.rb
88
- - lib/braintree/http.rb
89
- - lib/braintree/test/nonce.rb
59
+ - lib/braintree/amex_express_checkout_card.rb
60
+ - lib/braintree/payment_method_nonce.rb
61
+ - lib/braintree/signature_service.rb
62
+ - lib/braintree/credit_card_verification_search.rb
63
+ - lib/braintree/webhook_testing.rb
90
64
  - lib/braintree/test/transaction_amounts.rb
91
- - lib/braintree/test/merchant_account.rb
92
65
  - lib/braintree/test/credit_card.rb
66
+ - lib/braintree/test/nonce.rb
67
+ - lib/braintree/test/merchant_account.rb
93
68
  - lib/braintree/test/venmo_sdk.rb
94
- - lib/braintree/credit_card_verification_gateway.rb
95
- - lib/braintree/testing_gateway.rb
96
- - lib/braintree/merchant_account.rb
97
- - lib/braintree/subscription/status_details.rb
98
- - lib/braintree/transparent_redirect.rb
99
- - lib/braintree/error_result.rb
100
- - lib/braintree/disbursement.rb
101
- - lib/braintree/address/country_names.rb
102
- - lib/braintree/subscription.rb
103
- - lib/braintree/europe_bank_account_gateway.rb
69
+ - lib/braintree/oauth_credentials.rb
70
+ - lib/braintree/test_transaction.rb
71
+ - lib/braintree/facilitator_details.rb
72
+ - lib/braintree/digest.rb
73
+ - lib/braintree/three_d_secure_info.rb
74
+ - lib/braintree/settlement_batch_summary_gateway.rb
104
75
  - lib/braintree/customer.rb
76
+ - lib/braintree/http.rb
77
+ - lib/braintree/coinbase_account.rb
78
+ - lib/braintree/transaction_search.rb
105
79
  - lib/braintree/credit_card.rb
106
- - lib/braintree/errors.rb
107
- - lib/braintree/webhook_testing.rb
108
- - lib/braintree/paypal_account_gateway.rb
109
- - lib/braintree/digest.rb
110
- - lib/braintree/modification.rb
111
- - lib/braintree/credit_card_gateway.rb
80
+ - lib/braintree/credentials_parser.rb
112
81
  - lib/braintree/validation_error.rb
113
- - lib/braintree/payment_method_nonce.rb
114
- - lib/braintree/coinbase_account.rb
115
- - lib/braintree/merchant_gateway.rb
116
- - lib/braintree/version.rb
117
- - lib/braintree/signature_service.rb
118
- - lib/braintree/unknown_payment_method.rb
119
- - lib/braintree/descriptor.rb
120
- - lib/braintree/validation_error_collection.rb
121
- - lib/braintree/client_token_gateway.rb
82
+ - lib/braintree/configuration.rb
83
+ - lib/braintree/client_token.rb
122
84
  - lib/braintree/risk_data.rb
85
+ - lib/braintree/util.rb
123
86
  - lib/braintree/add_on_gateway.rb
124
- - lib/braintree/dispute/transaction_details.rb
125
- - lib/braintree/settlement_batch_summary_gateway.rb
87
+ - lib/braintree/payment_method_nonce_gateway.rb
88
+ - lib/braintree/transparent_redirect.rb
89
+ - lib/braintree/payment_method_gateway.rb
90
+ - lib/braintree/discount.rb
126
91
  - lib/braintree/apple_pay_card.rb
127
- - lib/braintree/dispute.rb
128
92
  - lib/braintree/oauth_gateway.rb
129
- - lib/braintree/client_token.rb
130
- - lib/braintree/customer_gateway.rb
131
- - lib/braintree/discount_gateway.rb
132
- - lib/braintree/resource_collection.rb
133
- - lib/braintree/plan_gateway.rb
134
- - lib/braintree/transparent_redirect_gateway.rb
135
- - lib/braintree/payment_method_gateway.rb
136
- - lib/braintree/settlement_batch_summary.rb
137
- - lib/braintree/exceptions.rb
138
- - lib/braintree/transaction_search.rb
139
- - lib/braintree/error_codes.rb
140
- - lib/braintree/sha256_digest.rb
141
- - lib/braintree/webhook_notification_gateway.rb
142
- - lib/braintree/merchant_account/address_details.rb
93
+ - lib/braintree/subscription/status_details.rb
94
+ - lib/braintree/merchant_account_gateway.rb
95
+ - lib/braintree/merchant.rb
96
+ - lib/braintree/modification.rb
97
+ - lib/braintree/webhook_testing_gateway.rb
98
+ - lib/braintree/customer_search.rb
99
+ - lib/braintree/subscription_gateway.rb
100
+ - lib/braintree/payment_method.rb
101
+ - lib/braintree/venmo_account.rb
102
+ - lib/braintree/disbursement.rb
103
+ - lib/braintree/credit_card_verification.rb
104
+ - lib/braintree/merchant_gateway.rb
105
+ - lib/braintree/address_gateway.rb
143
106
  - lib/braintree/merchant_account/business_details.rb
144
107
  - lib/braintree/merchant_account/funding_details.rb
145
108
  - lib/braintree/merchant_account/individual_details.rb
146
- - lib/braintree/oauth_credentials.rb
147
- - lib/braintree.rb
148
- - lib/ssl/api_braintreegateway_com.ca.crt
109
+ - lib/braintree/merchant_account/address_details.rb
110
+ - lib/braintree/credit_card_gateway.rb
111
+ - lib/braintree/europe_bank_account_gateway.rb
112
+ - lib/braintree/transaction_gateway.rb
113
+ - lib/braintree/error_result.rb
114
+ - lib/braintree/dispute.rb
115
+ - lib/braintree/merchant_account.rb
116
+ - lib/braintree/successful_result.rb
117
+ - lib/braintree/add_on.rb
118
+ - lib/braintree/sha256_digest.rb
119
+ - lib/braintree/transaction/credit_card_details.rb
120
+ - lib/braintree/transaction/paypal_details.rb
121
+ - lib/braintree/transaction/subscription_details.rb
122
+ - lib/braintree/transaction/status_details.rb
123
+ - lib/braintree/transaction/amex_express_checkout_details.rb
124
+ - lib/braintree/transaction/apple_pay_details.rb
125
+ - lib/braintree/transaction/customer_details.rb
126
+ - lib/braintree/transaction/disbursement_details.rb
127
+ - lib/braintree/transaction/venmo_account_details.rb
128
+ - lib/braintree/transaction/coinbase_details.rb
129
+ - lib/braintree/transaction/address_details.rb
130
+ - lib/braintree/transaction/android_pay_details.rb
131
+ - lib/braintree/webhook_notification.rb
132
+ - lib/braintree/client_token_gateway.rb
133
+ - lib/braintree/gateway.rb
134
+ - lib/braintree/payment_instrument_type.rb
135
+ - lib/braintree/webhook_notification_gateway.rb
136
+ - lib/braintree/android_pay_card.rb
137
+ - lib/braintree/subscription_search.rb
138
+ - lib/braintree/transparent_redirect_gateway.rb
139
+ - lib/braintree/plan.rb
140
+ - lib/braintree/unknown_payment_method.rb
141
+ - lib/braintree/xml/libxml.rb
142
+ - lib/braintree/xml/parser.rb
143
+ - lib/braintree/xml/rexml.rb
144
+ - lib/braintree/xml/generator.rb
145
+ - lib/braintree/errors.rb
146
+ - lib/braintree/discount_gateway.rb
147
+ - lib/braintree/descriptor.rb
148
+ - lib/braintree/version.rb
149
+ - lib/braintree/subscription.rb
150
+ - lib/braintree/plan_gateway.rb
149
151
  - lib/ssl/securetrust_ca.crt
150
- - spec/spec.opts
151
- - spec/httpsd.pid
152
+ - lib/ssl/api_braintreegateway_com.ca.crt
153
+ - spec/oauth_test_helper.rb
154
+ - spec/ssl/privateKey.key
155
+ - spec/ssl/geotrust_global.crt
156
+ - spec/ssl/certificate.crt
157
+ - spec/script/httpsd.rb
152
158
  - spec/hacks/tcp_socket.rb
159
+ - spec/spec_helper.rb
153
160
  - spec/unit/spec_helper.rb
154
- - spec/unit/braintree/credit_card_verification_search_spec.rb
161
+ - spec/unit/braintree_spec.rb
155
162
  - spec/unit/braintree/subscription_search_spec.rb
163
+ - spec/unit/braintree/transparent_redirect_spec.rb
164
+ - spec/unit/braintree/transaction_spec.rb
165
+ - spec/unit/braintree/successful_result_spec.rb
166
+ - spec/unit/braintree/http_spec.rb
167
+ - spec/unit/braintree/sha256_digest_spec.rb
168
+ - spec/unit/braintree/util_spec.rb
169
+ - spec/unit/braintree/base_module_spec.rb
170
+ - spec/unit/braintree/unknown_payment_method_spec.rb
171
+ - spec/unit/braintree/address_spec.rb
172
+ - spec/unit/braintree/credit_card_spec.rb
173
+ - spec/unit/braintree/dispute_spec.rb
174
+ - spec/unit/braintree/modification_spec.rb
175
+ - spec/unit/braintree/error_result_spec.rb
176
+ - spec/unit/braintree/errors_spec.rb
177
+ - spec/unit/braintree/three_d_secure_info_spec.rb
156
178
  - spec/unit/braintree/signature_service_spec.rb
157
- - spec/unit/braintree/apple_pay_card_spec.rb
158
- - spec/unit/braintree/webhook_notification_spec.rb
159
179
  - spec/unit/braintree/payment_method_spec.rb
160
- - spec/unit/braintree/errors_spec.rb
161
- - spec/unit/braintree/unknown_payment_method_spec.rb
180
+ - spec/unit/braintree/disbursement_spec.rb
181
+ - spec/unit/braintree/subscription_spec.rb
182
+ - spec/unit/braintree/validation_error_collection_spec.rb
183
+ - spec/unit/braintree/client_token_spec.rb
184
+ - spec/unit/braintree/webhook_notification_spec.rb
185
+ - spec/unit/braintree/configuration_spec.rb
186
+ - spec/unit/braintree/credit_card_verification_search_spec.rb
162
187
  - spec/unit/braintree/merchant_account_spec.rb
163
- - spec/unit/braintree/validation_error_spec.rb
188
+ - spec/unit/braintree/digest_spec.rb
164
189
  - spec/unit/braintree/credentials_parser_spec.rb
165
- - spec/unit/braintree/xml_spec.rb
166
- - spec/unit/braintree/transparent_redirect_spec.rb
167
- - spec/unit/braintree/client_token_spec.rb
168
- - spec/unit/braintree/transaction/customer_details_spec.rb
190
+ - spec/unit/braintree/apple_pay_card_spec.rb
191
+ - spec/unit/braintree/customer_spec.rb
192
+ - spec/unit/braintree/risk_data_spec.rb
169
193
  - spec/unit/braintree/transaction/deposit_details_spec.rb
194
+ - spec/unit/braintree/transaction/customer_details_spec.rb
170
195
  - spec/unit/braintree/transaction/credit_card_details_spec.rb
171
- - spec/unit/braintree/address_spec.rb
172
- - spec/unit/braintree/http_spec.rb
173
- - spec/unit/braintree/customer_spec.rb
174
- - spec/unit/braintree/validation_error_collection_spec.rb
175
- - spec/unit/braintree/modification_spec.rb
176
- - spec/unit/braintree/xml/parser_spec.rb
196
+ - spec/unit/braintree/transaction_search_spec.rb
197
+ - spec/unit/braintree/xml_spec.rb
177
198
  - spec/unit/braintree/xml/rexml_spec.rb
178
199
  - spec/unit/braintree/xml/libxml_spec.rb
200
+ - spec/unit/braintree/xml/parser_spec.rb
201
+ - spec/unit/braintree/resource_collection_spec.rb
179
202
  - spec/unit/braintree/paypal_account_spec.rb
180
- - spec/unit/braintree/digest_spec.rb
181
- - spec/unit/braintree/error_result_spec.rb
182
- - spec/unit/braintree/transaction_spec.rb
183
- - spec/unit/braintree/three_d_secure_info_spec.rb
184
- - spec/unit/braintree/successful_result_spec.rb
185
- - spec/unit/braintree/util_spec.rb
186
- - spec/unit/braintree/disbursement_spec.rb
187
- - spec/unit/braintree/credit_card_spec.rb
188
- - spec/unit/braintree/dispute_spec.rb
203
+ - spec/unit/braintree/validation_error_spec.rb
189
204
  - spec/unit/braintree/credit_card_verification_spec.rb
190
- - spec/unit/braintree/base_module_spec.rb
191
- - spec/unit/braintree/transaction_search_spec.rb
192
- - spec/unit/braintree/risk_data_spec.rb
193
- - spec/unit/braintree/subscription_spec.rb
194
- - spec/unit/braintree/configuration_spec.rb
195
- - spec/unit/braintree/sha256_digest_spec.rb
196
- - spec/unit/braintree/resource_collection_spec.rb
197
- - spec/unit/braintree_spec.rb
198
- - spec/spec_helper.rb
199
- - spec/script/httpsd.rb
205
+ - spec/spec.opts
206
+ - spec/httpsd.pid
200
207
  - spec/integration/spec_helper.rb
201
- - spec/integration/braintree/credit_card_verification_search_spec.rb
202
- - spec/integration/braintree/settlement_batch_summary_spec.rb
203
- - spec/integration/braintree/payment_method_spec.rb
204
- - spec/integration/braintree/payment_method_nonce_spec.rb
205
- - spec/integration/braintree/merchant_account_spec.rb
206
208
  - spec/integration/braintree/client_api/client_token_spec.rb
207
209
  - spec/integration/braintree/client_api/spec_helper.rb
208
- - spec/integration/braintree/test_transaction_spec.rb
209
- - spec/integration/braintree/customer_search_spec.rb
210
210
  - spec/integration/braintree/transparent_redirect_spec.rb
211
- - spec/integration/braintree/address_spec.rb
212
- - spec/integration/braintree/http_spec.rb
213
- - spec/integration/braintree/customer_spec.rb
214
- - spec/integration/braintree/paypal_account_spec.rb
215
- - spec/integration/braintree/error_codes_spec.rb
211
+ - spec/integration/braintree/oauth_spec.rb
216
212
  - spec/integration/braintree/transaction_spec.rb
213
+ - spec/integration/braintree/http_spec.rb
214
+ - spec/integration/braintree/payment_method_nonce_spec.rb
215
+ - spec/integration/braintree/plan_spec.rb
216
+ - spec/integration/braintree/address_spec.rb
217
217
  - spec/integration/braintree/test/transaction_amounts_spec.rb
218
- - spec/integration/braintree/disbursement_spec.rb
219
- - spec/integration/braintree/merchant_spec.rb
220
218
  - spec/integration/braintree/credit_card_spec.rb
221
- - spec/integration/braintree/oauth_spec.rb
219
+ - spec/integration/braintree/merchant_spec.rb
220
+ - spec/integration/braintree/customer_search_spec.rb
222
221
  - spec/integration/braintree/coinbase_spec.rb
223
- - spec/integration/braintree/credit_card_verification_spec.rb
224
- - spec/integration/braintree/discount_spec.rb
225
- - spec/integration/braintree/add_on_spec.rb
226
- - spec/integration/braintree/transaction_search_spec.rb
227
222
  - spec/integration/braintree/advanced_search_spec.rb
228
- - spec/integration/braintree/plan_spec.rb
223
+ - spec/integration/braintree/payment_method_spec.rb
224
+ - spec/integration/braintree/disbursement_spec.rb
229
225
  - spec/integration/braintree/subscription_spec.rb
230
- - spec/ssl/certificate.crt
231
- - spec/ssl/geotrust_global.crt
232
- - spec/ssl/privateKey.key
233
- - spec/oauth_test_helper.rb
226
+ - spec/integration/braintree/credit_card_verification_search_spec.rb
227
+ - spec/integration/braintree/test_transaction_spec.rb
228
+ - spec/integration/braintree/merchant_account_spec.rb
229
+ - spec/integration/braintree/customer_spec.rb
230
+ - spec/integration/braintree/settlement_batch_summary_spec.rb
231
+ - spec/integration/braintree/transaction_search_spec.rb
232
+ - spec/integration/braintree/error_codes_spec.rb
233
+ - spec/integration/braintree/paypal_account_spec.rb
234
+ - spec/integration/braintree/discount_spec.rb
235
+ - spec/integration/braintree/add_on_spec.rb
236
+ - spec/integration/braintree/credit_card_verification_spec.rb
234
237
  - braintree.gemspec
235
238
  homepage: http://www.braintreepayments.com/
236
- licenses:
239
+ licenses:
237
240
  - MIT
238
- metadata: {}
239
-
240
241
  post_install_message:
241
242
  rdoc_options: []
242
-
243
- require_paths:
243
+ require_paths:
244
244
  - lib
245
- required_ruby_version: !ruby/object:Gem::Requirement
246
- requirements:
247
- - &id002
248
- - ">="
249
- - !ruby/object:Gem::Version
250
- version: "0"
251
- required_rubygems_version: !ruby/object:Gem::Requirement
252
- requirements:
253
- - *id002
245
+ required_ruby_version: !ruby/object:Gem::Requirement
246
+ none: false
247
+ requirements:
248
+ - - ! '>='
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ required_rubygems_version: !ruby/object:Gem::Requirement
252
+ none: false
253
+ requirements:
254
+ - - ! '>='
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
254
257
  requirements: []
255
-
256
258
  rubyforge_project: braintree
257
- rubygems_version: 2.0.17
259
+ rubygems_version: 1.8.23
258
260
  signing_key:
259
- specification_version: 4
261
+ specification_version: 3
260
262
  summary: Braintree Gateway Ruby Client Library
261
263
  test_files: []
262
-
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- data.tar.gz: f64561b1b82b8a824ce2101f7155c83b1e0f6879
4
- metadata.gz: 733dc78ef9bad90d24f86f155467dd885a98f7d5
5
- SHA512:
6
- data.tar.gz: badb67e03e36b3ba7117bd106b9e27c015ae9c4cbddf238f2708b6720211ec0fcc0a60408b34e4486e69c263a2eb30cf35d87c97c9a76a3f67ed75dbd9bbbe92
7
- metadata.gz: 31e55977b925aa79669210d1463ebd6544da4313ef4df50509c3ee43daaa2a9ae5e9690787d50d6186fcce8f515b5b5c3e006169ba7176d618ac9173e5ddb6fd