stripe 6.6.0.pre.beta.1 → 7.1.0.pre.beta.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,8 @@
3
3
 
4
4
  module Stripe
5
5
  module ApiVersion
6
- CURRENT = "2020-08-27; server_side_confirmation_beta=v1"
6
+ # rubocop:disable Layout/LineLength
7
+ CURRENT = "2022-08-01; server_side_confirmation_beta=v1; orders_beta=v4; terminal_interac_refunds_beta=v1"
8
+ # rubocop:enable Layout/LineLength
7
9
  end
8
10
  end
@@ -14,7 +14,6 @@ module Stripe
14
14
  # business objects
15
15
  Account::OBJECT_NAME => Account,
16
16
  AccountLink::OBJECT_NAME => AccountLink,
17
- AlipayAccount::OBJECT_NAME => AlipayAccount,
18
17
  ApplePayDomain::OBJECT_NAME => ApplePayDomain,
19
18
  ApplicationFee::OBJECT_NAME => ApplicationFee,
20
19
  ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
@@ -24,8 +23,6 @@ module Stripe
24
23
  BankAccount::OBJECT_NAME => BankAccount,
25
24
  BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
26
25
  BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
27
- BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
28
- BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
29
26
  Capability::OBJECT_NAME => Capability,
30
27
  Card::OBJECT_NAME => Card,
31
28
  CashBalance::OBJECT_NAME => CashBalance,
@@ -58,7 +55,6 @@ module Stripe
58
55
  InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
59
56
  Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
60
57
  Issuing::Card::OBJECT_NAME => Issuing::Card,
61
- Issuing::CardDetails::OBJECT_NAME => Issuing::CardDetails,
62
58
  Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
63
59
  Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
64
60
  Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
@@ -80,8 +76,6 @@ module Stripe
80
76
  Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
81
77
  Radar::ValueList::OBJECT_NAME => Radar::ValueList,
82
78
  Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
83
- Recipient::OBJECT_NAME => Recipient,
84
- RecipientTransfer::OBJECT_NAME => RecipientTransfer,
85
79
  Refund::OBJECT_NAME => Refund,
86
80
  Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
87
81
  Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
@@ -105,7 +99,6 @@ module Stripe
105
99
  Terminal::Location::OBJECT_NAME => Terminal::Location,
106
100
  Terminal::Reader::OBJECT_NAME => Terminal::Reader,
107
101
  TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
108
- ThreeDSecure::OBJECT_NAME => ThreeDSecure,
109
102
  Token::OBJECT_NAME => Token,
110
103
  Topup::OBJECT_NAME => Topup,
111
104
  Transfer::OBJECT_NAME => Transfer,
@@ -10,9 +10,7 @@ module Stripe
10
10
  OBJECT_NAME = "card"
11
11
 
12
12
  def resource_url
13
- if respond_to?(:recipient) && !recipient.nil? && !recipient.empty?
14
- "#{Recipient.resource_url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
15
- elsif respond_to?(:customer) && !customer.nil? && !customer.empty?
13
+ if respond_to?(:customer) && !customer.nil? && !customer.empty?
16
14
  "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
17
15
  elsif respond_to?(:account) && !account.nil? && !account.empty?
18
16
  "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
@@ -6,12 +6,9 @@ module Stripe
6
6
  class Session < APIResource
7
7
  extend Stripe::APIOperations::Create
8
8
  extend Stripe::APIOperations::List
9
- extend Stripe::APIOperations::NestedResource
10
9
 
11
10
  OBJECT_NAME = "checkout.session"
12
11
 
13
- nested_resource_class_methods :line_item, operations: %i[list]
14
-
15
12
  def expire(params = {}, opts = {})
16
13
  request_stripe_object(
17
14
  method: :post,
@@ -21,6 +18,15 @@ module Stripe
21
18
  )
22
19
  end
23
20
 
21
+ def list_line_items(params = {}, opts = {})
22
+ request_stripe_object(
23
+ method: :get,
24
+ path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(self["id"]) }),
25
+ params: params,
26
+ opts: opts
27
+ )
28
+ end
29
+
24
30
  def self.expire(session, params = {}, opts = {})
