braintree 2.27.1 → 2.28.0

Sign up to get free protection for your applications and to get access to all the features.
data/braintree.gemspec CHANGED
@@ -6,6 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.summary = "Braintree Gateway Ruby Client Library"
7
7
  s.description = "Ruby library for integrating with the Braintree Gateway"
8
8
  s.version = Braintree::Version::String
9
+ s.license = "MIT"
9
10
  s.author = "Braintree"
10
11
  s.email = "code@getbraintree.com"
11
12
  s.homepage = "http://www.braintreepayments.com/"
@@ -25,6 +25,10 @@ module Braintree
25
25
  Configuration.gateway.merchant_account.create(attributes)
26
26
  end
27
27
 
28
+ def self.find(attributes)
29
+ Configuration.gateway.merchant_account.find(attributes)
30
+ end
31
+
28
32
  def self.update(id, attributes)
29
33
  Configuration.gateway.merchant_account.update(id, attributes)
30
34
  end
@@ -11,6 +11,14 @@ module Braintree
11
11
  _do_create "/merchant_accounts/create_via_api", :merchant_account => attributes
12
12
  end
13
13
 
14
+ def find(merchant_account_id)
15
+ raise ArgumentError if merchant_account_id.nil? || merchant_account_id.to_s.strip == ""
16
+ response = @config.http.get "/merchant_accounts/#{merchant_account_id}"
17
+ MerchantAccount._new(@gateway, response[:merchant_account])
18
+ rescue NotFoundError
19
+ raise NotFoundError, "Merchant account with id #{merchant_account_id} not found"
20
+ end
21
+
14
22
  def update(merchant_account_id, attributes)
15
23
  Util.verify_keys(MerchantAccountGateway._update_signature, attributes)
16
24
  _do_update "/merchant_accounts/#{merchant_account_id}/update_via_api", :merchant_account => attributes
@@ -1,8 +1,8 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 2
4
- Minor = 27
5
- Tiny = 1
4
+ Minor = 28
5
+ Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
8
8
  end
data/spec/httpsd.pid ADDED
@@ -0,0 +1 @@
1
+ 5472
@@ -134,6 +134,27 @@ describe Braintree::MerchantAccount do
134
134
  end
135
135
  end
136
136
 
137
+ describe "find" do
138
+ it "finds the merchant account with the given token" do
139
+ result = Braintree::MerchantAccount.create(VALID_APPLICATION_PARAMS)
140
+ result.should be_success
141
+ result.merchant_account.status.should == Braintree::MerchantAccount::Status::Pending
142
+
143
+ id = result.merchant_account.id
144
+ merchant_account = Braintree::MerchantAccount.find(id)
145
+
146
+ merchant_account.status.should == Braintree::MerchantAccount::Status::Active
147
+ merchant_account.individual_details.first_name.should == VALID_APPLICATION_PARAMS[:individual][:first_name]
148
+ merchant_account.individual_details.last_name.should == VALID_APPLICATION_PARAMS[:individual][:last_name]
149
+ end
150
+
151
+ it "raises a NotFoundError exception if merchant account cannot be found" do
152
+ expect do
153
+ Braintree::MerchantAccount.find("non-existant")
154
+ end.to raise_error(Braintree::NotFoundError, 'Merchant account with id non-existant not found')
155
+ end
156
+ end
157
+
137
158
  describe "update" do
138
159
  it "updates the Merchant Account info" do
139
160
  params = VALID_APPLICATION_PARAMS.clone
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.27.1
4
+ version: 2.28.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-05 00:00:00.000000000 Z
12
+ date: 2013-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -36,144 +36,146 @@ files:
36
36
  - README.rdoc
37
37
  - LICENSE
38
38
  - lib/braintree.rb
