stripe 3.8.2 → 5.45.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +424 -1
  3. data/CODE_OF_CONDUCT.md +77 -0
  4. data/Gemfile +15 -20
  5. data/README.md +201 -58
  6. data/Rakefile +12 -9
  7. data/VERSION +1 -1
  8. data/bin/stripe-console +3 -1
  9. data/lib/stripe/api_operations/create.rb +3 -1
  10. data/lib/stripe/api_operations/delete.rb +30 -2
  11. data/lib/stripe/api_operations/list.rb +3 -12
  12. data/lib/stripe/api_operations/nested_resource.rb +40 -28
  13. data/lib/stripe/api_operations/request.rb +83 -9
  14. data/lib/stripe/api_operations/save.rb +19 -7
  15. data/lib/stripe/api_resource.rb +65 -4
  16. data/lib/stripe/connection_manager.rb +200 -0
  17. data/lib/stripe/error_object.rb +93 -0
  18. data/lib/stripe/errors.rb +47 -19
  19. data/lib/stripe/instrumentation.rb +84 -0
  20. data/lib/stripe/list_object.rb +43 -7
  21. data/lib/stripe/multipart_encoder.rb +131 -0
  22. data/lib/stripe/oauth.rb +14 -7
  23. data/lib/stripe/object_types.rb +110 -0
  24. data/lib/stripe/{account.rb → resources/account.rb} +60 -28
  25. data/lib/stripe/resources/account_link.rb +10 -0
  26. data/lib/stripe/resources/alipay_account.rb +34 -0
  27. data/lib/stripe/{apple_pay_domain.rb → resources/apple_pay_domain.rb} +4 -1
  28. data/lib/stripe/resources/application_fee.rb +14 -0
  29. data/lib/stripe/resources/application_fee_refund.rb +31 -0
  30. data/lib/stripe/resources/balance.rb +8 -0
  31. data/lib/stripe/resources/balance_transaction.rb +10 -0
  32. data/lib/stripe/resources/bank_account.rb +43 -0
  33. data/lib/stripe/resources/billing_portal/configuration.rb +14 -0
  34. data/lib/stripe/resources/billing_portal/session.rb +12 -0
  35. data/lib/stripe/{bitcoin_receiver.rb → resources/bitcoin_receiver.rb} +6 -6
  36. data/lib/stripe/resources/bitcoin_transaction.rb +16 -0
  37. data/lib/stripe/resources/capability.rb +34 -0
  38. data/lib/stripe/{card.rb → resources/card.rb} +15 -4
  39. data/lib/stripe/resources/charge.rb +23 -0
  40. data/lib/stripe/resources/checkout/session.rb +27 -0
  41. data/lib/stripe/resources/country_spec.rb +10 -0
  42. data/lib/stripe/{coupon.rb → resources/coupon.rb} +5 -2
  43. data/lib/stripe/resources/credit_note.rb +33 -0
  44. data/lib/stripe/resources/credit_note_line_item.rb +8 -0
  45. data/lib/stripe/resources/customer.rb +52 -0
  46. data/lib/stripe/resources/customer_balance_transaction.rb +31 -0
  47. data/lib/stripe/resources/discount.rb +8 -0
  48. data/lib/stripe/resources/dispute.rb +22 -0
  49. data/lib/stripe/resources/ephemeral_key.rb +20 -0
  50. data/lib/stripe/resources/event.rb +10 -0
  51. data/lib/stripe/resources/exchange_rate.rb +10 -0
  52. data/lib/stripe/resources/file.rb +36 -0
  53. data/lib/stripe/resources/file_link.rb +12 -0
  54. data/lib/stripe/resources/identity/verification_report.rb +12 -0
  55. data/lib/stripe/resources/identity/verification_session.rb +35 -0
  56. data/lib/stripe/resources/invoice.rb +74 -0
  57. data/lib/stripe/{invoice_item.rb → resources/invoice_item.rb} +5 -2
  58. data/lib/stripe/resources/invoice_line_item.rb +8 -0
  59. data/lib/stripe/resources/issuing/authorization.rb +34 -0
  60. data/lib/stripe/resources/issuing/card.rb +25 -0
  61. data/lib/stripe/resources/issuing/card_details.rb +10 -0
  62. data/lib/stripe/resources/issuing/cardholder.rb +14 -0
  63. data/lib/stripe/resources/issuing/dispute.rb +25 -0
  64. data/lib/stripe/resources/issuing/transaction.rb +13 -0
  65. data/lib/stripe/resources/line_item.rb +8 -0
  66. data/lib/stripe/resources/login_link.rb +15 -0
  67. data/lib/stripe/resources/mandate.rb +8 -0
  68. data/lib/stripe/resources/order.rb +33 -0
  69. data/lib/stripe/resources/order_return.rb +10 -0
  70. data/lib/stripe/resources/payment_intent.rb +53 -0
  71. data/lib/stripe/resources/payment_link.rb +23 -0
  72. data/lib/stripe/resources/payment_method.rb +33 -0
  73. data/lib/stripe/resources/payout.rb +33 -0
  74. data/lib/stripe/resources/person.rb +32 -0
  75. data/lib/stripe/{plan.rb → resources/plan.rb} +4 -1
  76. data/lib/stripe/resources/price.rb +12 -0
  77. data/lib/stripe/{product.rb → resources/product.rb} +6 -3
  78. data/lib/stripe/resources/promotion_code.rb +12 -0
  79. data/lib/stripe/resources/quote.rb +105 -0
  80. data/lib/stripe/resources/radar/early_fraud_warning.rb +12 -0
  81. data/lib/stripe/resources/radar/value_list.rb +15 -0
  82. data/lib/stripe/resources/radar/value_list_item.rb +14 -0
  83. data/lib/stripe/{recipient.rb → resources/recipient.rb} +5 -6
  84. data/lib/stripe/resources/recipient_transfer.rb +7 -0
  85. data/lib/stripe/{refund.rb → resources/refund.rb} +4 -1
  86. data/lib/stripe/resources/reporting/report_run.rb +13 -0
  87. data/lib/stripe/resources/reporting/report_type.rb +13 -0
  88. data/lib/stripe/resources/reversal.rb +30 -0
  89. data/lib/stripe/resources/review.rb +21 -0
  90. data/lib/stripe/resources/setup_attempt.rb +10 -0
  91. data/lib/stripe/resources/setup_intent.rb +43 -0
  92. data/lib/stripe/resources/shipping_rate.rb +12 -0
  93. data/lib/stripe/resources/sigma/scheduled_query_run.rb +16 -0
  94. data/lib/stripe/{sku.rb → resources/sku.rb} +6 -3
  95. data/lib/stripe/resources/source.rb +47 -0
  96. data/lib/stripe/resources/source_transaction.rb +8 -0
  97. data/lib/stripe/resources/subscription.rb +26 -0
  98. data/lib/stripe/resources/subscription_item.rb +26 -0
  99. data/lib/stripe/resources/subscription_schedule.rb +33 -0
  100. data/lib/stripe/resources/tax_code.rb +10 -0
  101. data/lib/stripe/resources/tax_id.rb +27 -0
  102. data/lib/stripe/resources/tax_rate.rb +12 -0
  103. data/lib/stripe/resources/terminal/connection_token.rb +12 -0
  104. data/lib/stripe/resources/terminal/location.rb +15 -0
  105. data/lib/stripe/resources/terminal/reader.rb +15 -0
  106. data/lib/stripe/resources/test_helpers/test_clock.rb +25 -0
  107. data/lib/stripe/{three_d_secure.rb → resources/three_d_secure.rb} +4 -1
  108. data/lib/stripe/resources/token.rb +10 -0
  109. data/lib/stripe/resources/topup.rb +23 -0
  110. data/lib/stripe/resources/transfer.rb +27 -0
  111. data/lib/stripe/resources/usage_record.rb +8 -0
  112. data/lib/stripe/resources/usage_record_summary.rb +8 -0
  113. data/lib/stripe/resources/webhook_endpoint.rb +13 -0
  114. data/lib/stripe/resources.rb +93 -0
  115. data/lib/stripe/singleton_api_resource.rb +8 -2
  116. data/lib/stripe/stripe_client.rb +712 -233
  117. data/lib/stripe/stripe_configuration.rb +194 -0
  118. data/lib/stripe/stripe_object.rb +180 -67
  119. data/lib/stripe/stripe_response.rb +89 -27
  120. data/lib/stripe/util.rb +87 -168
  121. data/lib/stripe/version.rb +3 -1
  122. data/lib/stripe/webhook.rb +45 -10
  123. data/lib/stripe.rb +47 -160
  124. data/stripe.gemspec +27 -8
  125. metadata +112 -178
  126. data/.gitattributes +0 -4
  127. data/.github/ISSUE_TEMPLATE.md +0 -5
  128. data/.gitignore +0 -6
  129. data/.rubocop.yml +0 -20
  130. data/.rubocop_todo.yml +0 -60
  131. data/.travis.yml +0 -38
  132. data/lib/stripe/alipay_account.rb +0 -25
  133. data/lib/stripe/application_fee.rb +0 -25
  134. data/lib/stripe/application_fee_refund.rb +0 -20
  135. data/lib/stripe/balance.rb +0 -5
  136. data/lib/stripe/balance_transaction.rb +0 -11
  137. data/lib/stripe/bank_account.rb +0 -30
  138. data/lib/stripe/bitcoin_transaction.rb +0 -13
  139. data/lib/stripe/charge.rb +0 -82
  140. data/lib/stripe/country_spec.rb +0 -11
  141. data/lib/stripe/customer.rb +0 -88
  142. data/lib/stripe/dispute.rb +0 -17
  143. data/lib/stripe/ephemeral_key.rb +0 -18
  144. data/lib/stripe/event.rb +0 -7
  145. data/lib/stripe/exchange_rate.rb +0 -11
  146. data/lib/stripe/file_upload.rb +0 -35
  147. data/lib/stripe/invoice.rb +0 -30
  148. data/lib/stripe/invoice_line_item.rb +0 -5
  149. data/lib/stripe/login_link.rb +0 -9
  150. data/lib/stripe/order.rb +0 -35
  151. data/lib/stripe/order_return.rb +0 -11
  152. data/lib/stripe/payout.rb +0 -18
  153. data/lib/stripe/recipient_transfer.rb +0 -5
  154. data/lib/stripe/reversal.rb +0 -20
  155. data/lib/stripe/source.rb +0 -36
  156. data/lib/stripe/source_transaction.rb +0 -5
  157. data/lib/stripe/subscription.rb +0 -43
  158. data/lib/stripe/subscription_item.rb +0 -14
  159. data/lib/stripe/token.rb +0 -7
  160. data/lib/stripe/transfer.rb +0 -21
  161. data/test/api_stub_helpers.rb +0 -0
  162. data/test/stripe/account_external_accounts_operations_test.rb +0 -66
  163. data/test/stripe/account_login_links_operations_test.rb +0 -19
  164. data/test/stripe/account_test.rb +0 -190
  165. data/test/stripe/alipay_account_test.rb +0 -35
  166. data/test/stripe/api_operations_test.rb +0 -76
  167. data/test/stripe/api_resource_test.rb +0 -522
  168. data/test/stripe/apple_pay_domain_test.rb +0 -31
  169. data/test/stripe/application_fee_refund_test.rb +0 -35
  170. data/test/stripe/application_fee_refunds_operations_test.rb +0 -54
  171. data/test/stripe/application_fee_test.rb +0 -12
  172. data/test/stripe/balance_test.rb +0 -11
  173. data/test/stripe/bank_account_test.rb +0 -34
  174. data/test/stripe/charge_test.rb +0 -57
  175. data/test/stripe/country_spec_test.rb +0 -18
  176. data/test/stripe/coupon_test.rb +0 -42
  177. data/test/stripe/customer_card_test.rb +0 -42
  178. data/test/stripe/customer_sources_operations_test.rb +0 -66
  179. data/test/stripe/customer_test.rb +0 -113
  180. data/test/stripe/dispute_test.rb +0 -40
  181. data/test/stripe/ephemeral_key_test.rb +0 -84
  182. data/test/stripe/errors_test.rb +0 -18
  183. data/test/stripe/exchange_rate_test.rb +0 -18
  184. data/test/stripe/file_upload_test.rb +0 -83
  185. data/test/stripe/invoice_item_test.rb +0 -53
  186. data/test/stripe/invoice_line_item_test.rb +0 -6
  187. data/test/stripe/invoice_test.rb +0 -111
  188. data/test/stripe/list_object_test.rb +0 -154
  189. data/test/stripe/login_link_test.rb +0 -35
  190. data/test/stripe/oauth_test.rb +0 -77
  191. data/test/stripe/order_return_test.rb +0 -19
  192. data/test/stripe/order_test.rb +0 -57
  193. data/test/stripe/payout_test.rb +0 -48
  194. data/test/stripe/plan_test.rb +0 -50
  195. data/test/stripe/product_test.rb +0 -45
  196. data/test/stripe/recipient_test.rb +0 -47
  197. data/test/stripe/refund_test.rb +0 -37
  198. data/test/stripe/reversal_test.rb +0 -41
  199. data/test/stripe/sku_test.rb +0 -48
  200. data/test/stripe/source_test.rb +0 -84
  201. data/test/stripe/source_transaction_test.rb +0 -28
  202. data/test/stripe/stripe_client_test.rb +0 -728
  203. data/test/stripe/stripe_object_test.rb +0 -448
  204. data/test/stripe/stripe_response_test.rb +0 -47
  205. data/test/stripe/subscription_item_test.rb +0 -52
  206. data/test/stripe/subscription_test.rb +0 -104
  207. data/test/stripe/three_d_secure_test.rb +0 -21
  208. data/test/stripe/transfer_reversals_operations_test.rb +0 -55
  209. data/test/stripe/transfer_test.rb +0 -41
  210. data/test/stripe/util_test.rb +0 -432
  211. data/test/stripe/webhook_test.rb +0 -94
  212. data/test/stripe_test.rb +0 -59
  213. data/test/test_data.rb +0 -59
  214. data/test/test_helper.rb +0 -60