25
31
  request_stripe_object(
26
32
  method: :post,
@@ -29,6 +35,15 @@ module Stripe
29
35
  opts: opts
30
36
  )
31
37
  end
38
+
39
+ def self.list_line_items(session, params = {}, opts = {})
40
+ request_stripe_object(
41
+ method: :get,
42
+ path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(session) }),
43
+ params: params,
44
+ opts: opts
45
+ )
46
+ end
32
47
  end
33
48
  end
34
49
  end
@@ -26,6 +26,15 @@ module Stripe
26
26
  )
27
27
  end
28
28
 
29
+ def delete_discount(params = {}, opts = {})
30
+ request_stripe_object(
31
+ method: :delete,
32
+ path: format("/v1/customers/%<customer>s/discount", { customer: CGI.escape(self["id"]) }),
33
+ params: params,
34
+ opts: opts
35
+ )
36
+ end
37
+
29
38
  def list_payment_methods(params = {}, opts = {})
30
39
  request_stripe_object(
31
40
  method: :get,
@@ -53,6 +62,15 @@ module Stripe
53
62
  )
54
63
  end
55
64
 
65
+ def self.delete_discount(customer, params = {}, opts = {})
66
+ request_stripe_object(
67
+ method: :delete,
68
+ path: format("/v1/customers/%<customer>s/discount", { customer: CGI.escape(customer) }),
69
+ params: params,
70
+ opts: opts
71
+ )
72
+ end
73
+
56
74
  def self.list_payment_methods(customer, params = {}, opts = {})
57
75
  request_stripe_object(
58
76
  method: :get,
@@ -85,20 +103,6 @@ module Stripe
85
103
  class << self
86
104
  alias detach_source delete_source
87
105
  end
88
- custom_method :delete_discount, http_verb: :delete, http_path: "discount"
89
-
90
- # Deletes a discount associated with the customer.
91
- #
92
- # Returns the deleted discount. The customer object is not updated,
93
- # so you must call `refresh` on it to get a new version with the
94
- # discount removed.
95
- def delete_discount
96
- request_stripe_object(
97
- method: :delete,
98
- path: resource_url + "/discount",
99
- params: {}
100
- )
101
- end
102
106
 
103
107
  def self.search(params = {}, opts = {})
104
108
  _search("/v1/customers/search", params, opts)
@@ -108,36 +112,16 @@ module Stripe
108
112
  search(params, opts).auto_paging_each(&blk)
109
113
  end
110
114
 
111
- def self.retrieve_cash_balance(
112
- customer,
113
- opts_or_unused_nested_id = nil,
114
- opts = {}
115
- )
116
- # Support two call patterns for backwards compatibility.
117
- # 1. Legacy: (nil unused nested_id, opts)
118
- # 2. Fixed pattern: (opts)
119
- if !opts_or_unused_nested_id.nil? && opts_or_unused_nested_id.class == Hash && opts.empty?
120
- opts = opts_or_unused_nested_id
121
- end
115
+ def self.retrieve_cash_balance(customer, params = {}, opts = {})
122
116
  request_stripe_object(
123
117
  method: :get,
124
118
  path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
125
- params: {},
119
+ params: params,
126
120
  opts: opts
127
121
  )
128
122
  end
129
123
 
130
- def self.update_cash_balance(
131
- customer,
132
- unused_nested_id = nil,
133
- params = {},
134
- opts = {}
135
- )
136
- # Do not allow passing in a hash as the second argument, as we require a nil for compatibility reasons. We cannot differentiate from a legacy pattern (nil, params) and a modern pattern (nil for params, opts).
137
- if !unused_nested_id.nil? && unused_nested_id.class == Hash
138
- raise ArgumentError, "update_cash_balance requires the second argument always be nil for legacy reasons."
139
- end
140
-
124
+ def self.update_cash_balance(customer, params = {}, opts = {})
141
125
  request_stripe_object(
142
126
  method: :post,
143
127
  path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
@@ -10,24 +10,6 @@ module Stripe
10
10
 
11
11
  OBJECT_NAME = "issuing.card"
12
12
 
13
- def details(params = {}, opts = {})
14
- request_stripe_object(
15
- method: :get,
16
- path: format("/v1/issuing/cards/%<card>s/details", { card: CGI.escape(self["id"]) }),
17
- params: params,
18
- opts: opts
19
- )
20
- end
21
-
22
- def self.details(card, params = {}, opts = {})
23
- request_stripe_object(
24
- method: :get,
25
- path: format("/v1/issuing/cards/%<card>s/details", { card: CGI.escape(card) }),
26
- params: params,
27
- opts: opts
28
- )
29
- end
30
-
31
13
  def test_helpers
32
14
  TestHelpers.new(self)
33
15
  end
@@ -4,7 +4,6 @@
4
4
  module Stripe
5
5
  module Reporting
6
6
  class ReportType < APIResource
7
- extend Stripe::APIOperations::Create
8
7
  extend Stripe::APIOperations::List
9
8
 
10
9
  OBJECT_NAME = "reporting.report_type"
@@ -4,13 +4,21 @@
4
4
  module Stripe
5
5
  class Subscription < APIResource
6
6
  extend Stripe::APIOperations::Create
7
- include Stripe::APIOperations::Delete
8
7
  extend Stripe::APIOperations::List
9
8
  extend Stripe::APIOperations::Search
10
9
  include Stripe::APIOperations::Save
11
10
 
12
11
  OBJECT_NAME = "subscription"
13
12
 
13
+ def cancel(params = {}, opts = {})
14
+ request_stripe_object(
15
+ method: :delete,
16
+ path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(self["id"]) }),
17
+ params: params,
18
+ opts: opts
19
+ )
20
+ end
21
+
14
22
  def delete_discount(params = {}, opts = {})