39
- - lib/braintree/settlement_batch_summary_gateway.rb
40
- - lib/braintree/discount.rb
41
- - lib/braintree/base_module.rb
42
- - lib/braintree/xml.rb
43
- - lib/braintree/customer.rb
44
- - lib/braintree/validation_error.rb
45
- - lib/braintree/transaction_gateway.rb
46
- - lib/braintree/gateway.rb
47
- - lib/braintree/exceptions.rb
48
- - lib/braintree/customer_gateway.rb
49
- - lib/braintree/credit_card_verification.rb
50
- - lib/braintree/digest.rb
51
- - lib/braintree/credit_card.rb
52
- - lib/braintree/discount_gateway.rb
53
- - lib/braintree/subscription.rb
54
- - lib/braintree/util.rb
55
- - lib/braintree/configuration.rb
56
- - lib/braintree/merchant_account.rb
57
- - lib/braintree/credit_card_gateway.rb
58
- - lib/braintree/resource_collection.rb
59
- - lib/braintree/merchant_account_gateway.rb
60
- - lib/braintree/address/country_names.rb
61
- - lib/braintree/credit_card_verification_search.rb
62
- - lib/braintree/version.rb
63
- - lib/braintree/plan.rb
64
- - lib/braintree/error_codes.rb
65
- - lib/braintree/validation_error_collection.rb
66
- - lib/braintree/address_gateway.rb
67
- - lib/braintree/subscription_gateway.rb
68
- - lib/braintree/webhook_notification_gateway.rb
69
- - lib/braintree/add_on.rb
39
+ - lib/braintree/subscription_search.rb
40
+ - lib/braintree/modification.rb
41
+ - lib/braintree/errors.rb
70
42
  - lib/braintree/test/credit_card.rb
71
43
  - lib/braintree/test/transaction_amounts.rb
72
- - lib/braintree/test/venmo_sdk.rb
73
44
  - lib/braintree/test/merchant_account.rb
74
- - lib/braintree/xml/rexml.rb
45
+ - lib/braintree/test/venmo_sdk.rb
46
+ - lib/braintree/webhook_testing.rb
47
+ - lib/braintree/webhook_testing_gateway.rb
48
+ - lib/braintree/advanced_search.rb
49
+ - lib/braintree/version.rb
50
+ - lib/braintree/add_on.rb
51
+ - lib/braintree/address.rb
52
+ - lib/braintree/digest.rb
53
+ - lib/braintree/settlement_batch_summary.rb
54
+ - lib/braintree/error_codes.rb
55
+ - lib/braintree/discount.rb
56
+ - lib/braintree/webhook_notification.rb
57
+ - lib/braintree/settlement_batch_summary_gateway.rb
58
+ - lib/braintree/validation_error_collection.rb
59
+ - lib/braintree/credit_card_verification_gateway.rb
60
+ - lib/braintree/credit_card.rb
61
+ - lib/braintree/customer_search.rb
62
+ - lib/braintree/util.rb
63
+ - lib/braintree/transparent_redirect.rb
75
64
  - lib/braintree/xml/generator.rb
65
+ - lib/braintree/xml/rexml.rb
76
66
  - lib/braintree/xml/libxml.rb
77
67
  - lib/braintree/xml/parser.rb
78
- - lib/braintree/transparent_redirect.rb
79
- - lib/braintree/plan_gateway.rb
80
- - lib/braintree/transaction_search.rb
81
- - lib/braintree/customer_search.rb
82
- - lib/braintree/transparent_redirect_gateway.rb
83
- - lib/braintree/webhook_notification.rb
84
- - lib/braintree/webhook_testing_gateway.rb
85
- - lib/braintree/webhook_testing.rb
86
- - lib/braintree/credit_card_verification_gateway.rb
87
- - lib/braintree/descriptor.rb
88
- - lib/braintree/modification.rb
68
+ - lib/braintree/exceptions.rb
69
+ - lib/braintree/validation_error.rb
70
+ - lib/braintree/resource_collection.rb
71
+ - lib/braintree/xml.rb
72
+ - lib/braintree/credit_card_verification.rb
73
+ - lib/braintree/configuration.rb
89
74
  - lib/braintree/transaction.rb
75
+ - lib/braintree/http.rb
76
+ - lib/braintree/address_gateway.rb
77
+ - lib/braintree/subscription_gateway.rb
78
+ - lib/braintree/customer_gateway.rb
79
+ - lib/braintree/merchant_account/business_details.rb
80
+ - lib/braintree/merchant_account/funding_details.rb
90
81
  - lib/braintree/merchant_account/individual_details.rb
91
82
  - lib/braintree/merchant_account/address_details.rb
92
- - lib/braintree/merchant_account/funding_details.rb
93
- - lib/braintree/merchant_account/business_details.rb
94
- - lib/braintree/add_on_gateway.rb
83
+ - lib/braintree/plan_gateway.rb
84
+ - lib/braintree/credit_card_verification_search.rb
95
85
  - lib/braintree/successful_result.rb
96
- - lib/braintree/advanced_search.rb
97
- - lib/braintree/subscription_search.rb
98
- - lib/braintree/error_result.rb
99
- - lib/braintree/settlement_batch_summary.rb
100
- - lib/braintree/address.rb
101
86
  - lib/braintree/settlement_batch.rb
