braintree 2.30.2 → 2.31.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8344ccd108c80b288f1aa06fe5ba464b7b30fc72
4
- data.tar.gz: 1f31b8e13d92045c7f195764aff85bf54d0e822f
3
+ metadata.gz: e0920f648b2941d40d8d030472510a465e51651c
4
+ data.tar.gz: 38529f3b6d7602c8b8cc415b8d9d5fab306987c2
5
5
  SHA512:
6
- metadata.gz: 1433ff6de818797a42e80d011fb76cbb8365e7b83f2071c2c8f8f9855bc1f9acee30c3a133f0d804453e1695345bcdd44c74248438730876017e67dac1279b9f
7
- data.tar.gz: c2c7febb1f2827454eb232ed952e03500d0fb720dec58234cdbfe36b0c72b387065cc5fb8b968928f19788ff18a82497bbbeb1acf670598b2eb5d9a61ec71e07
6
+ metadata.gz: 81bccd8f04b057be1947c3b18b6170d66b95c77c70c54ed78c207b116304c795472b4952feb93ba67c2317c0914de1054302dabdfa929e5388c3ac7f836dc489
7
+ data.tar.gz: 1018aee2f14759f670c03828537cc838d237ec6a5b624d5c65869ff5c2c978aebe761a1e01773c40815503a4d0b3ea00751090fc9612f4c284fc6290f11a6b65
@@ -50,6 +50,12 @@ module Braintree
50
50
  Unrecognized = "unrecognized"
51
51
  end
52
52
 
53
+ module IndustryType
54
+ Lodging = "lodging"
55
+
56
+ All = constants.map { |c| const_get(c) }
57
+ end
58
+
53
59
  module Type # :nodoc:
54
60
  Credit = "credit" # :nodoc:
55
61
  Sale = "sale" # :nodoc:
@@ -128,7 +128,8 @@ module Braintree
128
128
  },
129
129
  {:options => [:hold_in_escrow, :store_in_vault, :store_in_vault_on_success, :submit_for_settlement, :add_billing_address_to_payment_method, :store_shipping_address_in_vault, :venmo_sdk_session]},
130
130
  {:custom_fields => :_any_key_},
131
- {:descriptor => [:name, :phone]}
131
+ {:descriptor => [:name, :phone]},
132
+ {:industry => [:industry_type, {:data => [:folio_number, :check_in_date, :check_out_date]}]}
132
133
  ]
133
134
  end
134
135
 
@@ -1,8 +1,8 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 2
4
- Minor = 30
5
- Tiny = 2
4
+ Minor = 31
5
+ Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
8
8
  end
@@ -1 +1 @@
1
- 5195
1
+ 1058
@@ -136,6 +136,49 @@ describe Braintree::Transaction do
136
136
  end
137
137
  end
138
138
 
139
+ describe "industry data" do
140
+ it "accepts valid industry data" do
141
+ result = Braintree::Transaction.create(
142
+ :type => "sale",
143
+ :amount => 1_00,
144
+ :credit_card => {
145
+ :number => Braintree::Test::CreditCardNumbers::CardTypeIndicators::Prepaid,
146
+ :expiration_date => "05/2009"
147
+ },
148
+ :industry => {
149
+ :industry_type => Braintree::Transaction::IndustryType::Lodging,
150
+ :data => {
151
+ :folio_number => "ABCDEFG",
152
+ :check_in_date => "2014-06-01",
153
+ :check_out_date => "2014-06-30"
154
+ }
155
+ }
156
+ )
157
+ result.success?.should be_true
158
+ end
159
+
160
+ it "returns errors if validations on industry data fails" do
161
+ result = Braintree::Transaction.create(
162
+ :type => "sale",
163
+ :amount => 1_00,
164
+ :credit_card => {
165
+ :number => Braintree::Test::CreditCardNumbers::CardTypeIndicators::Prepaid,
166
+ :expiration_date => "05/2009"
167
+ },
168
+ :industry => {
169
+ :industry_type => Braintree::Transaction::IndustryType::Lodging,
170
+ :data => {
171
+ :folio_number => "foo bar",
172
+ :check_in_date => "2014-06-30",
173
+ :check_out_date => "2014-06-01"
174
+ }
175
+ }
176
+ )
177
+ result.success?.should be_false
178
+ result.errors.for(:transaction).for(:industry).map { |e| e.code }.sort.should == ["93403", "93406"]
179
+ end
180
+ end
181
+
139
182
  it "returns a successful result if successful" do
140
183
  result = Braintree::Transaction.create(
141
184
  :type => "sale",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.30.2
4
+ version: 2.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Braintree
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-12 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  requirements: []
206
206
  rubyforge_project: braintree
207
- rubygems_version: 2.2.1
207
+ rubygems_version: 2.2.2
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: Braintree Gateway Ruby Client Library