data/lib/stripe.rb CHANGED
@@ -1,15 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Stripe Ruby bindings
2
4
  # API spec at https://stripe.com/docs/api
3
5
  require "cgi"
4
- require "faraday"
5
6
  require "json"
6
7
  require "logger"
8
+ require "net/http"
7
9
  require "openssl"
8
10
  require "rbconfig"
9
11
  require "securerandom"
10
12
  require "set"
11
13
  require "socket"
12
14
  require "uri"
15
+ require "forwardable"
13
16
 
14
17
  # Version
15
18
  require "stripe/version"
@@ -24,89 +27,66 @@ require "stripe/api_operations/save"
24
27
 
25
28
  # API resource support classes
26
29
  require "stripe/errors"
30
+ require "stripe/object_types"
27
31
  require "stripe/util"
32
+ require "stripe/connection_manager"
33
+ require "stripe/multipart_encoder"
28
34
  require "stripe/stripe_client"
29
35
  require "stripe/stripe_object"
30
36
  require "stripe/stripe_response"
31
37
  require "stripe/list_object"
38
+ require "stripe/error_object"
32
39
  require "stripe/api_resource"
33
40
  require "stripe/singleton_api_resource"
34
41
  require "stripe/webhook"
42
+ require "stripe/stripe_configuration"
35
43
 