102
- - lib/braintree/transaction/disbursement_details.rb
103
- - lib/braintree/transaction/status_details.rb
104
- - lib/braintree/transaction/address_details.rb
87
+ - lib/braintree/plan.rb
88
+ - lib/braintree/gateway.rb
89
+ - lib/braintree/transparent_redirect_gateway.rb
90
+ - lib/braintree/base_module.rb
91
+ - lib/braintree/add_on_gateway.rb
105
92
  - lib/braintree/transaction/subscription_details.rb
93
+ - lib/braintree/transaction/disbursement_details.rb
106
94
  - lib/braintree/transaction/customer_details.rb
107
95
  - lib/braintree/transaction/credit_card_details.rb
108
- - lib/braintree/errors.rb
109
- - lib/braintree/http.rb
110
- - lib/ssl/api_braintreegateway_com.ca.crt
111
- - lib/ssl/securetrust_ca.crt
96
+ - lib/braintree/transaction/status_details.rb
97
+ - lib/braintree/transaction/address_details.rb
98
+ - lib/braintree/transaction_search.rb
99
+ - lib/braintree/error_result.rb
100
+ - lib/braintree/credit_card_gateway.rb
101
+ - lib/braintree/descriptor.rb
102
+ - lib/braintree/transaction_gateway.rb
103
+ - lib/braintree/subscription.rb
104
+ - lib/braintree/merchant_account.rb
105
+ - lib/braintree/address/country_names.rb
106
+ - lib/braintree/webhook_notification_gateway.rb
107
+ - lib/braintree/merchant_account_gateway.rb
108
+ - lib/braintree/customer.rb
109
+ - lib/braintree/discount_gateway.rb
112
110
  - lib/ssl/www_braintreegateway_com.ca.crt
113
111
  - lib/ssl/sandbox_braintreegateway_com.ca.crt
114
- - spec/spec.opts
115
- - spec/ssl/privateKey.key
116
- - spec/ssl/certificate.crt
117
- - spec/ssl/geotrust_global.crt
118
- - spec/hacks/tcp_socket.rb
112
+ - lib/ssl/securetrust_ca.crt
113
+ - lib/ssl/api_braintreegateway_com.ca.crt
119
114
  - spec/script/httpsd.rb
120
- - spec/unit/braintree_spec.rb
121
- - spec/unit/braintree/credit_card_spec.rb
122
- - spec/unit/braintree/errors_spec.rb
123
- - spec/unit/braintree/subscription_search_spec.rb
124
- - spec/unit/braintree/util_spec.rb
125
- - spec/unit/braintree/address_spec.rb
126
- - spec/unit/braintree/subscription_spec.rb
115
+ - spec/spec_helper.rb
116
+ - spec/unit/spec_helper.rb
117
+ - spec/unit/braintree/transaction_search_spec.rb
118
+ - spec/unit/braintree/error_result_spec.rb
119
+ - spec/unit/braintree/xml_spec.rb
120
+ - spec/unit/braintree/customer_spec.rb
121
+ - spec/unit/braintree/transaction_spec.rb
127
122
  - spec/unit/braintree/webhook_notification_spec.rb
128
- - spec/unit/braintree/transparent_redirect_spec.rb
129
- - spec/unit/braintree/resource_collection_spec.rb
130
123
  - spec/unit/braintree/http_spec.rb
131
- - spec/unit/braintree/merchant_account_spec.rb
132
- - spec/unit/braintree/customer_spec.rb
133
- - spec/unit/braintree/error_result_spec.rb
124
+ - spec/unit/braintree/subscription_spec.rb
125
+ - spec/unit/braintree/credit_card_verification_search_spec.rb
126
+ - spec/unit/braintree/subscription_search_spec.rb
134
127
  - spec/unit/braintree/successful_result_spec.rb
135
128
  - spec/unit/braintree/credit_card_verification_spec.rb
136
129
  - spec/unit/braintree/validation_error_spec.rb
130
+ - spec/unit/braintree/resource_collection_spec.rb
131
+ - spec/unit/braintree/xml/libxml_spec.rb
137
132
  - spec/unit/braintree/xml/parser_spec.rb
138
133
  - spec/unit/braintree/xml/rexml_spec.rb
139
- - spec/unit/braintree/xml/libxml_spec.rb
140
- - spec/unit/braintree/credit_card_verification_search_spec.rb
141
- - spec/unit/braintree/base_module_spec.rb
142
- - spec/unit/braintree/transaction_spec.rb
143
134
  - spec/unit/braintree/configuration_spec.rb
