braintree 2.7.0 → 2.8.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.
- data/lib/braintree/customer_search.rb +1 -0
- data/lib/braintree/error_codes.rb +2 -0
- data/lib/braintree/subscription_search.rb +2 -2
- data/lib/braintree/version.rb +1 -1
- data/spec/integration/braintree/customer_search_spec.rb +1 -0
- data/spec/integration/braintree/subscription_spec.rb +43 -0
- metadata +4 -4
@@ -111,6 +111,7 @@ module Braintree
|
|
111
111
|
PlanIdIsInvalid = "91904"
|
112
112
|
PriceCannotBeBlank = "81903"
|
113
113
|
PriceFormatIsInvalid = "81904"
|
114
|
+
PriceIsTooLarge = "81923"
|
114
115
|
StatusIsCanceled = "81905"
|
115
116
|
TokenFormatIsInvalid = "81906"
|
116
117
|
TrialDurationFormatIsInvalid = "81907"
|
@@ -120,6 +121,7 @@ module Braintree
|
|
120
121
|
module Modification
|
121
122
|
AmountCannotBeBlank = "92003"
|
122
123
|
AmountIsInvalid = "92002"
|
124
|
+
AmountIsTooLarge = "92023"
|
123
125
|
CannotEditModificationsOnPastDueSubscription = "92022"
|
124
126
|
CannotUpdateAndRemove = "92015"
|
125
127
|
ExistingIdIsIncorrectKind = "92020"
|
@@ -2,10 +2,10 @@ module Braintree
|
|
2
2
|
class SubscriptionSearch < AdvancedSearch # :nodoc:
|
3
3
|
multiple_value_field :in_trial_period
|
4
4
|
multiple_value_field :ids
|
5
|
-
text_fields :id
|
5
|
+
text_fields :id, :transaction_id
|
6
6
|
multiple_value_or_text_field :plan_id
|
7
7
|
multiple_value_field :status, :allows => Subscription::Status::All
|
8
8
|
multiple_value_field :merchant_account_id
|
9
|
-
range_fields :price, :days_past_due, :billing_cycles_remaining
|
9
|
+
range_fields :price, :days_past_due, :billing_cycles_remaining, :next_billing_date
|
10
10
|
end
|
11
11
|
end
|
data/lib/braintree/version.rb
CHANGED
@@ -55,6 +55,7 @@ describe Braintree::Transaction, "search" do
|
|
55
55
|
:address_extended_address => "Suite 3",
|
56
56
|
:address_locality => "Chicago",
|
57
57
|
:address_region => "Illinois",
|
58
|
+
:address_country_name => "United States of America",
|
58
59
|
:payment_method_token => cctoken,
|
59
60
|
:cardholder_name => "Tim Tool",
|
60
61
|
:credit_card_expiration_date => "05/2010",
|
@@ -1286,6 +1286,49 @@ describe Braintree::Subscription do
|
|
1286
1286
|
end
|
1287
1287
|
end
|
1288
1288
|
|
1289
|
+
describe "transaction_id" do
|
1290
|
+
it "returns matching results" do
|
1291
|
+
matching_subscription = Braintree::Subscription.create(
|
1292
|
+
:payment_method_token => @credit_card.token,
|
1293
|
+
:plan_id => SpecHelper::TriallessPlan[:id]
|
1294
|
+
).subscription
|
1295
|
+
|
1296
|
+
non_matching_subscription = Braintree::Subscription.create(
|
1297
|
+
:payment_method_token => @credit_card.token,
|
1298
|
+
:plan_id => SpecHelper::TriallessPlan[:id]
|
1299
|
+
).subscription
|
1300
|
+
|
1301
|
+
collection = Braintree::Subscription.search do |search|
|
1302
|
+
search.transaction_id.is matching_subscription.transactions.first.id
|
1303
|
+
end
|
1304
|
+
|
1305
|
+
collection.should include(matching_subscription)
|
1306
|
+
collection.should_not include(non_matching_subscription)
|
1307
|
+
end
|
1308
|
+
end
|
1309
|
+
|
1310
|
+
describe "next_billing_date" do
|
1311
|
+
it "returns matching results" do
|
1312
|
+
matching_subscription = Braintree::Subscription.create(
|
1313
|
+
:payment_method_token => @credit_card.token,
|
1314
|
+
:plan_id => SpecHelper::TriallessPlan[:id]
|
1315
|
+
).subscription
|
1316
|
+
|
1317
|
+
non_matching_subscription = Braintree::Subscription.create(
|
1318
|
+
:payment_method_token => @credit_card.token,
|
1319
|
+
:plan_id => SpecHelper::TrialPlan[:id]
|
1320
|
+
).subscription
|
1321
|
+
|
1322
|
+
five_days_from_now = Time.now + (5 * 24 * 60 * 60)
|
1323
|
+
collection = Braintree::Subscription.search do |search|
|
1324
|
+
search.next_billing_date >= five_days_from_now
|
1325
|
+
end
|
1326
|
+
|
1327
|
+
collection.should include(matching_subscription)
|
1328
|
+
collection.should_not include(non_matching_subscription)
|
1329
|
+
end
|
1330
|
+
end
|
1331
|
+
|
1289
1332
|
it "returns multiple results" do
|
1290
1333
|
(110 - Braintree::Subscription.search.maximum_size).times do
|
1291
1334
|
Braintree::Subscription.create(:payment_method_token => @credit_card.token, :plan_id => SpecHelper::TrialPlan[:id])
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: braintree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 47
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
version: 2.
|
10
|
+
version: 2.8.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Braintree Payment Solutions
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-02-22 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|