36
44
  # Named API resources
37
- require "stripe/account"
38
- require "stripe/alipay_account"
39
- require "stripe/apple_pay_domain"
40
- require "stripe/application_fee"
41
- require "stripe/application_fee_refund"
42
- require "stripe/balance"
43
- require "stripe/balance_transaction"
44
- require "stripe/bank_account"
45
- require "stripe/bitcoin_receiver"
46
- require "stripe/bitcoin_transaction"
47
- require "stripe/card"
48
- require "stripe/charge"
49
- require "stripe/country_spec"
50
- require "stripe/coupon"
51
- require "stripe/customer"
52
- require "stripe/dispute"
53
- require "stripe/ephemeral_key"
54
- require "stripe/event"
55
- require "stripe/exchange_rate"
56
- require "stripe/file_upload"
57
- require "stripe/invoice"
58
- require "stripe/invoice_item"
59
- require "stripe/invoice_line_item"
60
- require "stripe/login_link"
61
- require "stripe/order"
62
- require "stripe/order_return"
63
- require "stripe/payout"
64
- require "stripe/plan"
65
- require "stripe/product"
66
- require "stripe/recipient"
67
- require "stripe/recipient_transfer"
68
- require "stripe/refund"
69
- require "stripe/reversal"
70
- require "stripe/sku"
71
- require "stripe/source"
72
- require "stripe/source_transaction"
73
- require "stripe/subscription"
74
- require "stripe/subscription_item"
75
- require "stripe/three_d_secure"
76
- require "stripe/token"
77
- require "stripe/transfer"
45
+ require "stripe/resources"
78
46
 
