stripe 5.22.0 → 5.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe/object_types.rb +1 -0
- data/lib/stripe/resources.rb +1 -0
- data/lib/stripe/resources/account.rb +1 -0
- data/lib/stripe/resources/account_link.rb +1 -0
- data/lib/stripe/resources/apple_pay_domain.rb +1 -0
- data/lib/stripe/resources/application_fee.rb +1 -0
- data/lib/stripe/resources/balance.rb +1 -0
- data/lib/stripe/resources/balance_transaction.rb +1 -0
- data/lib/stripe/resources/bank_account.rb +1 -0
- data/lib/stripe/resources/billing_portal/session.rb +1 -0
- data/lib/stripe/resources/bitcoin_receiver.rb +1 -0
- data/lib/stripe/resources/card.rb +1 -0
- data/lib/stripe/resources/charge.rb +1 -0
- data/lib/stripe/resources/checkout/session.rb +1 -0
- data/lib/stripe/resources/country_spec.rb +1 -0
- data/lib/stripe/resources/coupon.rb +1 -0
- data/lib/stripe/resources/credit_note.rb +1 -0
- data/lib/stripe/resources/customer.rb +1 -0
- data/lib/stripe/resources/dispute.rb +1 -0
- data/lib/stripe/resources/ephemeral_key.rb +1 -0
- data/lib/stripe/resources/event.rb +1 -0
- data/lib/stripe/resources/exchange_rate.rb +1 -0
- data/lib/stripe/resources/file.rb +1 -0
- data/lib/stripe/resources/file_link.rb +1 -0
- data/lib/stripe/resources/invoice.rb +1 -0
- data/lib/stripe/resources/invoice_item.rb +1 -0
- data/lib/stripe/resources/issuing/authorization.rb +1 -0
- data/lib/stripe/resources/issuing/card.rb +1 -0
- data/lib/stripe/resources/issuing/cardholder.rb +1 -0
- data/lib/stripe/resources/issuing/dispute.rb +1 -0
- data/lib/stripe/resources/issuing/transaction.rb +1 -0
- data/lib/stripe/resources/mandate.rb +1 -0
- data/lib/stripe/resources/order.rb +1 -0
- data/lib/stripe/resources/order_return.rb +1 -0
- data/lib/stripe/resources/payment_intent.rb +1 -0
- data/lib/stripe/resources/payment_method.rb +1 -0
- data/lib/stripe/resources/payout.rb +1 -0
- data/lib/stripe/resources/plan.rb +1 -0
- data/lib/stripe/resources/price.rb +1 -0
- data/lib/stripe/resources/product.rb +1 -0
- data/lib/stripe/resources/promotion_code.rb +12 -0
- data/lib/stripe/resources/radar/early_fraud_warning.rb +1 -0
- data/lib/stripe/resources/radar/value_list.rb +1 -0
- data/lib/stripe/resources/radar/value_list_item.rb +1 -0
- data/lib/stripe/resources/recipient.rb +1 -0
- data/lib/stripe/resources/refund.rb +1 -0
- data/lib/stripe/resources/reporting/report_run.rb +1 -0
- data/lib/stripe/resources/reporting/report_type.rb +1 -0
- data/lib/stripe/resources/review.rb +1 -0
- data/lib/stripe/resources/setup_intent.rb +1 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +1 -0
- data/lib/stripe/resources/sku.rb +1 -0
- data/lib/stripe/resources/source.rb +1 -0
- data/lib/stripe/resources/subscription.rb +1 -0
- data/lib/stripe/resources/subscription_item.rb +1 -0
- data/lib/stripe/resources/subscription_schedule.rb +1 -0
- data/lib/stripe/resources/tax_rate.rb +1 -0
- data/lib/stripe/resources/terminal/connection_token.rb +1 -0
- data/lib/stripe/resources/terminal/location.rb +1 -0
- data/lib/stripe/resources/terminal/reader.rb +1 -0
- data/lib/stripe/resources/three_d_secure.rb +1 -0
- data/lib/stripe/resources/token.rb +1 -0
- data/lib/stripe/resources/topup.rb +1 -0
- data/lib/stripe/resources/transfer.rb +1 -0
- data/lib/stripe/resources/webhook_endpoint.rb +1 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/account_link_test.rb +3 -3
- data/test/stripe/promotion_code_test.rb +42 -0
- data/test/stripe/subscription_item_test.rb +1 -1
- data/test/test_helper.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 339246c958404a761dbafcfbd76acfcf7f2223838e41efd928babd1624f1f173
|
4
|
+
data.tar.gz: 8d7385cfe0066b9dd4ad53a2f3d3ebcace2b22f77b27cd8fe252bfb7f58118e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3170fd6a145e41cc69b25ddbeb20cc88064fb4011ee89438d07362c745c2990523c1ea25c319c25910e5670bba7f27d97b2453462fc441c31d0db3b0ff761c46
|
7
|
+
data.tar.gz: bc2ae7b487bfd0a7957e360862188bcda79f9f851504162ec9c30ecf3c0a824a2050e73a0e5d3ceb3840511b8585b4710e3a97864b3eb7e0ddcb315b79f60a8d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 5.23.0 - 2020-08-05
|
4
|
+
* [#937](https://github.com/stripe/stripe-ruby/pull/937) Add support for the `PromotionCode` resource and APIs
|
5
|
+
|
3
6
|
## 5.22.0 - 2020-05-11
|
4
7
|
* [#918](https://github.com/stripe/stripe-ruby/pull/918) Add support for the `LineItem` resource and APIs
|
5
8
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.
|
1
|
+
5.23.0
|
data/lib/stripe/object_types.rb
CHANGED
@@ -61,6 +61,7 @@ module Stripe
|
|
61
61
|
Plan::OBJECT_NAME => Plan,
|
62
62
|
Price::OBJECT_NAME => Price,
|
63
63
|
Product::OBJECT_NAME => Product,
|
64
|
+
PromotionCode::OBJECT_NAME => PromotionCode,
|
64
65
|
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
|
65
66
|
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
|
66
67
|
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
|
data/lib/stripe/resources.rb
CHANGED
@@ -50,6 +50,7 @@ require "stripe/resources/person"
|
|
50
50
|
require "stripe/resources/plan"
|
51
51
|
require "stripe/resources/price"
|
52
52
|
require "stripe/resources/product"
|
53
|
+
require "stripe/resources/promotion_code"
|
53
54
|
require "stripe/resources/radar/early_fraud_warning"
|
54
55
|
require "stripe/resources/radar/value_list"
|
55
56
|
require "stripe/resources/radar/value_list_item"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class PromotionCode < APIResource
|
6
|
+
extend Stripe::APIOperations::Create
|
7
|
+
extend Stripe::APIOperations::List
|
8
|
+
include Stripe::APIOperations::Save
|
9
|
+
|
10
|
+
OBJECT_NAME = "promotion_code"
|
11
|
+
end
|
12
|
+
end
|
data/lib/stripe/resources/sku.rb
CHANGED
data/lib/stripe/version.rb
CHANGED
@@ -7,9 +7,9 @@ module Stripe
|
|
7
7
|
should "be creatable" do
|
8
8
|
link = Stripe::AccountLink.create(
|
9
9
|
account: "acct_123",
|
10
|
-
|
11
|
-
|
12
|
-
type: "
|
10
|
+
refresh_url: "https://stripe.com/refresh",
|
11
|
+
return_url: "https://stripe.com/return",
|
12
|
+
type: "account_onboarding"
|
13
13
|
)
|
14
14
|
assert_requested :post, "#{Stripe.api_base}/v1/account_links"
|
15
15
|
assert link.is_a?(Stripe::AccountLink)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require ::File.expand_path("../test_helper", __dir__)
|
4
|
+
|
5
|
+
module Stripe
|
6
|
+
class PromotionCodeTest < Test::Unit::TestCase
|
7
|
+
should "be listable" do
|
8
|
+
promotion_codes = Stripe::PromotionCode.list
|
9
|
+
assert_requested :get, "#{Stripe.api_base}/v1/promotion_codes"
|
10
|
+
assert promotion_codes.data.is_a?(Array)
|
11
|
+
assert promotion_codes.first.is_a?(Stripe::PromotionCode)
|
12
|
+
end
|
13
|
+
|
14
|
+
should "be retrievable" do
|
15
|
+
coupon = Stripe::PromotionCode.retrieve("PROMO_123")
|
16
|
+
assert_requested :get, "#{Stripe.api_base}/v1/promotion_codes/PROMO_123"
|
17
|
+
assert coupon.is_a?(Stripe::PromotionCode)
|
18
|
+
end
|
19
|
+
|
20
|
+
should "be creatable" do
|
21
|
+
coupon = Stripe::PromotionCode.create(
|
22
|
+
coupon: "co_123",
|
23
|
+
code: "MYCODE"
|
24
|
+
)
|
25
|
+
assert_requested :post, "#{Stripe.api_base}/v1/promotion_codes"
|
26
|
+
assert coupon.is_a?(Stripe::PromotionCode)
|
27
|
+
end
|
28
|
+
|
29
|
+
should "be saveable" do
|
30
|
+
coupon = Stripe::PromotionCode.retrieve("PROMO_123")
|
31
|
+
coupon.metadata["key"] = "value"
|
32
|
+
coupon.save
|
33
|
+
assert_requested :post, "#{Stripe.api_base}/v1/promotion_codes/#{coupon.id}"
|
34
|
+
end
|
35
|
+
|
36
|
+
should "be updateable" do
|
37
|
+
coupon = Stripe::PromotionCode.update("PROMO_123", metadata: { key: "value" })
|
38
|
+
assert_requested :post, "#{Stripe.api_base}/v1/promotion_codes/PROMO_123"
|
39
|
+
assert coupon.is_a?(Stripe::PromotionCode)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -16,7 +16,7 @@ require ::File.expand_path("test_data", __dir__)
|
|
16
16
|
require ::File.expand_path("stripe_mock", __dir__)
|
17
17
|
|
18
18
|
# If changing this number, please also change it in `.travis.yml`.
|
19
|
-
MOCK_MINIMUM_VERSION = "0.
|
19
|
+
MOCK_MINIMUM_VERSION = "0.95.0"
|
20
20
|
MOCK_PORT = Stripe::StripeMock.start
|
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: 5.
|
4
|
+
version: 5.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05
|
11
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Stripe is the easiest way to accept payments online. See https://stripe.com
|
14
14
|
for details.
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/stripe/resources/plan.rb
|
106
106
|
- lib/stripe/resources/price.rb
|
107
107
|
- lib/stripe/resources/product.rb
|
108
|
+
- lib/stripe/resources/promotion_code.rb
|
108
109
|
- lib/stripe/resources/radar/early_fraud_warning.rb
|
109
110
|
- lib/stripe/resources/radar/value_list.rb
|
110
111
|
- lib/stripe/resources/radar/value_list_item.rb
|
@@ -195,6 +196,7 @@ files:
|
|
195
196
|
- test/stripe/plan_test.rb
|
196
197
|
- test/stripe/price_test.rb
|
197
198
|
- test/stripe/product_test.rb
|
199
|
+
- test/stripe/promotion_code_test.rb
|
198
200
|
- test/stripe/radar/early_fraud_warning_test.rb
|
199
201
|
- test/stripe/radar/value_list_item_test.rb
|
200
202
|
- test/stripe/radar/value_list_test.rb
|
@@ -312,6 +314,7 @@ test_files:
|
|
312
314
|
- test/stripe/plan_test.rb
|
313
315
|
- test/stripe/price_test.rb
|
314
316
|
- test/stripe/product_test.rb
|
317
|
+
- test/stripe/promotion_code_test.rb
|
315
318
|
- test/stripe/radar/early_fraud_warning_test.rb
|
316
319
|
- test/stripe/radar/value_list_item_test.rb
|
317
320
|
- test/stripe/radar/value_list_test.rb
|