stripe 4.3.0 → 4.4.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
2
  SHA256:
3
- metadata.gz: 6b28b9ff50ecbcd73d221d19938f50f2f1e35986acbb5c09c5ae8f0d742e1a33
4
- data.tar.gz: 64f3e9a9019521a79a0f23a63f4bfb1fe42c0d7e7288977834153abd363bb246
3
+ metadata.gz: c6de5937bd8a3dbcb24eff963fe7fc5c9eadb51277bd0fb9eb0da1e4d29ed7ae
4
+ data.tar.gz: f932fda4faabb39cc3ebea6486b7316a39f0a16a83fcacd4e3546d8cabff48a7
5
5
  SHA512:
6
- metadata.gz: f5152f8d58831aaac3376389cc65bbe7b2a25a5c74e4f2399669e90ec55fbed597c63c159bf80282af80aff0f6635f8a99a58fb3c48aa9f4f72292f71c93a264
7
- data.tar.gz: 4a8768386763b33ff541d8a6feb4fce4b0c7490bdae5f0337f5a171d641a9cf4cb0982053c906303ae44a32ccc7e47532eb834042d9a10199656b14107996ca7
6
+ metadata.gz: 8677c53d52d58d392a3b79329f3e7b582e3b89748a6dacee46befef16402777c31fc73ceef3538df62d02ed3d0f268032316519f58671ee1857b2b446daca32d
7
+ data.tar.gz: 5902050338e4224c82e70e14d0a84c3aa5be36f184f530646d1978c5afe2a1e4bb875b2d4a7610510a7e252644abc1a8eb919c03b85bae5191665155c8ab3d5a
data/.travis.yml CHANGED
@@ -17,7 +17,7 @@ sudo: false
17
17
  env:
18
18
  global:
19
19
  # If changing this number, please also change it in `test/test_helper.rb`.
20
- - STRIPE_MOCK_VERSION=0.39.0
20
+ - STRIPE_MOCK_VERSION=0.40.0
21
21
 
22
22
  cache:
23
23
  directories:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.4.0 - 2018-12-21
4
+ * [#716](https://github.com/stripe/stripe-ruby/pull/716) Add support for the `CheckoutSession` resource
5
+
3
6
  ## 4.3.0 - 2018-12-10
4
7
  * [#711](https://github.com/stripe/stripe-ruby/pull/711) Add support for account links
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.3.0
1
+ 4.4.0
data/lib/stripe.rb CHANGED
@@ -49,6 +49,7 @@ require "stripe/bitcoin_receiver"
49
49
  require "stripe/bitcoin_transaction"
50
50
  require "stripe/card"
51
51
  require "stripe/charge"
52
+ require "stripe/checkout_session"
52
53
  require "stripe/country_spec"
53
54
  require "stripe/coupon"
54
55
  require "stripe/customer"
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class CheckoutSession < APIResource
5
+ extend Stripe::APIOperations::Create
6
+
7
+ OBJECT_NAME = "checkout_session".freeze
8
+ end
9
+ end
data/lib/stripe/util.rb CHANGED
@@ -58,6 +58,7 @@ module Stripe
58
58
  BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
59
59
  Card::OBJECT_NAME => Card,
60
60
  Charge::OBJECT_NAME => Charge,
61
+ CheckoutSession::OBJECT_NAME => CheckoutSession,
61
62
  CountrySpec::OBJECT_NAME => CountrySpec,
62
63
  Coupon::OBJECT_NAME => Coupon,
63
64
  Customer::OBJECT_NAME => Customer,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "4.3.0".freeze
4
+ VERSION = "4.4.0".freeze
5
5
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require ::File.expand_path("../../test_helper", __FILE__)
4
+
5
+ module Stripe
6
+ class CheckoutSessionTest < Test::Unit::TestCase
7
+ should "be creatable" do
8
+ session = Stripe::CheckoutSession.create(
9
+ allowed_source_types: ["card"],
10
+ cancel_url: "https://stripe.com/cancel",
11
+ client_reference_id: "1234",
12
+ line_items: [
13
+ {
14
+ amount: 123,
15
+ currency: "usd",
16
+ description: "item 1",
17
+ images: [
18
+ "https://stripe.com/img1",
19
+ ],
20
+ name: "name",
21
+ quantity: 2,
22
+ },
23
+ ],
24
+ payment_intent_data: [
25
+ receipt_email: "test@stripe.com",
26
+ ],
27
+ success_url: "https://stripe.com/success"
28
+ )
29
+ assert_requested :post, "#{Stripe.api_base}/v1/checkout_sessions"
30
+ assert session.is_a?(Stripe::CheckoutSession)
31
+ end
32
+ end
33
+ end
data/test/test_helper.rb CHANGED
@@ -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.39.0".freeze
19
+ MOCK_MINIMUM_VERSION = "0.40.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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-11 00:00:00.000000000 Z
11
+ date: 2018-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -83,6 +83,7 @@ files:
83
83
  - lib/stripe/bitcoin_transaction.rb
84
84
  - lib/stripe/card.rb
85
85
  - lib/stripe/charge.rb
86
+ - lib/stripe/checkout_session.rb
86
87
  - lib/stripe/country_spec.rb
87
88
  - lib/stripe/coupon.rb
88
89
  - lib/stripe/customer.rb
@@ -162,6 +163,7 @@ files:
162
163
  - test/stripe/balance_test.rb
163
164
  - test/stripe/bank_account_test.rb
164
165
  - test/stripe/charge_test.rb
166
+ - test/stripe/checkout_session_test.rb
165
167
  - test/stripe/country_spec_test.rb
166
168
  - test/stripe/coupon_test.rb
167
169
  - test/stripe/customer_card_test.rb
@@ -266,6 +268,7 @@ test_files:
266
268
  - test/stripe/balance_test.rb
267
269
  - test/stripe/bank_account_test.rb
268
270
  - test/stripe/charge_test.rb
271
+ - test/stripe/checkout_session_test.rb
269
272
  - test/stripe/country_spec_test.rb
270
273
  - test/stripe/coupon_test.rb
271
274
  - test/stripe/customer_card_test.rb