79
47
  # OAuth
80
48
  require "stripe/oauth"
81
49
 
82
50
  module Stripe
83
- DEFAULT_CA_BUNDLE_PATH = File.dirname(__FILE__) + "/data/ca-certificates.crt"
84
-
85
- @app_info = nil
51
+ DEFAULT_CA_BUNDLE_PATH = __dir__ + "/data/ca-certificates.crt"
86
52
 
87
- @api_base = "https://api.stripe.com"
88
- @connect_base = "https://connect.stripe.com"
89
- @uploads_base = "https://uploads.stripe.com"
90
-
91
- @log_level = nil
92
- @logger = nil
93
-
94
- @max_network_retries = 0
95
- @max_network_retry_delay = 2
96
- @initial_network_retry_delay = 0.5
53
+ # map to the same values as the standard library's logger
54
+ LEVEL_DEBUG = Logger::DEBUG
55
+ LEVEL_ERROR = Logger::ERROR
56
+ LEVEL_INFO = Logger::INFO
97
57
 
98
- @ca_bundle_path = DEFAULT_CA_BUNDLE_PATH
99
- @ca_store = nil
100
- @verify_ssl_certs = true
58
+ @app_info = nil
101
59
 
102
- @open_timeout = 30
103
- @read_timeout = 80
60
+ @config = Stripe::StripeConfiguration.setup
104
61
 
105
62
  class << self
106
- attr_accessor :stripe_account, :api_key, :api_base, :verify_ssl_certs, :api_version, :client_id, :connect_base, :uploads_base,
107
- :open_timeout, :read_timeout
108
-
109
- attr_reader :max_network_retry_delay, :initial_network_retry_delay
63
+ extend Forwardable
64
+
65
+ attr_reader :config
66
+
67
+ # User configurable options
68
+ def_delegators :@config, :api_key, :api_key=
69
+ def_delegators :@config, :api_version, :api_version=
70
+ def_delegators :@config, :stripe_account, :stripe_account=
71
+ def_delegators :@config, :api_base, :api_base=
72
+ def_delegators :@config, :uploads_base, :uploads_base=
73
+ def_delegators :@config, :connect_base, :connect_base=
74
+ def_delegators :@config, :open_timeout, :open_timeout=
75
+ def_delegators :@config, :read_timeout, :read_timeout=
76
+ def_delegators :@config, :write_timeout, :write_timeout=
77
+ def_delegators :@config, :proxy, :proxy=
78
+ def_delegators :@config, :verify_ssl_certs, :verify_ssl_certs=
79
+ def_delegators :@config, :ca_bundle_path, :ca_bundle_path=
80
+ def_delegators :@config, :log_level, :log_level=
81
+ def_delegators :@config, :logger, :logger=
82
+ def_delegators :@config, :max_network_retries, :max_network_retries=
83
+ def_delegators :@config, :enable_telemetry=, :enable_telemetry?
84
+ def_delegators :@config, :client_id=, :client_id
85
+
86
+ # Internal configurations
87
+ def_delegators :@config, :max_network_retry_delay
88
+ def_delegators :@config, :initial_network_retry_delay
89
+ def_delegators :@config, :ca_store
110
90
  end
111
91
 
112
92
  # Gets the application for a plugin that's identified some. See
@@ -119,112 +99,19 @@ module Stripe
119
99
  @app_info = info
120
100
  end
121
101
 