144
- - spec/unit/braintree/xml_spec.rb
145
135
  - spec/unit/braintree/validation_error_collection_spec.rb
136
+ - spec/unit/braintree/merchant_account_spec.rb
137
+ - spec/unit/braintree/errors_spec.rb
146
138
  - spec/unit/braintree/modification_spec.rb
147
- - spec/unit/braintree/digest_spec.rb
148
- - spec/unit/braintree/transaction/customer_details_spec.rb
139
+ - spec/unit/braintree/util_spec.rb
140
+ - spec/unit/braintree/base_module_spec.rb
141
+ - spec/unit/braintree/address_spec.rb
142
+ - spec/unit/braintree/transparent_redirect_spec.rb
149
143
  - spec/unit/braintree/transaction/deposit_details_spec.rb
150
144
  - spec/unit/braintree/transaction/credit_card_details_spec.rb
151
- - spec/unit/braintree/transaction_search_spec.rb
152
- - spec/unit/spec_helper.rb
153
- - spec/integration/braintree/credit_card_spec.rb
145
+ - spec/unit/braintree/transaction/customer_details_spec.rb
146
+ - spec/unit/braintree/credit_card_spec.rb
147
+ - spec/unit/braintree/digest_spec.rb
148
+ - spec/unit/braintree_spec.rb
149
+ - spec/hacks/tcp_socket.rb
150
+ - spec/httpsd.pid
151
+ - spec/integration/spec_helper.rb
152
+ - spec/integration/braintree/settlement_batch_summary_spec.rb
153
+ - spec/integration/braintree/transaction_search_spec.rb
154
+ - spec/integration/braintree/test/transaction_amounts_spec.rb
155
+ - spec/integration/braintree/customer_spec.rb
156
+ - spec/integration/braintree/transaction_spec.rb
154
157
  - spec/integration/braintree/add_on_spec.rb
155
- - spec/integration/braintree/plan_spec.rb
158
+ - spec/integration/braintree/http_spec.rb
159
+ - spec/integration/braintree/subscription_spec.rb
160
+ - spec/integration/braintree/credit_card_verification_search_spec.rb
161
+ - spec/integration/braintree/credit_card_verification_spec.rb
156
162
  - spec/integration/braintree/advanced_search_spec.rb
163
+ - spec/integration/braintree/customer_search_spec.rb
164
+ - spec/integration/braintree/merchant_account_spec.rb
165
+ - spec/integration/braintree/plan_spec.rb
157
166
  - spec/integration/braintree/error_codes_spec.rb
158
167
  - spec/integration/braintree/address_spec.rb
159
- - spec/integration/braintree/subscription_spec.rb
160
168
  - spec/integration/braintree/transparent_redirect_spec.rb
161
- - spec/integration/braintree/http_spec.rb
162
- - spec/integration/braintree/merchant_account_spec.rb
163
- - spec/integration/braintree/customer_spec.rb
164
- - spec/integration/braintree/credit_card_verification_spec.rb
165
- - spec/integration/braintree/test/transaction_amounts_spec.rb
166
- - spec/integration/braintree/settlement_batch_summary_spec.rb
167
- - spec/integration/braintree/credit_card_verification_search_spec.rb
168
- - spec/integration/braintree/transaction_spec.rb
169
- - spec/integration/braintree/customer_search_spec.rb
169
+ - spec/integration/braintree/credit_card_spec.rb
170
170
  - spec/integration/braintree/discount_spec.rb
171
- - spec/integration/braintree/transaction_search_spec.rb
172
- - spec/integration/spec_helper.rb
173
- - spec/spec_helper.rb
171
+ - spec/spec.opts
172
+ - spec/ssl/geotrust_global.crt
173
+ - spec/ssl/certificate.crt
174
+ - spec/ssl/privateKey.key
174
175
  - braintree.gemspec
175
176
  homepage: http://www.braintreepayments.com/
176
- licenses: []
177
+ licenses:
178
+ - MIT
177
179
  post_install_message:
178
180
  rdoc_options: []
179
181
  require_paths:
@@ -192,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
194
  version: '0'
193
195
  requirements: []
194
196
  rubyforge_project: braintree
195
- rubygems_version: 1.8.24
197
+ rubygems_version: 1.8.23
196
198
  signing_key:
197
199
  specification_version: 3
198
200
  summary: Braintree Gateway Ruby Client Library