braintree 2.4.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/lib/braintree.rb +43 -32
- data/lib/braintree/add_on.rb +4 -0
- data/lib/braintree/address.rb +18 -72
- data/lib/braintree/address_gateway.rb +76 -0
- data/lib/braintree/advanced_search.rb +31 -13
- data/lib/braintree/base_module.rb +6 -0
- data/lib/braintree/configuration.rb +57 -39
- data/lib/braintree/credit_card.rb +75 -129
- data/lib/braintree/credit_card_gateway.rb +133 -0
- data/lib/braintree/credit_card_verification.rb +8 -0
- data/lib/braintree/customer.rb +70 -123
- data/lib/braintree/customer_gateway.rb +121 -0
- data/lib/braintree/digest.rb +2 -2
- data/lib/braintree/discount.rb +4 -0
- data/lib/braintree/error_codes.rb +50 -5
- data/lib/braintree/error_result.rb +4 -18
- data/lib/braintree/errors.rb +1 -2
- data/lib/braintree/exceptions.rb +11 -16
- data/lib/braintree/gateway.rb +39 -0
- data/lib/braintree/http.rb +30 -26
- data/lib/braintree/modification.rb +23 -0
- data/lib/braintree/resource_collection.rb +1 -1
- data/lib/braintree/subscription.rb +29 -129
- data/lib/braintree/subscription_gateway.rb +122 -0
- data/lib/braintree/subscription_search.rb +6 -7
- data/lib/braintree/successful_result.rb +1 -12
- data/lib/braintree/test/credit_card_numbers.rb +4 -2
- data/lib/braintree/test/transaction_amounts.rb +3 -0
- data/lib/braintree/transaction.rb +83 -243
- data/lib/braintree/transaction/credit_card_details.rb +4 -4
- data/lib/braintree/transaction_gateway.rb +124 -0
- data/lib/braintree/transaction_search.rb +5 -3
- data/lib/braintree/transparent_redirect.rb +19 -112
- data/lib/braintree/transparent_redirect_gateway.rb +105 -0
- data/lib/braintree/util.rb +4 -0
- data/lib/braintree/validation_error.rb +1 -0
- data/lib/braintree/validation_error_collection.rb +5 -23
- data/lib/braintree/version.rb +2 -2
- data/lib/braintree/xml/parser.rb +1 -1
- data/lib/braintree/xml/rexml.rb +2 -2
- data/spec/integration/braintree/advanced_search_spec.rb +532 -0
- data/spec/integration/braintree/credit_card_spec.rb +5 -8
- data/spec/integration/braintree/http_spec.rb +53 -39
- data/spec/integration/braintree/subscription_spec.rb +678 -213
- data/spec/integration/braintree/transaction_search_spec.rb +318 -43
- data/spec/integration/braintree/transaction_spec.rb +134 -3
- data/spec/integration/braintree/transparent_redirect_spec.rb +1 -1
- data/spec/spec_helper.rb +55 -4
- data/spec/unit/braintree/address_spec.rb +8 -8
- data/spec/unit/braintree/base_module_spec.rb +1 -1
- data/spec/unit/braintree/configuration_spec.rb +34 -29
- data/spec/unit/braintree/credit_card_spec.rb +14 -12
- data/spec/unit/braintree/credit_card_verification_spec.rb +16 -0
- data/spec/unit/braintree/customer_spec.rb +10 -8
- data/spec/unit/braintree/digest_spec.rb +8 -17
- data/spec/unit/braintree/error_result_spec.rb +12 -2
- data/spec/unit/braintree/http_spec.rb +2 -2
- data/spec/unit/braintree/subscription_search_spec.rb +77 -0
- data/spec/unit/braintree/subscription_spec.rb +16 -8
- data/spec/unit/braintree/transaction_spec.rb +17 -12
- data/spec/unit/braintree/transparent_redirect_spec.rb +12 -12
- data/spec/unit/braintree/util_spec.rb +24 -0
- data/spec/unit/braintree/xml/parser_spec.rb +1 -1
- data/spec/unit/braintree_spec.rb +1 -1
- metadata +16 -5
@@ -93,6 +93,30 @@ describe Braintree::Util do
|
|
93
93
|
)
|
94
94
|
end.to raise_error(ArgumentError, "invalid keys: nested[deeply_allowed][real_deep_invalid], nested[nested_invalid], top_level_invalid")
|
95
95
|
end
|
96
|
+
|
97
|
+
it "does not raise an error for array values" do
|
98
|
+
expect do
|
99
|
+
Braintree::Util.verify_keys(
|
100
|
+
[{:add_ons => [{:update => [:amount]}, {:add => [:amount]}]}],
|
101
|
+
:add_ons => {
|
102
|
+
:update => [{:amount => 10}],
|
103
|
+
:add => [{:amount => 5}]
|
104
|
+
}
|
105
|
+
)
|
106
|
+
end.to_not raise_error
|
107
|
+
end
|
108
|
+
|
109
|
+
it "raises an error for invalid key inside of array" do
|
110
|
+
expect do
|
111
|
+
Braintree::Util.verify_keys(
|
112
|
+
[{:add_ons => [{:update => [:amount]}, {:add => [:amount]}]}],
|
113
|
+
:add_ons => {
|
114
|
+
:update => [{:foo => 10}],
|
115
|
+
:add => [{:bar => 5}]
|
116
|
+
}
|
117
|
+
)
|
118
|
+
end.to_not raise_error(ArgumentError, "invalid keys: add_ons[update][foo], add_ons[add][bar]")
|
119
|
+
end
|
96
120
|
end
|
97
121
|
|
98
122
|
describe "self._flatten_hash_keys" do
|
@@ -27,7 +27,7 @@ describe Braintree::Xml::Parser do
|
|
27
27
|
xml.should parse_to(:root => {:a_nil_value => nil, :an_empty_string => ""})
|
28
28
|
end
|
29
29
|
|
30
|
-
it "typecasts
|
30
|
+
it "typecasts datetimes" do
|
31
31
|
xml = <<-END
|
32
32
|
<root>
|
33
33
|
<created-at type="datetime">2009-10-28T10:19:49Z</created-at>
|
data/spec/unit/braintree_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.dirname(__FILE__) + "/spec_helper"
|
2
2
|
|
3
3
|
describe Braintree do
|
4
|
-
|
4
|
+
xit "ssl warning -- doesn't produce warnings if loading braintree.rb twice" do
|
5
5
|
lib_dir = File.dirname(__FILE__) + "/../../lib"
|
6
6
|
braintree_file = "#{lib_dir}/braintree.rb"
|
7
7
|
File.exist?(braintree_file).should == true
|
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: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 2.
|
8
|
+
- 5
|
9
|
+
- 1
|
10
|
+
version: 2.5.1
|
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: 2010-
|
18
|
+
date: 2010-09-03 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -43,22 +43,30 @@ extra_rdoc_files: []
|
|
43
43
|
files:
|
44
44
|
- README.rdoc
|
45
45
|
- LICENSE
|
46
|
+
- lib/braintree/add_on.rb
|
46
47
|
- lib/braintree/address.rb
|
48
|
+
- lib/braintree/address_gateway.rb
|
47
49
|
- lib/braintree/advanced_search.rb
|
48
50
|
- lib/braintree/base_module.rb
|
49
51
|
- lib/braintree/configuration.rb
|
50
52
|
- lib/braintree/credit_card.rb
|
53
|
+
- lib/braintree/credit_card_gateway.rb
|
51
54
|
- lib/braintree/credit_card_verification.rb
|
52
55
|
- lib/braintree/customer.rb
|
56
|
+
- lib/braintree/customer_gateway.rb
|
53
57
|
- lib/braintree/digest.rb
|
58
|
+
- lib/braintree/discount.rb
|
54
59
|
- lib/braintree/error_codes.rb
|
55
60
|
- lib/braintree/error_result.rb
|
56
61
|
- lib/braintree/errors.rb
|
57
62
|
- lib/braintree/exceptions.rb
|
63
|
+
- lib/braintree/gateway.rb
|
58
64
|
- lib/braintree/http.rb
|
65
|
+
- lib/braintree/modification.rb
|
59
66
|
- lib/braintree/resource_collection.rb
|
60
67
|
- lib/braintree/ssl_expiration_check.rb
|
61
68
|
- lib/braintree/subscription.rb
|
69
|
+
- lib/braintree/subscription_gateway.rb
|
62
70
|
- lib/braintree/subscription_search.rb
|
63
71
|
- lib/braintree/successful_result.rb
|
64
72
|
- lib/braintree/test/credit_card_numbers.rb
|
@@ -68,8 +76,10 @@ files:
|
|
68
76
|
- lib/braintree/transaction/customer_details.rb
|
69
77
|
- lib/braintree/transaction/status_details.rb
|
70
78
|
- lib/braintree/transaction.rb
|
79
|
+
- lib/braintree/transaction_gateway.rb
|
71
80
|
- lib/braintree/transaction_search.rb
|
72
81
|
- lib/braintree/transparent_redirect.rb
|
82
|
+
- lib/braintree/transparent_redirect_gateway.rb
|
73
83
|
- lib/braintree/util.rb
|
74
84
|
- lib/braintree/validation_error.rb
|
75
85
|
- lib/braintree/validation_error_collection.rb
|
@@ -82,6 +92,7 @@ files:
|
|
82
92
|
- lib/braintree.rb
|
83
93
|
- spec/hacks/tcp_socket.rb
|
84
94
|
- spec/integration/braintree/address_spec.rb
|
95
|
+
- spec/integration/braintree/advanced_search_spec.rb
|
85
96
|
- spec/integration/braintree/credit_card_spec.rb
|
86
97
|
- spec/integration/braintree/customer_spec.rb
|
87
98
|
- spec/integration/braintree/error_codes_spec.rb
|