stripe 6.4.0 → 7.0.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 +4 -4
- data/CHANGELOG.md +33 -1
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/data/ca-certificates.crt +1241 -1937
- data/lib/stripe/api_version.rb +8 -0
- data/lib/stripe/object_types.rb +0 -7
- data/lib/stripe/resources/card.rb +1 -3
- data/lib/stripe/resources/checkout/session.rb +18 -3
- data/lib/stripe/resources/credit_note.rb +8 -8
- data/lib/stripe/resources/customer.rb +21 -38
- data/lib/stripe/resources/invoice.rb +14 -14
- data/lib/stripe/resources/issuing/card.rb +76 -14
- data/lib/stripe/resources/reporting/report_type.rb +0 -1
- data/lib/stripe/resources/subscription.rb +43 -1
- data/lib/stripe/resources/subscription_item.rb +0 -11
- data/lib/stripe/resources/transfer.rb +0 -18
- data/lib/stripe/resources.rb +0 -7
- data/lib/stripe/util.rb +9 -0
- data/lib/stripe/version.rb +1 -1
- metadata +3 -7
- data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
- data/lib/stripe/resources/bitcoin_transaction.rb +0 -16
- data/lib/stripe/resources/issuing/card_details.rb +0 -10
- data/lib/stripe/resources/recipient.rb +0 -14
- data/lib/stripe/resources/three_d_secure.rb +0 -14
data/lib/stripe/object_types.rb
CHANGED
@@ -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,
|
@@ -79,8 +75,6 @@ module Stripe
|
|
79
75
|
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
|
80
76
|
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
|
81
77
|
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
|
82
|
-
Recipient::OBJECT_NAME => Recipient,
|
83
|
-
RecipientTransfer::OBJECT_NAME => RecipientTransfer,
|
84
78
|
Refund::OBJECT_NAME => Refund,
|
85
79
|
Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
|
86
80
|
Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
|
@@ -104,7 +98,6 @@ module Stripe
|
|
104
98
|
Terminal::Location::OBJECT_NAME => Terminal::Location,
|
105
99
|
Terminal::Reader::OBJECT_NAME => Terminal::Reader,
|
106
100
|
TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
|
107
|
-
ThreeDSecure::OBJECT_NAME => ThreeDSecure,
|
108
101
|
Token::OBJECT_NAME => Token,
|
109
102
|
Topup::OBJECT_NAME => Topup,
|
110
103
|
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?(:
|
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
|
@@ -18,28 +18,28 @@ module Stripe
|
|
18
18
|
)
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.
|
21
|
+
def self.list_preview_line_items(params = {}, opts = {})
|
22
22
|
request_stripe_object(
|
23
|
-
method: :
|
24
|
-
path:
|
23
|
+
method: :get,
|
24
|
+
path: "/v1/credit_notes/preview/lines",
|
25
25
|
params: params,
|
26
26
|
opts: opts
|
27
27
|
)
|
28
28
|
end
|
29
29
|
|
30
|
-
def self.preview(params, opts = {})
|
30
|
+
def self.preview(params = {}, opts = {})
|
31
31
|
request_stripe_object(
|
32
32
|
method: :get,
|
33
|
-
path:
|
33
|
+
path: "/v1/credit_notes/preview",
|
34
34
|
params: params,
|
35
35
|
opts: opts
|
36
36
|
)
|
37
37
|
end
|
38
38
|
|
39
|
-
def self.
|
39
|
+
def self.void_credit_note(id, params = {}, opts = {})
|
40
40
|
request_stripe_object(
|
41
|
-
method: :
|
42
|
-
path:
|
41
|
+
method: :post,
|
42
|
+
path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
|
43
43
|
params: params,
|
44
44
|
opts: opts
|
45
45
|
)
|
@@ -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,
|
@@ -76,8 +94,6 @@ module Stripe
|
|
76
94
|
)
|
77
95
|
end
|
78
96
|
|
79
|
-
custom_method :delete_discount, http_verb: :delete, http_path: "discount"
|
80
|
-
|
81
97
|
save_nested_resource :source
|
82
98
|
nested_resource_class_methods :source,
|
83
99
|
operations: %i[create retrieve update delete list]
|
@@ -88,19 +104,6 @@ module Stripe
|
|
88
104
|
alias detach_source delete_source
|
89
105
|
end
|
90
106
|
|
91
|
-
# Deletes a discount associated with the customer.
|
92
|
-
#
|
93
|
-
# Returns the deleted discount. The customer object is not updated,
|
94
|
-
# so you must call `refresh` on it to get a new version with the
|
95
|
-
# discount removed.
|
96
|
-
def delete_discount
|
97
|
-
request_stripe_object(
|
98
|
-
method: :delete,
|
99
|
-
path: resource_url + "/discount",
|
100
|
-
params: {}
|
101
|
-
)
|
102
|
-
end
|
103
|
-
|
104
107
|
def self.search(params = {}, opts = {})
|
105
108
|
_search("/v1/customers/search", params, opts)
|
106
109
|
end
|
@@ -109,36 +112,16 @@ module Stripe
|
|
109
112
|
search(params, opts).auto_paging_each(&blk)
|
110
113
|
end
|
111
114
|
|
112
|
-
def self.retrieve_cash_balance(
|
113
|
-
customer,
|
114
|
-
opts_or_unused_nested_id = nil,
|
115
|
-
opts = {}
|
116
|
-
)
|
117
|
-
# Support two call patterns for backwards compatibility.
|
118
|
-
# 1. Legacy: (nil unused nested_id, opts)
|
119
|
-
# 2. Fixed pattern: (opts)
|
120
|
-
if !opts_or_unused_nested_id.nil? && opts_or_unused_nested_id.class == Hash && opts.empty?
|
121
|
-
opts = opts_or_unused_nested_id
|
122
|
-
end
|
115
|
+
def self.retrieve_cash_balance(customer, params = {}, opts = {})
|
123
116
|
request_stripe_object(
|
124
117
|
method: :get,
|
125
118
|
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
126
|
-
params:
|
119
|
+
params: params,
|
127
120
|
opts: opts
|
128
121
|
)
|
129
122
|
end
|
130
123
|
|
131
|
-
def self.update_cash_balance(
|
132
|
-
customer,
|
133
|
-
unused_nested_id = nil,
|
134
|
-
params = {},
|
135
|
-
opts = {}
|
136
|
-
)
|
137
|
-
# 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).
|
138
|
-
if !unused_nested_id.nil? && unused_nested_id.class == Hash
|
139
|
-
raise ArgumentError, "update_cash_balance requires the second argument always be nil for legacy reasons."
|
140
|
-
end
|
141
|
-
|
124
|
+
def self.update_cash_balance(customer, params = {}, opts = {})
|
142
125
|
request_stripe_object(
|
143
126
|
method: :post,
|
144
127
|
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
@@ -65,55 +65,55 @@ module Stripe
|
|
65
65
|
)
|
66
66
|
end
|
67
67
|
|
68
|
-
def self.
|
68
|
+
def self.list_upcoming_line_items(params = {}, opts = {})
|
69
69
|
request_stripe_object(
|
70
|
-
method: :
|
71
|
-
path:
|
70
|
+
method: :get,
|
71
|
+
path: "/v1/invoices/upcoming/lines",
|
72
72
|
params: params,
|
73
73
|
opts: opts
|
74
74
|
)
|
75
75
|
end
|
76
76
|
|
77
|
-
def self.
|
77
|
+
def self.mark_uncollectible(invoice, params = {}, opts = {})
|
78
78
|
request_stripe_object(
|
79
79
|
method: :post,
|
80
|
-
path: format("/v1/invoices/%<invoice>s/
|
80
|
+
path: format("/v1/invoices/%<invoice>s/mark_uncollectible", { invoice: CGI.escape(invoice) }),
|
81
81
|
params: params,
|
82
82
|
opts: opts
|
83
83
|
)
|
84
84
|
end
|
85
85
|
|
86
|
-
def self.
|
86
|
+
def self.pay(invoice, params = {}, opts = {})
|
87
87
|
request_stripe_object(
|
88
88
|
method: :post,
|
89
|
-
path: format("/v1/invoices/%<invoice>s/
|
89
|
+
path: format("/v1/invoices/%<invoice>s/pay", { invoice: CGI.escape(invoice) }),
|
90
90
|
params: params,
|
91
91
|
opts: opts
|
92
92
|
)
|
93
93
|
end
|
94
94
|
|
95
|
-
def self.
|
95
|
+
def self.send_invoice(invoice, params = {}, opts = {})
|
96
96
|
request_stripe_object(
|
97
97
|
method: :post,
|
98
|
-
path: format("/v1/invoices/%<invoice>s/
|
98
|
+
path: format("/v1/invoices/%<invoice>s/send", { invoice: CGI.escape(invoice) }),
|
99
99
|
params: params,
|
100
100
|
opts: opts
|
101
101
|
)
|
102
102
|
end
|
103
103
|
|
104
|
-
def self.upcoming(params, opts = {})
|
104
|
+
def self.upcoming(params = {}, opts = {})
|
105
105
|
request_stripe_object(
|
106
106
|
method: :get,
|
107
|
-
path:
|
107
|
+
path: "/v1/invoices/upcoming",
|
108
108
|
params: params,
|
109
109
|
opts: opts
|
110
110
|
)
|
111
111
|
end
|
112
112
|
|
113
|
-
def self.
|
113
|
+
def self.void_invoice(invoice, params = {}, opts = {})
|
114
114
|
request_stripe_object(
|
115
|
-
method: :
|
116
|
-
path:
|
115
|
+
method: :post,
|
116
|
+
path: format("/v1/invoices/%<invoice>s/void", { invoice: CGI.escape(invoice) }),
|
117
117
|
params: params,
|
118
118
|
opts: opts
|
119
119
|
)
|
@@ -10,22 +10,84 @@ module Stripe
|
|
10
10
|
|
11
11
|
OBJECT_NAME = "issuing.card"
|
12
12
|
|
13
|
-
def
|
14
|
-
|
15
|
-
method: :get,
|
16
|
-
path: format("/v1/issuing/cards/%<card>s/details", { card: CGI.escape(self["id"]) }),
|
17
|
-
params: params,
|
18
|
-
opts: opts
|
19
|
-
)
|
13
|
+
def test_helpers
|
14
|
+
TestHelpers.new(self)
|
20
15
|
end
|
21
16
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
17
|
+
class TestHelpers < APIResourceTestHelpers
|
18
|
+
RESOURCE_CLASS = Card
|
19
|
+
|
20
|
+
def self.deliver_card(card, params = {}, opts = {})
|
21
|
+
request_stripe_object(
|
22
|
+
method: :post,
|
23
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/deliver", { card: CGI.escape(card) }),
|
24
|
+
params: params,
|
25
|
+
opts: opts
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.fail_card(card, params = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :post,
|
32
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/fail", { card: CGI.escape(card) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.return_card(card, params = {}, opts = {})
|
39
|
+
request_stripe_object(
|
40
|
+
method: :post,
|
41
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/return", { card: CGI.escape(card) }),
|
42
|
+
params: params,
|
43
|
+
opts: opts
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.ship_card(card, params = {}, opts = {})
|
48
|
+
request_stripe_object(
|
49
|
+
method: :post,
|
50
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/ship", { card: CGI.escape(card) }),
|
51
|
+
params: params,
|
52
|
+
opts: opts
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
def deliver_card(params = {}, opts = {})
|
57
|
+
@resource.request_stripe_object(
|
58
|
+
method: :post,
|
59
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/deliver", { card: CGI.escape(@resource["id"]) }),
|
60
|
+
params: params,
|
61
|
+
opts: opts
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
def fail_card(params = {}, opts = {})
|
66
|
+
@resource.request_stripe_object(
|
67
|
+
method: :post,
|
68
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/fail", { card: CGI.escape(@resource["id"]) }),
|
69
|
+
params: params,
|
70
|
+
opts: opts
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
def return_card(params = {}, opts = {})
|
75
|
+
@resource.request_stripe_object(
|
76
|
+
method: :post,
|
77
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/return", { card: CGI.escape(@resource["id"]) }),
|
78
|
+
params: params,
|
79
|
+
opts: opts
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def ship_card(params = {}, opts = {})
|
84
|
+
@resource.request_stripe_object(
|
85
|
+
method: :post,
|
86
|
+
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/ship", { card: CGI.escape(@resource["id"]) }),
|
87
|
+
params: params,
|
88
|
+
opts: opts
|
89
|
+
)
|
90
|
+
end
|
29
91
|
end
|
30
92
|
end
|
31
93
|
end
|
@@ -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
|
@@ -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
|
data/lib/stripe/resources.rb
CHANGED
@@ -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"
|
@@ -66,8 +62,6 @@ require "stripe/resources/quote"
|
|
66
62
|
require "stripe/resources/radar/early_fraud_warning"
|
67
63
|
require "stripe/resources/radar/value_list"
|
68
64
|
require "stripe/resources/radar/value_list_item"
|
69
|
-
require "stripe/resources/recipient"
|
70
|
-
require "stripe/resources/recipient_transfer"
|
71
65
|
require "stripe/resources/refund"
|
72
66
|
require "stripe/resources/reporting/report_run"
|
73
67
|
require "stripe/resources/reporting/report_type"
|
@@ -91,7 +85,6 @@ require "stripe/resources/terminal/connection_token"
|
|
91
85
|
require "stripe/resources/terminal/location"
|
92
86
|
require "stripe/resources/terminal/reader"
|
93
87
|
require "stripe/resources/test_helpers/test_clock"
|
94
|
-
require "stripe/resources/three_d_secure"
|
95
88
|
require "stripe/resources/token"
|
96
89
|
require "stripe/resources/topup"
|
97
90
|
require "stripe/resources/transfer"
|
data/lib/stripe/util.rb
CHANGED
@@ -416,6 +416,15 @@ module Stripe
|
|
416
416
|
# Hopefully val is a string, but protect in case it's not.
|
417
417
|
val = val.to_s
|
418
418
|
|
419
|
+
# Some values returned by the server are encoded in ASCII-8BIT before
|
420
|
+
# being parsed as UTF-8 by Marshal. If we don't transform these here, then
|
421
|
+
# puts will fail as it tries to render UTF-8 characters as ASCII-8BIT
|
422
|
+
# which is not valid.
|
423
|
+
if val && val.encoding == Encoding::ASCII_8BIT
|
424
|
+
# Dup the string as it is a frozen literal.
|
425
|
+
val = val.dup.force_encoding("UTF-8")
|
426
|
+
end
|
427
|
+
|
419
428
|
if %r{[^\w\-/]} =~ val
|
420
429
|
# If the string contains any special characters, escape any double
|
421
430
|
# quotes it has, remove newlines, and wrap the whole thing in quotes.
|
data/lib/stripe/version.rb
CHANGED
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
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-02 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.
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- lib/stripe/api_operations/search.rb
|
42
42
|
- lib/stripe/api_resource.rb
|
43
43
|
- lib/stripe/api_resource_test_helpers.rb
|
44
|
+
- lib/stripe/api_version.rb
|
44
45
|
- lib/stripe/connection_manager.rb
|
45
46
|
- lib/stripe/error_object.rb
|
46
47
|
- lib/stripe/errors.rb
|
@@ -62,8 +63,6 @@ files:
|
|
62
63
|
- lib/stripe/resources/bank_account.rb
|
63
64
|
- lib/stripe/resources/billing_portal/configuration.rb
|
64
65
|
- lib/stripe/resources/billing_portal/session.rb
|
65
|
-
- lib/stripe/resources/bitcoin_receiver.rb
|
66
|
-
- lib/stripe/resources/bitcoin_transaction.rb
|
67
66
|
- lib/stripe/resources/capability.rb
|
68
67
|
- lib/stripe/resources/card.rb
|
69
68
|
- lib/stripe/resources/cash_balance.rb
|
@@ -94,7 +93,6 @@ files:
|
|
94
93
|
- lib/stripe/resources/invoice_line_item.rb
|
95
94
|
- lib/stripe/resources/issuing/authorization.rb
|
96
95
|
- lib/stripe/resources/issuing/card.rb
|
97
|
-
- lib/stripe/resources/issuing/card_details.rb
|
98
96
|
- lib/stripe/resources/issuing/cardholder.rb
|
99
97
|
- lib/stripe/resources/issuing/dispute.rb
|
100
98
|
- lib/stripe/resources/issuing/transaction.rb
|
@@ -115,7 +113,6 @@ files:
|
|
115
113
|
- lib/stripe/resources/radar/early_fraud_warning.rb
|
116
114
|
- lib/stripe/resources/radar/value_list.rb
|
117
115
|
- lib/stripe/resources/radar/value_list_item.rb
|
118
|
-
- lib/stripe/resources/recipient.rb
|
119
116
|
- lib/stripe/resources/recipient_transfer.rb
|
120
117
|
- lib/stripe/resources/refund.rb
|
121
118
|
- lib/stripe/resources/reporting/report_run.rb
|
@@ -140,7 +137,6 @@ files:
|
|
140
137
|
- lib/stripe/resources/terminal/location.rb
|
141
138
|
- lib/stripe/resources/terminal/reader.rb
|
142
139
|
- lib/stripe/resources/test_helpers/test_clock.rb
|
143
|
-
- lib/stripe/resources/three_d_secure.rb
|
144
140
|
- lib/stripe/resources/token.rb
|
145
141
|
- lib/stripe/resources/topup.rb
|
146
142
|
- lib/stripe/resources/transfer.rb
|