122
- # The location of a file containing a bundle of CA certificates. By default
123
- # the library will use an included bundle that can successfully validate
124
- # Stripe certificates.
125
- def self.ca_bundle_path
126
- @ca_bundle_path
127
- end
128
-
129
- def self.ca_bundle_path=(path)
130
- @ca_bundle_path = path
131
-
132
- # empty this field so a new store is initialized
133
- @ca_store = nil
134
- end
135
-
136
- # A certificate store initialized from the the bundle in #ca_bundle_path and
137
- # which is used to validate TLS on every request.
138
- #
139
- # This was added to the give the gem "pseudo thread safety" in that it seems
140
- # when initiating many parallel requests marshaling the certificate store is
141
- # the most likely point of failure (see issue #382). Any program attempting
142
- # to leverage this pseudo safety should make a call to this method (i.e.
143
- # `Stripe.ca_store`) in their initialization code because it marshals lazily
144
- # and is itself not thread safe.
145
- def self.ca_store
146
- @ca_store ||= begin
147
- store = OpenSSL::X509::Store.new
148
- store.add_file(ca_bundle_path)
149
- store
150
- end
151
- end
152
-
153
- # map to the same values as the standard library's logger
154
- LEVEL_DEBUG = Logger::DEBUG
155
- LEVEL_ERROR = Logger::ERROR
156
- LEVEL_INFO = Logger::INFO
157
-
158
- # When set prompts the library to log some extra information to $stdout and
159
- # $stderr about what it's doing. For example, it'll produce information about
160
- # requests, responses, and errors that are received. Valid log levels are
161
- # `debug` and `info`, with `debug` being a little more verbose in places.
162
- #
163
- # Use of this configuration is only useful when `.logger` is _not_ set. When
164
- # it is, the decision what levels to print is entirely deferred to the logger.
165
- def self.log_level
166
- @log_level
167
- end
168
-
169
- def self.log_level=(val)
170
- # Backwards compatibility for values that we briefly allowed
171
- if val == "debug"
172
- val = LEVEL_DEBUG
173
- elsif val == "info"
174
- val = LEVEL_INFO
175
- end
176
-
177
- if !val.nil? && ![LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO].include?(val)
178
- raise ArgumentError, "log_level should only be set to `nil`, `debug` or `info`"
179
- end
180
- @log_level = val
181
- end
182
-
183
- # Sets a logger to which logging output will be sent. The logger should
184
- # support the same interface as the `Logger` class that's part of Ruby's
185
- # standard library (hint, anything in `Rails.logger` will likely be
186
- # suitable).
187
- #
188
- # If `.logger` is set, the value of `.log_level` is ignored. The decision on
189
- # what levels to print is entirely deferred to the logger.
190
- def self.logger
191
- @logger
192
- end
193
-
194
- def self.logger=(val)
195
- @logger = val
196
- end
197
-
198
- def self.max_network_retries
199
- @max_network_retries
200
- end
201
-
202
- def self.max_network_retries=(val)
203
- @max_network_retries = val.to_i
204
- end
205
-
206
102
  # Sets some basic information about the running application that's sent along
207
103
  # with API requests. Useful for plugin authors to identify their plugin when
208
104
  # communicating with Stripe.
209
105
  #
210
- # Takes a name and optional version and plugin URL.
211
- def self.set_app_info(name, version: nil, url: nil)
106
+ # Takes a name and optional partner program ID, plugin URL, and version.
107
+ def self.set_app_info(name, partner_id: nil, url: nil, version: nil)
212
108
  @app_info = {
213
109
  name: name,
110
+ partner_id: partner_id,
214
111
  url: url,
215
112
  version: version,
216
113
  }
217
114
  end
218
-
219
- # DEPRECATED. Use `Util#encode_parameters` instead.
220
- def self.uri_encode(params)
221
- Util.encode_parameters(params)
222
- end
223
- private_class_method :uri_encode
224
- class << self
225
- extend Gem::Deprecate
226
- deprecate :uri_encode, "Stripe::Util#encode_parameters", 2016, 1
227
- end
228
115
  end
229
116
 
230
117
  Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
data/stripe.gemspec CHANGED
@@ -1,22 +1,41 @@
1
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift(::File.join(::File.dirname(__FILE__), "lib"))
2
4
 
3
5
  require "stripe/version"
4
6
 
5
7
  Gem::Specification.new do |s|
6
8
  s.name = "stripe"
7
9
  s.version = Stripe::VERSION
8
- s.required_ruby_version = ">= 2.0.0"
10
+ s.required_ruby_version = ">= 2.3.0"
9
11
  s.summary = "Ruby bindings for the Stripe API"
10
- s.description = "Stripe is the easiest way to accept payments online. See https://stripe.com for details."
12
+ s.description = "Stripe is the easiest way to accept payments online. " \
13
+ "See https://stripe.com for details."
11
14
  s.author = "Stripe"
12
15
  s.email = "support@stripe.com"
13
- s.homepage = "https://stripe.com/docs/api/ruby"
16
+ s.homepage = "https://stripe.com/docs/api?lang=ruby"
14
17
  s.license = "MIT"
15
18
 
