stripe 3.27.0 → 3.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: c1bbd688d73104dce2fc75c1363172aed7f44f6f6e3d40e634588adc1efd9cb3
4
- data.tar.gz: b05dd5cec9bdaabdd57f305fd1cd08058158d71cea7f2377e98949f12d856c57
2
+ SHA1:
3
+ metadata.gz: 4eb060e72f272d124c007002c81daf48dcca52f4
4
+ data.tar.gz: e83e5e822df5490f6be60e3f21a5166c10784b97
5
5
  SHA512:
6
- metadata.gz: ccb476039053498ddd0b3e67971acdf6b35d81fc7c86b5871523d742eb8534d72f0d1094d93d5ae778125528c33fbfba6552ce3edde0e5b88114aba1b5f3c6c1
7
- data.tar.gz: a347c29e5cf52a0df6d12232cb3cb82a371b536858ce254e296dd1292e3d1422606eb87577307480a6abd5baa706cafb8d444c56c45eb6c7f156d9f048ed9af3
6
+ metadata.gz: aed1ca1d298ea99d11bbbd90a89524aba0d6c5ffad67b983072ca1de1a31832ef1b397617dbe46aa84c3dec4e1959ddeae942e34a540e4b1ece07fcaaf2ab669
7
+ data.tar.gz: 8abe85a2bbca841f42b26dde96e1e27104975d950973c640f45e8908370a07037419c9941c43aad88b8ddd72a300f1d1baaa2695d8fac0c1b1b86a4848fa817f
@@ -18,7 +18,7 @@ sudo: false
18
18
  env:
19
19
  global:
20
20
  # If changing this number, please also change it in `test/test_helper.rb`.
21
- - STRIPE_MOCK_VERSION=0.32.0
21
+ - STRIPE_MOCK_VERSION=0.33.0
22
22
 
23
23
  cache:
24
24
  directories:
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.28.0 - 2018-09-24
4
+ * [#690](https://github.com/stripe/stripe-ruby/pull/690) Add support for Stripe Terminal
5
+
3
6
  ## 3.27.0 - 2018-09-24
4
7
  * [#689](https://github.com/stripe/stripe-ruby/pull/689) Rename `FileUpload` to `File`
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.27.0
1
+ 3.28.0
@@ -86,6 +86,9 @@ require "stripe/source"
86
86
  require "stripe/source_transaction"
87
87
  require "stripe/subscription"
88
88
  require "stripe/subscription_item"
89
+ require "stripe/terminal/connection_token"
90
+ require "stripe/terminal/location"
91
+ require "stripe/terminal/reader"
89
92
  require "stripe/three_d_secure"
90
93
  require "stripe/token"
91
94
  require "stripe/topup"
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Terminal
5
+ class ConnectionToken < Stripe::APIResource
6
+ extend Stripe::APIOperations::Create
7
+
8
+ OBJECT_NAME = "terminal.connection_token".freeze
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Terminal
5
+ class Location < Stripe::APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "terminal.location".freeze
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Terminal
5
+ class Reader < Stripe::APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "terminal.reader".freeze
11
+ end
12
+ end
13
+ end
@@ -45,63 +45,66 @@ module Stripe
45
45
  ListObject::OBJECT_NAME => ListObject,
46
46
 
47
47
  # business objects
48
- Account::OBJECT_NAME => Account,
49
- AlipayAccount::OBJECT_NAME => AlipayAccount,
50
- ApplePayDomain::OBJECT_NAME => ApplePayDomain,
51
- ApplicationFee::OBJECT_NAME => ApplicationFee,
52
- ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
53
- Balance::OBJECT_NAME => Balance,
54
- BalanceTransaction::OBJECT_NAME => BalanceTransaction,
55
- BankAccount::OBJECT_NAME => BankAccount,
56
- BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
57
- BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
58
- Card::OBJECT_NAME => Card,
59
- Charge::OBJECT_NAME => Charge,
60
- CountrySpec::OBJECT_NAME => CountrySpec,
61
- Coupon::OBJECT_NAME => Coupon,
62
- Customer::OBJECT_NAME => Customer,
63
- Dispute::OBJECT_NAME => Dispute,
64
- EphemeralKey::OBJECT_NAME => EphemeralKey,
65
- Event::OBJECT_NAME => Event,
66
- ExchangeRate::OBJECT_NAME => ExchangeRate,
67
- File::OBJECT_NAME => File,
68
- File::OBJECT_NAME_ALT => File,
69
- FileLink::OBJECT_NAME => FileLink,
70
- Invoice::OBJECT_NAME => Invoice,
71
- InvoiceItem::OBJECT_NAME => InvoiceItem,
72
- InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
73
- IssuerFraudRecord::OBJECT_NAME => IssuerFraudRecord,
74
- Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
75
- Issuing::Card::OBJECT_NAME => Issuing::Card,
76
- Issuing::CardDetails::OBJECT_NAME => Issuing::CardDetails,
77
- Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
78
- Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
79
- Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
80
- LoginLink::OBJECT_NAME => LoginLink,
81
- Order::OBJECT_NAME => Order,
82
- OrderReturn::OBJECT_NAME => OrderReturn,
83
- PaymentIntent::OBJECT_NAME => PaymentIntent,
84
- Payout::OBJECT_NAME => Payout,
85
- Plan::OBJECT_NAME => Plan,
86
- Product::OBJECT_NAME => Product,
87
- Recipient::OBJECT_NAME => Recipient,
88
- RecipientTransfer::OBJECT_NAME => RecipientTransfer,
89
- Refund::OBJECT_NAME => Refund,
90
- Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
91
- Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
92
- Reversal::OBJECT_NAME => Reversal,
93
- SKU::OBJECT_NAME => SKU,
94
- Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
95
- Source::OBJECT_NAME => Source,
96
- SourceTransaction::OBJECT_NAME => SourceTransaction,
97
- Subscription::OBJECT_NAME => Subscription,
98
- SubscriptionItem::OBJECT_NAME => SubscriptionItem,
99
- ThreeDSecure::OBJECT_NAME => ThreeDSecure,
100
- Token::OBJECT_NAME => Token,
101
- Topup::OBJECT_NAME => Topup,
102
- Transfer::OBJECT_NAME => Transfer,
103
- UsageRecord::OBJECT_NAME => UsageRecord,
104
- UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
48
+ Account::OBJECT_NAME => Account,
49
+ AlipayAccount::OBJECT_NAME => AlipayAccount,
50
+ ApplePayDomain::OBJECT_NAME => ApplePayDomain,
51
+ ApplicationFee::OBJECT_NAME => ApplicationFee,
52
+ ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
53
+ Balance::OBJECT_NAME => Balance,
54
+ BalanceTransaction::OBJECT_NAME => BalanceTransaction,
55
+ BankAccount::OBJECT_NAME => BankAccount,
56
+ BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
57
+ BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
58
+ Card::OBJECT_NAME => Card,
59
+ Charge::OBJECT_NAME => Charge,
60
+ CountrySpec::OBJECT_NAME => CountrySpec,
61
+ Coupon::OBJECT_NAME => Coupon,
62
+ Customer::OBJECT_NAME => Customer,
63
+ Dispute::OBJECT_NAME => Dispute,
64
+ EphemeralKey::OBJECT_NAME => EphemeralKey,
65
+ Event::OBJECT_NAME => Event,
66
+ ExchangeRate::OBJECT_NAME => ExchangeRate,
67
+ File::OBJECT_NAME => File,
68
+ File::OBJECT_NAME_ALT => File,
69
+ FileLink::OBJECT_NAME => FileLink,
70
+ Invoice::OBJECT_NAME => Invoice,
71
+ InvoiceItem::OBJECT_NAME => InvoiceItem,
72
+ InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
73
+ IssuerFraudRecord::OBJECT_NAME => IssuerFraudRecord,
74
+ Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
75
+ Issuing::Card::OBJECT_NAME => Issuing::Card,
76
+ Issuing::CardDetails::OBJECT_NAME => Issuing::CardDetails,
77
+ Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
78
+ Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
79
+ Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
80
+ LoginLink::OBJECT_NAME => LoginLink,
81
+ Order::OBJECT_NAME => Order,
82
+ OrderReturn::OBJECT_NAME => OrderReturn,
83
+ PaymentIntent::OBJECT_NAME => PaymentIntent,
84
+ Payout::OBJECT_NAME => Payout,
85
+ Plan::OBJECT_NAME => Plan,
86
+ Product::OBJECT_NAME => Product,
87
+ Recipient::OBJECT_NAME => Recipient,
88
+ RecipientTransfer::OBJECT_NAME => RecipientTransfer,
89
+ Refund::OBJECT_NAME => Refund,
90
+ Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
91
+ Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
92
+ Reversal::OBJECT_NAME => Reversal,
93
+ SKU::OBJECT_NAME => SKU,
94
+ Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
95
+ Source::OBJECT_NAME => Source,
96
+ SourceTransaction::OBJECT_NAME => SourceTransaction,
97
+ Subscription::OBJECT_NAME => Subscription,
98
+ SubscriptionItem::OBJECT_NAME => SubscriptionItem,
99
+ Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
100
+ Terminal::Location::OBJECT_NAME => Terminal::Location,
101
+ Terminal::Reader::OBJECT_NAME => Terminal::Reader,
102
+ ThreeDSecure::OBJECT_NAME => ThreeDSecure,
103
+ Token::OBJECT_NAME => Token,
104
+ Topup::OBJECT_NAME => Topup,
105
+ Transfer::OBJECT_NAME => Transfer,
106
+ UsageRecord::OBJECT_NAME => UsageRecord,
107
+ UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
105
108
  }
106
109
  end
107
110
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "3.27.0".freeze
4
+ VERSION = "3.28.0".freeze
5
5
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require ::File.expand_path("../../../test_helper", __FILE__)
4
+
5
+ module Stripe
6
+ module Terminal
7
+ class ConnectionTokenTest < Test::Unit::TestCase
8
+ should "be creatable" do
9
+ connection_token = Stripe::Terminal::ConnectionToken.create
10
+
11
+ assert_requested :post, "#{Stripe.api_base}/v1/terminal/connection_tokens"
12
+ assert connection_token.is_a?(Stripe::Terminal::ConnectionToken)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require ::File.expand_path("../../../test_helper", __FILE__)
4
+
5
+ module Stripe
6
+ module Terminal
7
+ class LocationTest < Test::Unit::TestCase
8
+ should "be creatable" do
9
+ location = Stripe::Terminal::Location.create(
10
+ address: {
11
+ line1: "line1",
12
+ country: "US",
13
+ postal_code: "12345",
14
+ city: "San Francisco",
15
+ state: "CA",
16
+ },
17
+ display_name: "name"
18
+ )
19
+ assert_requested :post, "#{Stripe.api_base}/v1/terminal/locations"
20
+ assert location.is_a?(Stripe::Terminal::Location)
21
+ end
22
+
23
+ should "be listable" do
24
+ locations = Stripe::Terminal::Location.list
25
+ assert_requested :get, "#{Stripe.api_base}/v1/terminal/locations"
26
+ assert locations.data.is_a?(Array)
27
+ assert locations.data[0].is_a?(Stripe::Terminal::Location)
28
+ end
29
+
30
+ should "be retrievable" do
31
+ location = Stripe::Terminal::Location.retrieve("loc_123")
32
+ assert_requested :get, "#{Stripe.api_base}/v1/terminal/locations/loc_123"
33
+ assert location.is_a?(Stripe::Terminal::Location)
34
+ end
35
+
36
+ should "be saveable" do
37
+ location = Stripe::Terminal::Location.retrieve("loc_123")
38
+ location["display_name"] = "new name"
39
+ location.save
40
+ assert_requested :post, "#{Stripe.api_base}/v1/terminal/locations/loc_123"
41
+ assert location.is_a?(Stripe::Terminal::Location)
42
+ end
43
+
44
+ should "be updateable" do
45
+ location = Stripe::Terminal::Location.update("loc_123", display_name: "new name")
46
+ assert_requested :post, "#{Stripe.api_base}/v1/terminal/locations/loc_123"
47
+ assert location.is_a?(Stripe::Terminal::Location)
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require ::File.expand_path("../../../test_helper", __FILE__)
4
+
5
+ module Stripe
6
+ module Terminal
7
+ class ReaderTest < Test::Unit::TestCase
8
+ should "be creatable" do
9
+ reader = Stripe::Terminal::Reader.create(
10
+ registration_code: "elegant-orange-aqua",
11
+ label: "label"
12
+ )
13
+ assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers"
14
+ assert reader.is_a?(Stripe::Terminal::Reader)
15
+ end
16
+
17
+ should "be listable" do
18
+ readers = Stripe::Terminal::Reader.list
19
+ assert_requested :get, "#{Stripe.api_base}/v1/terminal/readers"
20
+ assert readers.data.is_a?(Array)
21
+ assert readers.data[0].is_a?(Stripe::Terminal::Reader)
22
+ end
23
+
24
+ should "be retrievable" do
25
+ reader = Stripe::Terminal::Reader.retrieve("rdr_123")
26
+ assert_requested :get, "#{Stripe.api_base}/v1/terminal/readers/rdr_123"
27
+ assert reader.is_a?(Stripe::Terminal::Reader)
28
+ end
29
+
30
+ should "be saveable" do
31
+ reader = Stripe::Terminal::Reader.retrieve("rdr_123")
32
+ reader["label"] = "new label"
33
+ reader.save
34
+ assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/rdr_123"
35
+ assert reader.is_a?(Stripe::Terminal::Reader)
36
+ end
37
+
38
+ should "be updateable" do
39
+ reader = Stripe::Terminal::Reader.update("rdr_123", label: "new label")
40
+ assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/rdr_123"
41
+ assert reader.is_a?(Stripe::Terminal::Reader)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -16,7 +16,7 @@ PROJECT_ROOT = ::File.expand_path("../../", __FILE__)
16
16
  require ::File.expand_path("../test_data", __FILE__)
17
17
 
18
18
  # If changing this number, please also change it in `.travis.yml`.
19
- MOCK_MINIMUM_VERSION = "0.32.0".freeze
19
+ MOCK_MINIMUM_VERSION = "0.33.0".freeze
20
20
  MOCK_PORT = ENV["STRIPE_MOCK_PORT"] || 12_111
21
21
 
22
22
  # Disable all real network connections except those that are outgoing to
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.27.0
4
+ version: 3.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
@@ -113,6 +113,9 @@ files:
113
113
  - lib/stripe/stripe_response.rb
114
114
  - lib/stripe/subscription.rb
115
115
  - lib/stripe/subscription_item.rb
116
+ - lib/stripe/terminal/connection_token.rb
117
+ - lib/stripe/terminal/location.rb
118
+ - lib/stripe/terminal/reader.rb
116
119
  - lib/stripe/three_d_secure.rb
117
120
  - lib/stripe/token.rb
118
121
  - lib/stripe/topup.rb
@@ -181,6 +184,9 @@ files:
181
184
  - test/stripe/stripe_response_test.rb
182
185
  - test/stripe/subscription_item_test.rb
183
186
  - test/stripe/subscription_test.rb
187
+ - test/stripe/terminal/connection_token_test.rb
188
+ - test/stripe/terminal/location_test.rb
189
+ - test/stripe/terminal/reader_test.rb
184
190
  - test/stripe/three_d_secure_test.rb
185
191
  - test/stripe/topup_test.rb
186
192
  - test/stripe/transfer_reversals_operations_test.rb
@@ -212,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
218
  version: '0'
213
219
  requirements: []
214
220
  rubyforge_project:
215
- rubygems_version: 2.7.7
221
+ rubygems_version: 2.6.14
216
222
  signing_key:
217
223
  specification_version: 4
218
224
  summary: Ruby bindings for the Stripe API
@@ -275,6 +281,9 @@ test_files:
275
281
  - test/stripe/stripe_response_test.rb
276
282
  - test/stripe/subscription_item_test.rb
277
283
  - test/stripe/subscription_test.rb
284
+ - test/stripe/terminal/connection_token_test.rb
285
+ - test/stripe/terminal/location_test.rb
286
+ - test/stripe/terminal/reader_test.rb
278
287
  - test/stripe/three_d_secure_test.rb
279
288
  - test/stripe/topup_test.rb
280
289
  - test/stripe/transfer_reversals_operations_test.rb