15
23
  request_stripe_object(
16
24
  method: :delete,
@@ -20,6 +28,15 @@ module Stripe
20
28
  )
21
29
  end
22
30
 
31
+ def self.cancel(subscription_exposed_id, params = {}, opts = {})
32
+ request_stripe_object(
33
+ method: :delete,
34
+ path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(subscription_exposed_id) }),
35
+ params: params,
36
+ opts: opts
37
+ )
38
+ end
39
+
23
40
  def self.delete_discount(subscription_exposed_id, params = {}, opts = {})
24
41
  request_stripe_object(
25
42
  method: :delete,
@@ -30,6 +47,31 @@ module Stripe
30
47
  end
31
48
 
32
49
  save_nested_resource :source
50
+ def delete(params = {}, opts = {})
51
+ request_stripe_object(
52
+ method: :delete,
53
+ path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(self["id"]) }),
54
+ params: params,
55
+ opts: opts
56
+ )
57
+ end
58
+
59
+ def self.delete(subscription_exposed_id, params = {}, opts = {})
60
+ request_stripe_object(
61
+ method: :delete,
62
+ path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(subscription_exposed_id) }),
63
+ params: params,
64
+ opts: opts
65
+ )
66
+ end
67
+
68
+ extend Gem::Deprecate
69
+ deprecate :delete, "Stripe::Subscription.cancel", 2022, 7
70
+
71
+ class << self
72
+ extend Gem::Deprecate
73
+ deprecate :delete, "Stripe::Subscription#cancel", 2022, 7
74
+ end
33
75
 
34
76
  def self.search(params = {}, opts = {})
35
77
  _search("/v1/subscriptions/search", params, opts)
@@ -15,16 +15,5 @@ module Stripe
15
15
  nested_resource_class_methods :usage_record_summary,
16
16
  operations: %i[list],
17
17
  resource_plural: "usage_record_summaries"
18
-
19
- def usage_record_summaries(params = {}, opts = {})
20
- request_stripe_object(
21
- method: :get,
22
- path: resource_url + "/usage_record_summaries",
23
- params: params,
24
- opts: opts
25
- )
26
- end
27
- extend Gem::Deprecate
28
- deprecate :usage_record_summaries, :"SubscriptionItem.list_usage_record_summaries", 2020, 1
29
18
  end
30
19
  end
@@ -38,6 +38,15 @@ module Stripe
38
38
  )
39
39
  end