16
- s.add_dependency("faraday", "~> 0.10")
19
+ s.metadata = {
20
+ "bug_tracker_uri" => "https://github.com/stripe/stripe-ruby/issues",
21
+ "changelog_uri" =>
22
+ "https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md",
23
+ "documentation_uri" => "https://stripe.com/docs/api?lang=ruby",
24
+ "github_repo" => "ssh://github.com/stripe/stripe-ruby",
25
+ "homepage_uri" => "https://stripe.com/docs/api?lang=ruby",
26
+ "source_code_uri" => "https://github.com/stripe/stripe-ruby",
27
+ }
17
28
 
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- test/*`.split("\n")
20
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
29
+ ignored = Regexp.union(
30
+ /\A\.editorconfig/,
31
+ /\A\.git/,
32
+ /\A\.rubocop/,
33
+ /\A\.travis.yml/,
34
+ /\A\.vscode/,
35
+ /\Atest/
36
+ )
37
+ s.files = `git ls-files`.split("\n").reject { |f| ignored.match(f) }
38
+ s.executables = `git ls-files -- bin/*`.split("\n")
39
+ .map { |f| ::File.basename(f) }
21
40
  s.require_paths = ["lib"]
22
41
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.2
4
+ version: 5.45.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-07 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: faraday
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.10'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.10'
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
28
14
  for details.
29
15
  email: support@stripe.com
@@ -32,13 +18,8 @@ executables:
32
18
  extensions: []
33
19
  extra_rdoc_files: []
34
20
  files:
35
- - ".gitattributes"
36
- - ".github/ISSUE_TEMPLATE.md"
37
- - ".gitignore"
38
- - ".rubocop.yml"
39
- - ".rubocop_todo.yml"
40
- - ".travis.yml"
41
21
  - CHANGELOG.md
22
+ - CODE_OF_CONDUCT.md
42
23
  - CONTRIBUTORS
43
24
  - Gemfile
44
25
  - History.txt
@@ -49,8 +30,6 @@ files:
49
30
  - bin/stripe-console
50
31
  - lib/data/ca-certificates.crt
51
32
  - lib/stripe.rb
52
- - lib/stripe/account.rb
53
- - lib/stripe/alipay_account.rb
54
33
  - lib/stripe/api_operations/create.rb
55
34
  - lib/stripe/api_operations/delete.rb
56
35
  - lib/stripe/api_operations/list.rb
@@ -58,114 +37,124 @@ files:
58
37
  - lib/stripe/api_operations/request.rb
59
38
  - lib/stripe/api_operations/save.rb
60
39
  - lib/stripe/api_resource.rb
61
- - lib/stripe/apple_pay_domain.rb
62
- - lib/stripe/application_fee.rb
63
- - lib/stripe/application_fee_refund.rb
64
- - lib/stripe/balance.rb
65
- - lib/stripe/balance_transaction.rb
66
- - lib/stripe/bank_account.rb
67
- - lib/stripe/bitcoin_receiver.rb
68
- - lib/stripe/bitcoin_transaction.rb
69
- - lib/stripe/card.rb
70
- - lib/stripe/charge.rb
71
- - lib/stripe/country_spec.rb
72
- - lib/stripe/coupon.rb
73
- - lib/stripe/customer.rb
74
- - lib/stripe/dispute.rb
75
- - lib/stripe/ephemeral_key.rb
40
+ - lib/stripe/connection_manager.rb
41
+ - lib/stripe/error_object.rb
76
42
  - lib/stripe/errors.rb
77
- - lib/stripe/event.rb
78
- - lib/stripe/exchange_rate.rb
79
- - lib/stripe/file_upload.rb
80
- - lib/stripe/invoice.rb
81
- - lib/stripe/invoice_item.rb
82
- - lib/stripe/invoice_line_item.rb
43
+ - lib/stripe/instrumentation.rb
83
44
  - lib/stripe/list_object.rb
84
- - lib/stripe/login_link.rb
45
+ - lib/stripe/multipart_encoder.rb
85
46
  - lib/stripe/oauth.rb
86
- - lib/stripe/order.rb
87
- - lib/stripe/order_return.rb
88
- - lib/stripe/payout.rb
89
- - lib/stripe/plan.rb
90
- - lib/stripe/product.rb
91
- - lib/stripe/recipient.rb
92
- - lib/stripe/recipient_transfer.rb
93
- - lib/stripe/refund.rb
94
- - lib/stripe/reversal.rb
47
+ - lib/stripe/object_types.rb
48
+ - lib/stripe/resources.rb
49
+ - lib/stripe/resources/account.rb
50
+ - lib/stripe/resources/account_link.rb
51
+ - lib/stripe/resources/alipay_account.rb
52
+ - lib/stripe/resources/apple_pay_domain.rb
53
+ - lib/stripe/resources/application_fee.rb
54
+ - lib/stripe/resources/application_fee_refund.rb
55
+ - lib/stripe/resources/balance.rb
56
+ - lib/stripe/resources/balance_transaction.rb
57
+ - lib/stripe/resources/bank_account.rb
58
+ - lib/stripe/resources/billing_portal/configuration.rb
59
+ - lib/stripe/resources/billing_portal/session.rb
60
+ - lib/stripe/resources/bitcoin_receiver.rb
61
+ - lib/stripe/resources/bitcoin_transaction.rb
62
+ - lib/stripe/resources/capability.rb
63
+ - lib/stripe/resources/card.rb
64
+ - lib/stripe/resources/charge.rb
65
+ - lib/stripe/resources/checkout/session.rb
66
+ - lib/stripe/resources/country_spec.rb
67
+ - lib/stripe/resources/coupon.rb
68
+ - lib/stripe/resources/credit_note.rb
69
+ - lib/stripe/resources/credit_note_line_item.rb
70
+ - lib/stripe/resources/customer.rb
71
+ - lib/stripe/resources/customer_balance_transaction.rb
72
+ - lib/stripe/resources/discount.rb
73
+ - lib/stripe/resources/dispute.rb
74
+ - lib/stripe/resources/ephemeral_key.rb
75
+ - lib/stripe/resources/event.rb
76
+ - lib/stripe/resources/exchange_rate.rb
77
+ - lib/stripe/resources/file.rb
78
+ - lib/stripe/resources/file_link.rb
79
+ - lib/stripe/resources/identity/verification_report.rb
80
+ - lib/stripe/resources/identity/verification_session.rb
81
+ - lib/stripe/resources/invoice.rb
82
+ - lib/stripe/resources/invoice_item.rb
83
+ - lib/stripe/resources/invoice_line_item.rb
84
+ - lib/stripe/resources/issuing/authorization.rb
85
+ - lib/stripe/resources/issuing/card.rb
86
+ - lib/stripe/resources/issuing/card_details.rb
87
+ - lib/stripe/resources/issuing/cardholder.rb
88
+ - lib/stripe/resources/issuing/dispute.rb
89
+ - lib/stripe/resources/issuing/transaction.rb
90
+ - lib/stripe/resources/line_item.rb
91
+ - lib/stripe/resources/login_link.rb
92
+ - lib/stripe/resources/mandate.rb
93
+ - lib/stripe/resources/order.rb
94
+ - lib/stripe/resources/order_return.rb
95
+ - lib/stripe/resources/payment_intent.rb
96
+ - lib/stripe/resources/payment_link.rb
97
+ - lib/stripe/resources/payment_method.rb
98
+ - lib/stripe/resources/payout.rb
99
+ - lib/stripe/resources/person.rb
100
+ - lib/stripe/resources/plan.rb
101
+ - lib/stripe/resources/price.rb
102
+ - lib/stripe/resources/product.rb
103
+ - lib/stripe/resources/promotion_code.rb
104
+ - lib/stripe/resources/quote.rb
105
+ - lib/stripe/resources/radar/early_fraud_warning.rb
106
+ - lib/stripe/resources/radar/value_list.rb
107
+ - lib/stripe/resources/radar/value_list_item.rb
108
+ - lib/stripe/resources/recipient.rb
109
+ - lib/stripe/resources/recipient_transfer.rb
110
+ - lib/stripe/resources/refund.rb
111
+ - lib/stripe/resources/reporting/report_run.rb
112
+ - lib/stripe/resources/reporting/report_type.rb
113
+ - lib/stripe/resources/reversal.rb
114
+ - lib/stripe/resources/review.rb
115
+ - lib/stripe/resources/setup_attempt.rb
116
+ - lib/stripe/resources/setup_intent.rb
117
+ - lib/stripe/resources/shipping_rate.rb
118
+ - lib/stripe/resources/sigma/scheduled_query_run.rb
119
+ - lib/stripe/resources/sku.rb
120
+ - lib/stripe/resources/source.rb
121
+ - lib/stripe/resources/source_transaction.rb
122
+ - lib/stripe/resources/subscription.rb
123
+ - lib/stripe/resources/subscription_item.rb
124
+ - lib/stripe/resources/subscription_schedule.rb
125
+ - lib/stripe/resources/tax_code.rb
126
+ - lib/stripe/resources/tax_id.rb
127
+ - lib/stripe/resources/tax_rate.rb
128
+ - lib/stripe/resources/terminal/connection_token.rb
129
+ - lib/stripe/resources/terminal/location.rb
130
+ - lib/stripe/resources/terminal/reader.rb
131
+ - lib/stripe/resources/test_helpers/test_clock.rb
132
+ - lib/stripe/resources/three_d_secure.rb
133
+ - lib/stripe/resources/token.rb
134
+ - lib/stripe/resources/topup.rb
135
+ - lib/stripe/resources/transfer.rb
136
+ - lib/stripe/resources/usage_record.rb
137
+ - lib/stripe/resources/usage_record_summary.rb
138
+ - lib/stripe/resources/webhook_endpoint.rb
95
139
  - lib/stripe/singleton_api_resource.rb
96
- - lib/stripe/sku.rb
97
- - lib/stripe/source.rb
98
- - lib/stripe/source_transaction.rb
99
140
  - lib/stripe/stripe_client.rb
141
+ - lib/stripe/stripe_configuration.rb
100
142
  - lib/stripe/stripe_object.rb
101
143
  - lib/stripe/stripe_response.rb
102
- - lib/stripe/subscription.rb
103
- - lib/stripe/subscription_item.rb
104
- - lib/stripe/three_d_secure.rb
105
- - lib/stripe/token.rb
106
- - lib/stripe/transfer.rb
107
144
  - lib/stripe/util.rb
108
145
  - lib/stripe/version.rb
109
146
  - lib/stripe/webhook.rb
110
147
  - stripe.gemspec
111
- - test/api_stub_helpers.rb
112
- - test/stripe/account_external_accounts_operations_test.rb
113
- - test/stripe/account_login_links_operations_test.rb
114
- - test/stripe/account_test.rb
115
- - test/stripe/alipay_account_test.rb
116
- - test/stripe/api_operations_test.rb
117
- - test/stripe/api_resource_test.rb
118
- - test/stripe/apple_pay_domain_test.rb
119
- - test/stripe/application_fee_refund_test.rb
120
- - test/stripe/application_fee_refunds_operations_test.rb
121
- - test/stripe/application_fee_test.rb
122
- - test/stripe/balance_test.rb
123
- - test/stripe/bank_account_test.rb
124
- - test/stripe/charge_test.rb
125
- - test/stripe/country_spec_test.rb
126
- - test/stripe/coupon_test.rb
127
- - test/stripe/customer_card_test.rb
128
- - test/stripe/customer_sources_operations_test.rb
129
- - test/stripe/customer_test.rb
130
- - test/stripe/dispute_test.rb
131
- - test/stripe/ephemeral_key_test.rb
132
- - test/stripe/errors_test.rb
133
- - test/stripe/exchange_rate_test.rb
134
- - test/stripe/file_upload_test.rb
135
- - test/stripe/invoice_item_test.rb
136
- - test/stripe/invoice_line_item_test.rb
137
- - test/stripe/invoice_test.rb
138
- - test/stripe/list_object_test.rb
139
- - test/stripe/login_link_test.rb
140
- - test/stripe/oauth_test.rb
141
- - test/stripe/order_return_test.rb
142
- - test/stripe/order_test.rb
143
- - test/stripe/payout_test.rb
144
- - test/stripe/plan_test.rb
145
- - test/stripe/product_test.rb
146
- - test/stripe/recipient_test.rb
147
- - test/stripe/refund_test.rb
148
- - test/stripe/reversal_test.rb
149
- - test/stripe/sku_test.rb
150
- - test/stripe/source_test.rb
151
- - test/stripe/source_transaction_test.rb
152
- - test/stripe/stripe_client_test.rb
153
- - test/stripe/stripe_object_test.rb
154
- - test/stripe/stripe_response_test.rb
155
- - test/stripe/subscription_item_test.rb
156
- - test/stripe/subscription_test.rb
157
- - test/stripe/three_d_secure_test.rb
158
- - test/stripe/transfer_reversals_operations_test.rb
159
- - test/stripe/transfer_test.rb
160
- - test/stripe/util_test.rb
161
- - test/stripe/webhook_test.rb
162
- - test/stripe_test.rb
163
- - test/test_data.rb
164
- - test/test_helper.rb
165
- homepage: https://stripe.com/docs/api/ruby
148
+ homepage: https://stripe.com/docs/api?lang=ruby
166
149
  licenses:
167
150
  - MIT
168
- metadata: {}
151
+ metadata:
152
+ bug_tracker_uri: https://github.com/stripe/stripe-ruby/issues
153
+ changelog_uri: https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md
154
+ documentation_uri: https://stripe.com/docs/api?lang=ruby
155
+ github_repo: ssh://github.com/stripe/stripe-ruby
156
+ homepage_uri: https://stripe.com/docs/api?lang=ruby
157
+ source_code_uri: https://github.com/stripe/stripe-ruby
169
158
  post_install_message:
170
159
  rdoc_options: []
171
160
  require_paths:
@@ -174,70 +163,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
163
  requirements:
175
164
  - - ">="
176
165
  - !ruby/object:Gem::Version
177
- version: 2.0.0
166
+ version: 2.3.0
178
167
  required_rubygems_version: !ruby/object:Gem::Requirement
179
168
  requirements:
180
169
  - - ">="
181
170
  - !ruby/object:Gem::Version
182
171
  version: '0'
183
172
  requirements: []
184
- rubyforge_project:
185
- rubygems_version: 2.6.14
173
+ rubygems_version: 3.1.2
186
174
  signing_key:
187
175
  specification_version: 4
188
176
  summary: Ruby bindings for the Stripe API
189
- test_files:
190
- - test/api_stub_helpers.rb
191
- - test/stripe/account_external_accounts_operations_test.rb
192
- - test/stripe/account_login_links_operations_test.rb
193
- - test/stripe/account_test.rb
194
- - test/stripe/alipay_account_test.rb
195
- - test/stripe/api_operations_test.rb
196
- - test/stripe/api_resource_test.rb
197
- - test/stripe/apple_pay_domain_test.rb
198
- - test/stripe/application_fee_refund_test.rb
199
- - test/stripe/application_fee_refunds_operations_test.rb
200
- - test/stripe/application_fee_test.rb
201
- - test/stripe/balance_test.rb
202
- - test/stripe/bank_account_test.rb
203
- - test/stripe/charge_test.rb
204
- - test/stripe/country_spec_test.rb
205
- - test/stripe/coupon_test.rb
206
- - test/stripe/customer_card_test.rb
207
- - test/stripe/customer_sources_operations_test.rb
208
- - test/stripe/customer_test.rb
209
- - test/stripe/dispute_test.rb
210
- - test/stripe/ephemeral_key_test.rb
211
- - test/stripe/errors_test.rb
212
- - test/stripe/exchange_rate_test.rb
213
- - test/stripe/file_upload_test.rb
214
- - test/stripe/invoice_item_test.rb
215
- - test/stripe/invoice_line_item_test.rb
216
- - test/stripe/invoice_test.rb
217
- - test/stripe/list_object_test.rb
218
- - test/stripe/login_link_test.rb
219
- - test/stripe/oauth_test.rb
220
- - test/stripe/order_return_test.rb
221
- - test/stripe/order_test.rb
222
- - test/stripe/payout_test.rb
223
- - test/stripe/plan_test.rb
224
- - test/stripe/product_test.rb
225
- - test/stripe/recipient_test.rb
226
- - test/stripe/refund_test.rb
227
- - test/stripe/reversal_test.rb
228
- - test/stripe/sku_test.rb
229
- - test/stripe/source_test.rb
230
- - test/stripe/source_transaction_test.rb
231
- - test/stripe/stripe_client_test.rb
232
- - test/stripe/stripe_object_test.rb
233
- - test/stripe/stripe_response_test.rb
234
- - test/stripe/subscription_item_test.rb
235
- - test/stripe/subscription_test.rb
236
- - test/stripe/three_d_secure_test.rb
237
- - test/stripe/transfer_reversals_operations_test.rb
238
- - test/stripe/transfer_test.rb
239
- - test/stripe/util_test.rb
240
- - test/stripe/webhook_test.rb
241
- - test/stripe_test.rb
242
- - test/test_data.rb
243
- - test/test_helper.rb
177
+ test_files: []
data/.gitattributes DELETED
@@ -1,4 +0,0 @@
1
- # may be useful in hiding large schema changes in pull request diffs (but not
2
- # using it for now)
3
- spec/*.json binary
4
- spec/*.yaml binary
@@ -1,5 +0,0 @@
1
- Please only file issues here that you believe represent actual bugs or feature requests for the Stripe Ruby library.
2
-
3
- If you're having general trouble with your Stripe integration, please reach out to support using the form at https://support.stripe.com/ (preferred) or via email to support@stripe.com.
4
-
5
- If you are reporting a bug, please include your Ruby version and the version of the Stripe Ruby library you're using, as well as any other details that may be helpful in reproducing the problem.
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- /stripe-*.gem
2
- /Gemfile.lock
3
- .rvmrc
4
- Gemfile.lock
5
- tags
6
- /.bundle/