40
40
 
41
+ def refund_payment(params = {}, opts = {})
42
+ request_stripe_object(
43
+ method: :post,
44
+ path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(self["id"]) }),
45
+ params: params,
46
+ opts: opts
47
+ )
48
+ end
49
+
41
50
  def set_reader_display(params = {}, opts = {})
42
51
  request_stripe_object(
43
52
  method: :post,
@@ -74,6 +83,15 @@ module Stripe
74
83
  )
75
84
  end
76
85
 
86
+ def self.refund_payment(reader, params = {}, opts = {})
87
+ request_stripe_object(
88
+ method: :post,
89
+ path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(reader) }),
90
+ params: params,
91
+ opts: opts
92
+ )
93
+ end
94
+
77
95
  def self.set_reader_display(reader, params = {}, opts = {})
78
96
  request_stripe_object(
79
97
  method: :post,
@@ -12,23 +12,5 @@ module Stripe
12
12
 
13
13
  nested_resource_class_methods :reversal,
14
14
  operations: %i[create retrieve update list]
15
-
16
- def cancel(params = {}, opts = {})
17
- request_stripe_object(
18
- method: :post,
19
- path: format("/v1/transfers/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
20
- params: params,
21
- opts: opts
22
- )
23
- end
24
-
25
- def self.cancel(id, params = {}, opts = {})
26
- request_stripe_object(
27
- method: :post,
28
- path: format("/v1/transfers/%<id>s/cancel", { id: CGI.escape(id) }),
29
- params: params,
30
- opts: opts
31
- )
32
- end
33
15
  end
34
16
  end
@@ -3,7 +3,6 @@
3
3
 
4
4
  require "stripe/resources/account"
5
5
  require "stripe/resources/account_link"
6
- require "stripe/resources/alipay_account"
7
6
  require "stripe/resources/apple_pay_domain"
8
7
  require "stripe/resources/application_fee"
9
8
  require "stripe/resources/application_fee_refund"
@@ -13,8 +12,6 @@ require "stripe/resources/balance_transaction"
13
12
  require "stripe/resources/bank_account"
14
13
  require "stripe/resources/billing_portal/configuration"
15
14
  require "stripe/resources/billing_portal/session"
16
- require "stripe/resources/bitcoin_receiver"
17
- require "stripe/resources/bitcoin_transaction"
18
15
  require "stripe/resources/capability"
19
16
  require "stripe/resources/card"
20
17
  require "stripe/resources/cash_balance"
@@ -45,7 +42,6 @@ require "stripe/resources/invoice_item"
45
42
  require "stripe/resources/invoice_line_item"
46
43
  require "stripe/resources/issuing/authorization"
47
44
  require "stripe/resources/issuing/card"
48
- require "stripe/resources/issuing/card_details"
49
45
  require "stripe/resources/issuing/cardholder"
50
46
  require "stripe/resources/issuing/dispute"
51
47
  require "stripe/resources/issuing/transaction"
@@ -67,8 +63,6 @@ require "stripe/resources/quote_phase"
67
63
  require "stripe/resources/radar/early_fraud_warning"
68
64
  require "stripe/resources/radar/value_list"
69
65
  require "stripe/resources/radar/value_list_item"
70
- require "stripe/resources/recipient"
71
- require "stripe/resources/recipient_transfer"
72
66
  require "stripe/resources/refund"
73
67
  require "stripe/resources/reporting/report_run"
74
68
  require "stripe/resources/reporting/report_type"
@@ -92,7 +86,6 @@ require "stripe/resources/terminal/connection_token"
92
86
  require "stripe/resources/terminal/location"
93
87
  require "stripe/resources/terminal/reader"
94
88
  require "stripe/resources/test_helpers/test_clock"
95
- require "stripe/resources/three_d_secure"
96
89
  require "stripe/resources/token"
97
90
  require "stripe/resources/topup"
98
91
  require "stripe/resources/transfer"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "6.6.0-beta.1"
4
+ VERSION = "7.1.0-beta.2"
5
5
  end
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: 6.6.0.pre.beta.1
4
+ version: 7.1.0.pre.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-22 00:00:00.000000000 Z
11
+ date: 2022-08-11 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.
@@ -63,8 +63,6 @@ files:
63
63
  - lib/stripe/resources/bank_account.rb
64
64
  - lib/stripe/resources/billing_portal/configuration.rb
65
65
  - lib/stripe/resources/billing_portal/session.rb
66
- - lib/stripe/resources/bitcoin_receiver.rb
67
- - lib/stripe/resources/bitcoin_transaction.rb
68
66
  - lib/stripe/resources/capability.rb
69
67
  - lib/stripe/resources/card.rb
70
68
  - lib/stripe/resources/cash_balance.rb
@@ -95,7 +93,6 @@ files:
95
93
  - lib/stripe/resources/invoice_line_item.rb
96
94
  - lib/stripe/resources/issuing/authorization.rb
97
95
  - lib/stripe/resources/issuing/card.rb
98
- - lib/stripe/resources/issuing/card_details.rb
99
96
  - lib/stripe/resources/issuing/cardholder.rb
100
97
  - lib/stripe/resources/issuing/dispute.rb
101
98
  - lib/stripe/resources/issuing/transaction.rb
@@ -117,7 +114,6 @@ files:
117
114
  - lib/stripe/resources/radar/early_fraud_warning.rb
118
115
  - lib/stripe/resources/radar/value_list.rb
119
116
  - lib/stripe/resources/radar/value_list_item.rb
120
- - lib/stripe/resources/recipient.rb
121
117
  - lib/stripe/resources/recipient_transfer.rb
122
118
  - lib/stripe/resources/refund.rb
123
119
  - lib/stripe/resources/reporting/report_run.rb
@@ -142,7 +138,6 @@ files:
142
138
  - lib/stripe/resources/terminal/location.rb
143
139
  - lib/stripe/resources/terminal/reader.rb
144
140
  - lib/stripe/resources/test_helpers/test_clock.rb
145
- - lib/stripe/resources/three_d_secure.rb
146
141
  - lib/stripe/resources/token.rb
147
142
  - lib/stripe/resources/topup.rb
148
143
  - lib/stripe/resources/transfer.rb
@@ -1,24 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # Directly creating or retrieving BitcoinReceivers is deprecated. Please use
6
- # the Sources API instead: https://stripe.com/docs/sources/bitcoin
7
- class BitcoinReceiver < APIResource
8
- extend Stripe::APIOperations::List
9
-
10
- OBJECT_NAME = "bitcoin_receiver"
11
-
12
- def self.resource_url
13
- "/v1/bitcoin/receivers"
14
- end
15
-
16
- def resource_url
17
- if respond_to?(:customer) && !customer.nil? && customer != ""
18
- "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
19
- else
20
- "#{self.class.resource_url}/#{CGI.escape(id)}"
21
- end
22
- end
23
- end
24
- end
@@ -1,16 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # Directly retrieving BitcoinTransactions is deprecated. Please use
6
- # the Sources API instead: https://stripe.com/docs/sources/bitcoin
7
- class BitcoinTransaction < APIResource
8
- extend Stripe::APIOperations::List
9
-
10
- OBJECT_NAME = "bitcoin_transaction"
11
-
12
- def self.resource_url
13
- "/v1/bitcoin/transactions"
14
- end
15
- end
16
- end
@@ -1,10 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Issuing
6
- class CardDetails < StripeObject
7
- OBJECT_NAME = "issuing.card_details"
8
- end
9
- end
10
- end
@@ -1,14 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # Recipients objects are deprecated. Please use Stripe Connect instead.
6
- class Recipient < APIResource
7
- extend Stripe::APIOperations::Create
8
- include Stripe::APIOperations::Delete
9
- extend Stripe::APIOperations::List
10
- include Stripe::APIOperations::Save
11
-
12
- OBJECT_NAME = "recipient"
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- class ThreeDSecure < APIResource
6
- extend Stripe::APIOperations::Create
7
-
8
- OBJECT_NAME = "three_d_secure"
9
-
10
- def self.resource_url
11
- "/v1/3d_secure"
12
- end
13
- end
14
- end