stripe 4.10.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +10 -0
  3. data/.rubocop.yml +28 -4
  4. data/.rubocop_todo.yml +11 -22
  5. data/.travis.yml +3 -6
  6. data/.vscode/extensions.json +7 -0
  7. data/.vscode/settings.json +8 -0
  8. data/CHANGELOG.md +86 -1
  9. data/Gemfile +2 -10
  10. data/README.md +96 -40
  11. data/Rakefile +8 -7
  12. data/VERSION +1 -1
  13. data/lib/stripe/api_operations/delete.rb +23 -1
  14. data/lib/stripe/api_operations/list.rb +0 -6
  15. data/lib/stripe/api_operations/nested_resource.rb +14 -7
  16. data/lib/stripe/api_operations/request.rb +3 -7
  17. data/lib/stripe/api_operations/save.rb +1 -3
  18. data/lib/stripe/api_resource.rb +50 -2
  19. data/lib/stripe/connection_manager.rb +131 -0
  20. data/lib/stripe/error_object.rb +94 -0
  21. data/lib/stripe/errors.rb +22 -9
  22. data/lib/stripe/list_object.rb +11 -5
  23. data/lib/stripe/multipart_encoder.rb +131 -0
  24. data/lib/stripe/object_types.rb +94 -0
  25. data/lib/stripe/{account.rb → resources/account.rb} +49 -27
  26. data/lib/stripe/{account_link.rb → resources/account_link.rb} +1 -1
  27. data/lib/stripe/resources/alipay_account.rb +34 -0
  28. data/lib/stripe/{apple_pay_domain.rb → resources/apple_pay_domain.rb} +1 -1
  29. data/lib/stripe/resources/application_fee.rb +13 -0
  30. data/lib/stripe/resources/application_fee_refund.rb +30 -0
  31. data/lib/stripe/{balance.rb → resources/balance.rb} +1 -1
  32. data/lib/stripe/{balance_transaction.rb → resources/balance_transaction.rb} +1 -5
  33. data/lib/stripe/{bank_account.rb → resources/bank_account.rb} +14 -4
  34. data/lib/stripe/{bitcoin_receiver.rb → resources/bitcoin_receiver.rb} +3 -3
  35. data/lib/stripe/{bitcoin_transaction.rb → resources/bitcoin_transaction.rb} +1 -1
  36. data/lib/stripe/resources/capability.rb +33 -0
  37. data/lib/stripe/{card.rb → resources/card.rb} +12 -4
  38. data/lib/stripe/resources/charge.rb +22 -0
  39. data/lib/stripe/{checkout → resources/checkout}/session.rb +2 -2
  40. data/lib/stripe/{country_spec.rb → resources/country_spec.rb} +1 -1
  41. data/lib/stripe/{coupon.rb → resources/coupon.rb} +2 -2
  42. data/lib/stripe/resources/credit_note.rb +22 -0
  43. data/lib/stripe/resources/customer.rb +35 -0
  44. data/lib/stripe/resources/customer_balance_transaction.rb +30 -0
  45. data/lib/stripe/resources/discount.rb +7 -0
  46. data/lib/stripe/{dispute.rb → resources/dispute.rb} +9 -7
  47. data/lib/stripe/{ephemeral_key.rb → resources/ephemeral_key.rb} +5 -2
  48. data/lib/stripe/{event.rb → resources/event.rb} +1 -1
  49. data/lib/stripe/{exchange_rate.rb → resources/exchange_rate.rb} +1 -1
  50. data/lib/stripe/{file.rb → resources/file.rb} +8 -11
  51. data/lib/stripe/{file_link.rb → resources/file_link.rb} +2 -2
  52. data/lib/stripe/resources/invoice.rb +73 -0
  53. data/lib/stripe/{invoice_item.rb → resources/invoice_item.rb} +2 -2
  54. data/lib/stripe/{invoice_line_item.rb → resources/invoice_line_item.rb} +1 -1
  55. data/lib/stripe/resources/issuing/authorization.rb +33 -0
  56. data/lib/stripe/resources/issuing/card.rb +24 -0
  57. data/lib/stripe/{issuing → resources/issuing}/card_details.rb +1 -1
  58. data/lib/stripe/{issuing → resources/issuing}/cardholder.rb +2 -2
  59. data/lib/stripe/{issuing → resources/issuing}/dispute.rb +2 -2
  60. data/lib/stripe/{issuing → resources/issuing}/transaction.rb +2 -2
  61. data/lib/stripe/resources/login_link.rb +14 -0
  62. data/lib/stripe/resources/order.rb +32 -0
  63. data/lib/stripe/{order_return.rb → resources/order_return.rb} +1 -1
  64. data/lib/stripe/resources/payment_intent.rb +42 -0
  65. data/lib/stripe/resources/payment_method.rb +32 -0
  66. data/lib/stripe/resources/payout.rb +22 -0
  67. data/lib/stripe/{person.rb → resources/person.rb} +8 -3
  68. data/lib/stripe/{plan.rb → resources/plan.rb} +1 -1
  69. data/lib/stripe/{product.rb → resources/product.rb} +3 -3
  70. data/lib/stripe/resources/radar/early_fraud_warning.rb +11 -0
  71. data/lib/stripe/{radar → resources/radar}/value_list.rb +2 -2
  72. data/lib/stripe/{radar → resources/radar}/value_list_item.rb +2 -2
  73. data/lib/stripe/{recipient.rb → resources/recipient.rb} +2 -6
  74. data/lib/stripe/{recipient_transfer.rb → resources/recipient_transfer.rb} +1 -1
  75. data/lib/stripe/{refund.rb → resources/refund.rb} +1 -1
  76. data/lib/stripe/{reporting → resources/reporting}/report_run.rb +2 -2
  77. data/lib/stripe/{reporting → resources/reporting}/report_type.rb +2 -2
  78. data/lib/stripe/resources/reversal.rb +29 -0
  79. data/lib/stripe/resources/review.rb +20 -0
  80. data/lib/stripe/resources/setup_intent.rb +32 -0
  81. data/lib/stripe/{sigma → resources/sigma}/scheduled_query_run.rb +2 -2
  82. data/lib/stripe/{sku.rb → resources/sku.rb} +3 -3
  83. data/lib/stripe/{source.rb → resources/source.rb} +17 -15
  84. data/lib/stripe/{source_transaction.rb → resources/source_transaction.rb} +1 -1
  85. data/lib/stripe/resources/subscription.rb +25 -0
  86. data/lib/stripe/{subscription_item.rb → resources/subscription_item.rb} +5 -2
  87. data/lib/stripe/resources/subscription_schedule.rb +32 -0
  88. data/lib/stripe/resources/tax_id.rb +26 -0
  89. data/lib/stripe/resources/tax_rate.rb +11 -0
  90. data/lib/stripe/{terminal → resources/terminal}/connection_token.rb +2 -2
  91. data/lib/stripe/{terminal → resources/terminal}/location.rb +2 -2
  92. data/lib/stripe/{terminal → resources/terminal}/reader.rb +2 -2
  93. data/lib/stripe/{three_d_secure.rb → resources/three_d_secure.rb} +1 -1
  94. data/lib/stripe/{token.rb → resources/token.rb} +1 -1
  95. data/lib/stripe/resources/topup.rb +22 -0
  96. data/lib/stripe/resources/transfer.rb +26 -0
  97. data/lib/stripe/resources/usage_record.rb +7 -0
  98. data/lib/stripe/{usage_record_summary.rb → resources/usage_record_summary.rb} +1 -1
  99. data/lib/stripe/{webhook_endpoint.rb → resources/webhook_endpoint.rb} +2 -2
  100. data/lib/stripe/resources.rb +77 -0
  101. data/lib/stripe/singleton_api_resource.rb +3 -1
  102. data/lib/stripe/stripe_client.rb +337 -218
  103. data/lib/stripe/stripe_object.rb +54 -59
  104. data/lib/stripe/stripe_response.rb +53 -21
  105. data/lib/stripe/util.rb +54 -110
  106. data/lib/stripe/version.rb +1 -1
  107. data/lib/stripe/webhook.rb +5 -3
  108. data/lib/stripe.rb +64 -86
  109. data/stripe.gemspec +14 -5
  110. data/test/stripe/account_link_test.rb +1 -1
  111. data/test/stripe/account_test.rb +186 -30
  112. data/test/stripe/alipay_account_test.rb +1 -1
  113. data/test/stripe/api_operations_test.rb +3 -4
  114. data/test/stripe/api_resource_test.rb +105 -18
  115. data/test/stripe/apple_pay_domain_test.rb +18 -5
  116. data/test/stripe/application_fee_refund_test.rb +1 -1
  117. data/test/stripe/application_fee_test.rb +45 -1
  118. data/test/stripe/balance_test.rb +1 -1
  119. data/test/stripe/balance_transaction_test.rb +20 -0
  120. data/test/stripe/bank_account_test.rb +1 -1
  121. data/test/stripe/capability_test.rb +45 -0
  122. data/test/stripe/charge_test.rb +13 -8
  123. data/test/stripe/checkout/session_test.rb +1 -1
  124. data/test/stripe/connection_manager_test.rb +138 -0
  125. data/test/stripe/country_spec_test.rb +1 -1
  126. data/test/stripe/coupon_test.rb +16 -6
  127. data/test/stripe/credit_note_test.rb +61 -0
  128. data/test/stripe/customer_balance_transaction_test.rb +37 -0
  129. data/test/stripe/customer_card_test.rb +1 -1
  130. data/test/stripe/customer_test.rb +151 -40
  131. data/test/stripe/dispute_test.rb +10 -1
  132. data/test/stripe/ephemeral_key_test.rb +8 -1
  133. data/test/stripe/errors_test.rb +30 -9
  134. data/test/stripe/exchange_rate_test.rb +1 -1
  135. data/test/stripe/file_link_test.rb +1 -1
  136. data/test/stripe/file_test.rb +19 -5
  137. data/test/stripe/invoice_item_test.rb +18 -7
  138. data/test/stripe/invoice_line_item_test.rb +1 -1
  139. data/test/stripe/invoice_test.rb +77 -9
  140. data/test/stripe/issuing/authorization_test.rb +33 -11
  141. data/test/stripe/issuing/card_test.rb +15 -6
  142. data/test/stripe/issuing/cardholder_test.rb +1 -1
  143. data/test/stripe/issuing/dispute_test.rb +1 -1
  144. data/test/stripe/issuing/transaction_test.rb +1 -1
  145. data/test/stripe/list_object_test.rb +1 -17
  146. data/test/stripe/login_link_test.rb +2 -2
  147. data/test/stripe/multipart_encoder_test.rb +130 -0
  148. data/test/stripe/oauth_test.rb +1 -1
  149. data/test/stripe/order_return_test.rb +1 -1
  150. data/test/stripe/order_test.rb +28 -3
  151. data/test/stripe/payment_intent_test.rb +31 -4
  152. data/test/stripe/payment_method_test.rb +19 -1
  153. data/test/stripe/payout_test.rb +8 -1
  154. data/test/stripe/person_test.rb +1 -1
  155. data/test/stripe/plan_test.rb +26 -20
  156. data/test/stripe/product_test.rb +16 -6
  157. data/test/stripe/radar/early_fraud_warning_test.rb +22 -0
  158. data/test/stripe/radar/value_list_item_test.rb +16 -6
  159. data/test/stripe/radar/value_list_test.rb +16 -6
  160. data/test/stripe/recipient_test.rb +18 -5
  161. data/test/stripe/refund_test.rb +1 -1
  162. data/test/stripe/reporting/report_run_test.rb +1 -1
  163. data/test/stripe/reporting/report_type_test.rb +1 -1
  164. data/test/stripe/reversal_test.rb +1 -1
  165. data/test/stripe/review_test.rb +1 -1
  166. data/test/stripe/setup_intent_test.rb +84 -0
  167. data/test/stripe/sigma/scheduled_query_run_test.rb +1 -1
  168. data/test/stripe/sku_test.rb +16 -6
  169. data/test/stripe/source_test.rb +14 -19
  170. data/test/stripe/source_transaction_test.rb +1 -1
  171. data/test/stripe/stripe_client_test.rb +230 -26
  172. data/test/stripe/stripe_object_test.rb +8 -36
  173. data/test/stripe/stripe_response_test.rb +71 -25
  174. data/test/stripe/subscription_item_test.rb +28 -6
  175. data/test/stripe/subscription_schedule_test.rb +19 -1
  176. data/test/stripe/subscription_test.rb +29 -9
  177. data/test/stripe/tax_id_test.rb +31 -0
  178. data/test/stripe/tax_rate_test.rb +43 -0
  179. data/test/stripe/terminal/connection_token_test.rb +1 -1
  180. data/test/stripe/terminal/location_test.rb +16 -6
  181. data/test/stripe/terminal/reader_test.rb +16 -6
  182. data/test/stripe/three_d_secure_test.rb +1 -1
  183. data/test/stripe/topup_test.rb +9 -1
  184. data/test/stripe/transfer_test.rb +46 -1
  185. data/test/stripe/usage_record_summary_test.rb +1 -1
  186. data/test/stripe/util_test.rb +1 -1
  187. data/test/stripe/webhook_endpoint_test.rb +18 -1
  188. data/test/stripe/webhook_test.rb +4 -4
  189. data/test/stripe_mock.rb +4 -3
  190. data/test/stripe_test.rb +1 -14
  191. data/test/test_helper.rb +14 -11
  192. metadata +114 -124
  193. data/lib/stripe/alipay_account.rb +0 -27
  194. data/lib/stripe/application_fee.rb +0 -23
  195. data/lib/stripe/application_fee_refund.rb +0 -22
  196. data/lib/stripe/charge.rb +0 -84
  197. data/lib/stripe/customer.rb +0 -90
  198. data/lib/stripe/invoice.rb +0 -48
  199. data/lib/stripe/issuer_fraud_record.rb +0 -9
  200. data/lib/stripe/issuing/authorization.rb +0 -22
  201. data/lib/stripe/issuing/card.rb +0 -18
  202. data/lib/stripe/login_link.rb +0 -11
  203. data/lib/stripe/order.rb +0 -31
  204. data/lib/stripe/payment_intent.rb +0 -26
  205. data/lib/stripe/payment_method.rb +0 -23
  206. data/lib/stripe/payout.rb +0 -20
  207. data/lib/stripe/reversal.rb +0 -22
  208. data/lib/stripe/review.rb +0 -14
  209. data/lib/stripe/subscription.rb +0 -25
  210. data/lib/stripe/subscription_schedule.rb +0 -32
  211. data/lib/stripe/subscription_schedule_revision.rb +0 -25
  212. data/lib/stripe/topup.rb +0 -16
  213. data/lib/stripe/transfer.rb +0 -23
  214. data/lib/stripe/usage_record.rb +0 -14
  215. data/test/stripe/account_external_accounts_operations_test.rb +0 -69
  216. data/test/stripe/account_login_links_operations_test.rb +0 -21
  217. data/test/stripe/account_persons_operations_test.rb +0 -70
  218. data/test/stripe/application_fee_refunds_operations_test.rb +0 -56
  219. data/test/stripe/customer_sources_operations_test.rb +0 -64
  220. data/test/stripe/file_upload_test.rb +0 -76
  221. data/test/stripe/issuer_fraud_record_test.rb +0 -20
  222. data/test/stripe/subscription_schedule_revision_test.rb +0 -37
  223. data/test/stripe/subscription_schedule_revisions_operations_test.rb +0 -35
  224. data/test/stripe/transfer_reversals_operations_test.rb +0 -57
  225. data/test/stripe/usage_record_test.rb +0 -28
@@ -1,16 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class WebhookTest < Test::Unit::TestCase
7
- EVENT_PAYLOAD = <<-PAYLOAD.freeze
7
+ EVENT_PAYLOAD = <<~PAYLOAD
8
8
  {
9
9
  "id": "evt_test_webhook",
10
10
  "object": "event"
11
11
  }
12
12
  PAYLOAD
13
- SECRET = "whsec_test_secret".freeze
13
+ SECRET = "whsec_test_secret"
14
14
 
15
15
  def generate_header(opts = {})
16
16
  opts[:timestamp] ||= Time.now.to_i
@@ -46,7 +46,7 @@ module Stripe
46
46
 
47
47
  context ".verify_signature_header" do
48
48
  should "raise a SignatureVerificationError when the header does not have the expected format" do
49
- header = 'i\'m not even a real signature header'
49
+ header = "i'm not even a real signature header"
50
50
  e = assert_raises(Stripe::SignatureVerificationError) do
51
51
  Stripe::Webhook::Signature.verify_header(EVENT_PAYLOAD, header, "secret")
52
52
  end
data/test/stripe_mock.rb CHANGED
@@ -4,8 +4,8 @@ module Stripe
4
4
  class StripeMock
5
5
  include Singleton
6
6
 
7
- PATH_SPEC = "#{::File.dirname(__FILE__)}/openapi/spec3.json".freeze
8
- PATH_FIXTURES = "#{::File.dirname(__FILE__)}/openapi/fixtures3.json".freeze
7
+ PATH_SPEC = "#{::File.dirname(__FILE__)}/openapi/spec3.json"
8
+ PATH_FIXTURES = "#{::File.dirname(__FILE__)}/openapi/fixtures3.json"
9
9
 
10
10
  @pid = nil
11
11
  @port = -1
@@ -29,7 +29,7 @@ module Stripe
29
29
  @stderr, @child_stderr = ::IO.pipe
30
30
 
31
31
  @pid = ::Process.spawn(
32
- ["stripe-mock", "stripe-mock"],
32
+ %w[stripe-mock stripe-mock],
33
33
  "-http-port",
34
34
  "0", # have stripe-mock select a port
35
35
  "-spec",
@@ -66,6 +66,7 @@ module Stripe
66
66
  # Stops stripe-mock, if necessary.
67
67
  def self.stop
68
68
  return if @pid.nil?
69
+
69
70
  puts("Stopping stripe-mock...")
70
71
  ::Process.kill(:SIGTERM, @pid)
71
72
  ::Process.waitpid2(@pid)
data/test/stripe_test.rb CHANGED
@@ -1,21 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../test_helper", __FILE__)
3
+ require ::File.expand_path("test_helper", __dir__)
4
4
 
5
5
  class StripeTest < Test::Unit::TestCase
6
- should "warn that #refresh_from is deprecated" do
7
- old_stderr = $stderr
8
- $stderr = StringIO.new
9
- begin
10
- Stripe.uri_encode({})
11
- message = "NOTE: Stripe.uri_encode is deprecated; use " \
12
- "Stripe::Util#encode_parameters instead"
13
- assert_match Regexp.new(message), $stderr.string
14
- ensure
15
- $stderr = old_stderr
16
- end
17
- end
18
-
19
6
  should "allow app_info to be configured" do
20
7
  begin
21
8
  old = Stripe.app_info
data/test/test_helper.rb CHANGED
@@ -11,13 +11,13 @@ require "shoulda/context"
11
11
  require "timecop"
12
12
  require "webmock/test_unit"
13
13
 
14
- PROJECT_ROOT = ::File.expand_path("../../", __FILE__)
14
+ PROJECT_ROOT = ::File.expand_path("../", __dir__)
15
15
 
16
- require ::File.expand_path("../test_data", __FILE__)
17
- require ::File.expand_path("../stripe_mock", __FILE__)
16
+ require ::File.expand_path("test_data", __dir__)
17
+ require ::File.expand_path("stripe_mock", __dir__)
18
18
 
19
19
  # If changing this number, please also change it in `.travis.yml`.
20
- MOCK_MINIMUM_VERSION = "0.49.0".freeze
20
+ MOCK_MINIMUM_VERSION = "0.63.0"
21
21
  MOCK_PORT = Stripe::StripeMock.start
22
22
 
23
23
  # Disable all real network connections except those that are outgoing to
@@ -28,16 +28,21 @@ WebMock.disable_net_connect!(allow: "localhost:#{MOCK_PORT}")
28
28
  # we can print one error and fail fast so that it's more clear to the user how
29
29
  # they should fix the problem.
30
30
  begin
31
- conn = Faraday::Connection.new("http://localhost:#{MOCK_PORT}")
32
- resp = conn.get("/")
33
- version = resp.headers["Stripe-Mock-Version"]
31
+ resp = Net::HTTP.get_response(URI("http://localhost:#{MOCK_PORT}/"))
32
+ version = resp["Stripe-Mock-Version"]
33
+
34
+ if version.nil?
35
+ abort("Couldn't find `Stripe-Mock-Version` in response from " \
36
+ "`localhost:#{MOCK_PORT}`. Is the service running there stripe-mock?")
37
+ end
38
+
34
39
  if version != "master" &&
35
40
  Gem::Version.new(version) < Gem::Version.new(MOCK_MINIMUM_VERSION)
36
41
  abort("Your version of stripe-mock (#{version}) is too old. The minimum " \
37
42
  "version to run this test suite is #{MOCK_MINIMUM_VERSION}. Please " \
38
43
  "see its repository for upgrade instructions.")
39
44
  end
40
- rescue Faraday::ConnectionFailed
45
+ rescue Errno::ECONNREFUSED
41
46
  abort("Couldn't reach stripe-mock at `localhost:#{MOCK_PORT}`. Is " \
42
47
  "it running? Please see README for setup instructions.")
43
48
  end
@@ -63,9 +68,7 @@ module Test
63
68
  Stripe.api_key = nil
64
69
  end
65
70
 
66
- private
67
-
68
- def stub_connect
71
+ private def stub_connect
69
72
  stub_request(:any, /^#{Stripe.connect_base}/).to_return(body: "{}")
70
73
  end
71
74
  end
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.0
4
+ version: 5.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: 2019-03-18 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.13'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.13'
27
- - !ruby/object:Gem::Dependency
28
- name: net-http-persistent
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.0'
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
+ dependencies: []
41
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
42
14
  for details.
43
15
  email: support@stripe.com
@@ -46,12 +18,15 @@ executables:
46
18
  extensions: []
47
19
  extra_rdoc_files: []
48
20
  files:
21
+ - ".editorconfig"
49
22
  - ".gitattributes"
50
23
  - ".github/ISSUE_TEMPLATE.md"
51
24
  - ".gitignore"
52
25
  - ".rubocop.yml"
53
26
  - ".rubocop_todo.yml"
54
27
  - ".travis.yml"
28
+ - ".vscode/extensions.json"
29
+ - ".vscode/settings.json"
55
30
  - CHANGELOG.md
56
31
  - CONTRIBUTORS
57
32
  - Gemfile
@@ -63,9 +38,6 @@ files:
63
38
  - bin/stripe-console
64
39
  - lib/data/ca-certificates.crt
65
40
  - lib/stripe.rb
66
- - lib/stripe/account.rb
67
- - lib/stripe/account_link.rb
68
- - lib/stripe/alipay_account.rb
69
41
  - lib/stripe/api_operations/create.rb
70
42
  - lib/stripe/api_operations/delete.rb
71
43
  - lib/stripe/api_operations/list.rb
@@ -73,105 +45,119 @@ files:
73
45
  - lib/stripe/api_operations/request.rb
74
46
  - lib/stripe/api_operations/save.rb
75
47
  - lib/stripe/api_resource.rb
76
- - lib/stripe/apple_pay_domain.rb
77
- - lib/stripe/application_fee.rb
78
- - lib/stripe/application_fee_refund.rb
79
- - lib/stripe/balance.rb
80
- - lib/stripe/balance_transaction.rb
81
- - lib/stripe/bank_account.rb
82
- - lib/stripe/bitcoin_receiver.rb
83
- - lib/stripe/bitcoin_transaction.rb
84
- - lib/stripe/card.rb
85
- - lib/stripe/charge.rb
86
- - lib/stripe/checkout/session.rb
87
- - lib/stripe/country_spec.rb
88
- - lib/stripe/coupon.rb
89
- - lib/stripe/customer.rb
90
- - lib/stripe/dispute.rb
91
- - lib/stripe/ephemeral_key.rb
48
+ - lib/stripe/connection_manager.rb
49
+ - lib/stripe/error_object.rb
92
50
  - lib/stripe/errors.rb
93
- - lib/stripe/event.rb
94
- - lib/stripe/exchange_rate.rb
95
- - lib/stripe/file.rb
96
- - lib/stripe/file_link.rb
97
- - lib/stripe/invoice.rb
98
- - lib/stripe/invoice_item.rb
99
- - lib/stripe/invoice_line_item.rb
100
- - lib/stripe/issuer_fraud_record.rb
101
- - lib/stripe/issuing/authorization.rb
102
- - lib/stripe/issuing/card.rb
103
- - lib/stripe/issuing/card_details.rb
104
- - lib/stripe/issuing/cardholder.rb
105
- - lib/stripe/issuing/dispute.rb
106
- - lib/stripe/issuing/transaction.rb
107
51
  - lib/stripe/list_object.rb
108
- - lib/stripe/login_link.rb
52
+ - lib/stripe/multipart_encoder.rb
109
53
  - lib/stripe/oauth.rb
110
- - lib/stripe/order.rb
111
- - lib/stripe/order_return.rb
112
- - lib/stripe/payment_intent.rb
113
- - lib/stripe/payment_method.rb
114
- - lib/stripe/payout.rb
115
- - lib/stripe/person.rb
116
- - lib/stripe/plan.rb
117
- - lib/stripe/product.rb
118
- - lib/stripe/radar/value_list.rb
119
- - lib/stripe/radar/value_list_item.rb
120
- - lib/stripe/recipient.rb
121
- - lib/stripe/recipient_transfer.rb
122
- - lib/stripe/refund.rb
123
- - lib/stripe/reporting/report_run.rb
124
- - lib/stripe/reporting/report_type.rb
125
- - lib/stripe/reversal.rb
126
- - lib/stripe/review.rb
127
- - lib/stripe/sigma/scheduled_query_run.rb
54
+ - lib/stripe/object_types.rb
55
+ - lib/stripe/resources.rb
56
+ - lib/stripe/resources/account.rb
57
+ - lib/stripe/resources/account_link.rb
58
+ - lib/stripe/resources/alipay_account.rb
59
+ - lib/stripe/resources/apple_pay_domain.rb
60
+ - lib/stripe/resources/application_fee.rb
61
+ - lib/stripe/resources/application_fee_refund.rb
62
+ - lib/stripe/resources/balance.rb
63
+ - lib/stripe/resources/balance_transaction.rb
64
+ - lib/stripe/resources/bank_account.rb
65
+ - lib/stripe/resources/bitcoin_receiver.rb
66
+ - lib/stripe/resources/bitcoin_transaction.rb
67
+ - lib/stripe/resources/capability.rb
68
+ - lib/stripe/resources/card.rb
69
+ - lib/stripe/resources/charge.rb
70
+ - lib/stripe/resources/checkout/session.rb
71
+ - lib/stripe/resources/country_spec.rb
72
+ - lib/stripe/resources/coupon.rb
73
+ - lib/stripe/resources/credit_note.rb
74
+ - lib/stripe/resources/customer.rb
75
+ - lib/stripe/resources/customer_balance_transaction.rb
76
+ - lib/stripe/resources/discount.rb
77
+ - lib/stripe/resources/dispute.rb
78
+ - lib/stripe/resources/ephemeral_key.rb
79
+ - lib/stripe/resources/event.rb
80
+ - lib/stripe/resources/exchange_rate.rb
81
+ - lib/stripe/resources/file.rb
82
+ - lib/stripe/resources/file_link.rb
83
+ - lib/stripe/resources/invoice.rb
84
+ - lib/stripe/resources/invoice_item.rb
85
+ - lib/stripe/resources/invoice_line_item.rb
86
+ - lib/stripe/resources/issuing/authorization.rb
87
+ - lib/stripe/resources/issuing/card.rb
88
+ - lib/stripe/resources/issuing/card_details.rb
89
+ - lib/stripe/resources/issuing/cardholder.rb
90
+ - lib/stripe/resources/issuing/dispute.rb
91
+ - lib/stripe/resources/issuing/transaction.rb
92
+ - lib/stripe/resources/login_link.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_method.rb
97
+ - lib/stripe/resources/payout.rb
98
+ - lib/stripe/resources/person.rb
99
+ - lib/stripe/resources/plan.rb
100
+ - lib/stripe/resources/product.rb
101
+ - lib/stripe/resources/radar/early_fraud_warning.rb
102
+ - lib/stripe/resources/radar/value_list.rb
103
+ - lib/stripe/resources/radar/value_list_item.rb
104
+ - lib/stripe/resources/recipient.rb
105
+ - lib/stripe/resources/recipient_transfer.rb
106
+ - lib/stripe/resources/refund.rb
107
+ - lib/stripe/resources/reporting/report_run.rb
108
+ - lib/stripe/resources/reporting/report_type.rb
109
+ - lib/stripe/resources/reversal.rb
110
+ - lib/stripe/resources/review.rb
111
+ - lib/stripe/resources/setup_intent.rb
112
+ - lib/stripe/resources/sigma/scheduled_query_run.rb
113
+ - lib/stripe/resources/sku.rb
114
+ - lib/stripe/resources/source.rb
115
+ - lib/stripe/resources/source_transaction.rb
116
+ - lib/stripe/resources/subscription.rb
117
+ - lib/stripe/resources/subscription_item.rb
118
+ - lib/stripe/resources/subscription_schedule.rb
119
+ - lib/stripe/resources/tax_id.rb
120
+ - lib/stripe/resources/tax_rate.rb
121
+ - lib/stripe/resources/terminal/connection_token.rb
122
+ - lib/stripe/resources/terminal/location.rb
123
+ - lib/stripe/resources/terminal/reader.rb
124
+ - lib/stripe/resources/three_d_secure.rb
125
+ - lib/stripe/resources/token.rb
126
+ - lib/stripe/resources/topup.rb
127
+ - lib/stripe/resources/transfer.rb
128
+ - lib/stripe/resources/usage_record.rb
129
+ - lib/stripe/resources/usage_record_summary.rb
130
+ - lib/stripe/resources/webhook_endpoint.rb
128
131
  - lib/stripe/singleton_api_resource.rb
129
- - lib/stripe/sku.rb
130
- - lib/stripe/source.rb
131
- - lib/stripe/source_transaction.rb
132
132
  - lib/stripe/stripe_client.rb
133
133
  - lib/stripe/stripe_object.rb
134
134
  - lib/stripe/stripe_response.rb
135
- - lib/stripe/subscription.rb
136
- - lib/stripe/subscription_item.rb
137
- - lib/stripe/subscription_schedule.rb
138
- - lib/stripe/subscription_schedule_revision.rb
139
- - lib/stripe/terminal/connection_token.rb
140
- - lib/stripe/terminal/location.rb
141
- - lib/stripe/terminal/reader.rb
142
- - lib/stripe/three_d_secure.rb
143
- - lib/stripe/token.rb
144
- - lib/stripe/topup.rb
145
- - lib/stripe/transfer.rb
146
- - lib/stripe/usage_record.rb
147
- - lib/stripe/usage_record_summary.rb
148
135
  - lib/stripe/util.rb
149
136
  - lib/stripe/version.rb
150
137
  - lib/stripe/webhook.rb
151
- - lib/stripe/webhook_endpoint.rb
152
138
  - stripe.gemspec
153
139
  - test/api_stub_helpers.rb
154
140
  - test/openapi/README.md
155
- - test/stripe/account_external_accounts_operations_test.rb
156
141
  - test/stripe/account_link_test.rb
157
- - test/stripe/account_login_links_operations_test.rb
158
- - test/stripe/account_persons_operations_test.rb
159
142
  - test/stripe/account_test.rb
160
143
  - test/stripe/alipay_account_test.rb
161
144
  - test/stripe/api_operations_test.rb
162
145
  - test/stripe/api_resource_test.rb
163
146
  - test/stripe/apple_pay_domain_test.rb
164
147
  - test/stripe/application_fee_refund_test.rb
165
- - test/stripe/application_fee_refunds_operations_test.rb
166
148
  - test/stripe/application_fee_test.rb
167
149
  - test/stripe/balance_test.rb
150
+ - test/stripe/balance_transaction_test.rb
168
151
  - test/stripe/bank_account_test.rb
152
+ - test/stripe/capability_test.rb
169
153
  - test/stripe/charge_test.rb
170
154
  - test/stripe/checkout/session_test.rb
155
+ - test/stripe/connection_manager_test.rb
171
156
  - test/stripe/country_spec_test.rb
172
157
  - test/stripe/coupon_test.rb
158
+ - test/stripe/credit_note_test.rb
159
+ - test/stripe/customer_balance_transaction_test.rb
173
160
  - test/stripe/customer_card_test.rb
174
- - test/stripe/customer_sources_operations_test.rb
175
161
  - test/stripe/customer_test.rb
176
162
  - test/stripe/dispute_test.rb
177
163
  - test/stripe/ephemeral_key_test.rb
@@ -179,11 +165,9 @@ files:
179
165
  - test/stripe/exchange_rate_test.rb
180
166
  - test/stripe/file_link_test.rb
181
167
  - test/stripe/file_test.rb
182
- - test/stripe/file_upload_test.rb
183
168
  - test/stripe/invoice_item_test.rb
184
169
  - test/stripe/invoice_line_item_test.rb
185
170
  - test/stripe/invoice_test.rb
186
- - test/stripe/issuer_fraud_record_test.rb
187
171
  - test/stripe/issuing/authorization_test.rb
188
172
  - test/stripe/issuing/card_test.rb
189
173
  - test/stripe/issuing/cardholder_test.rb
@@ -191,6 +175,7 @@ files:
191
175
  - test/stripe/issuing/transaction_test.rb
192
176
  - test/stripe/list_object_test.rb
193
177
  - test/stripe/login_link_test.rb
178
+ - test/stripe/multipart_encoder_test.rb
194
179
  - test/stripe/oauth_test.rb
195
180
  - test/stripe/order_return_test.rb
196
181
  - test/stripe/order_test.rb
@@ -200,6 +185,7 @@ files:
200
185
  - test/stripe/person_test.rb
201
186
  - test/stripe/plan_test.rb
202
187
  - test/stripe/product_test.rb
188
+ - test/stripe/radar/early_fraud_warning_test.rb
203
189
  - test/stripe/radar/value_list_item_test.rb
204
190
  - test/stripe/radar/value_list_test.rb
205
191
  - test/stripe/recipient_test.rb
@@ -208,6 +194,7 @@ files:
208
194
  - test/stripe/reporting/report_type_test.rb
209
195
  - test/stripe/reversal_test.rb
210
196
  - test/stripe/review_test.rb
197
+ - test/stripe/setup_intent_test.rb
211
198
  - test/stripe/sigma/scheduled_query_run_test.rb
212
199
  - test/stripe/sku_test.rb
213
200
  - test/stripe/source_test.rb
@@ -216,19 +203,17 @@ files:
216
203
  - test/stripe/stripe_object_test.rb
217
204
  - test/stripe/stripe_response_test.rb
218
205
  - test/stripe/subscription_item_test.rb
219
- - test/stripe/subscription_schedule_revision_test.rb
220
- - test/stripe/subscription_schedule_revisions_operations_test.rb
221
206
  - test/stripe/subscription_schedule_test.rb
222
207
  - test/stripe/subscription_test.rb
208
+ - test/stripe/tax_id_test.rb
209
+ - test/stripe/tax_rate_test.rb
223
210
  - test/stripe/terminal/connection_token_test.rb
224
211
  - test/stripe/terminal/location_test.rb
225
212
  - test/stripe/terminal/reader_test.rb
226
213
  - test/stripe/three_d_secure_test.rb
227
214
  - test/stripe/topup_test.rb
228
- - test/stripe/transfer_reversals_operations_test.rb
229
215
  - test/stripe/transfer_test.rb
230
216
  - test/stripe/usage_record_summary_test.rb
231
- - test/stripe/usage_record_test.rb
232
217
  - test/stripe/util_test.rb
233
218
  - test/stripe/webhook_endpoint_test.rb
234
219
  - test/stripe/webhook_test.rb
@@ -239,7 +224,13 @@ files:
239
224
  homepage: https://stripe.com/docs/api/ruby
240
225
  licenses:
241
226
  - MIT
242
- metadata: {}
227
+ metadata:
228
+ bug_tracker_uri: https://github.com/stripe/stripe-ruby/issues
229
+ changelog_uri: https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md
230
+ documentation_uri: https://stripe.com/docs/api/ruby
231
+ github_repo: ssh://github.com/stripe/stripe-ruby
232
+ homepage_uri: https://stripe.com/docs/api/ruby
233
+ source_code_uri: https://github.com/stripe/stripe-ruby
243
234
  post_install_message:
244
235
  rdoc_options: []
245
236
  require_paths:
@@ -248,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
248
239
  requirements:
249
240
  - - ">="
250
241
  - !ruby/object:Gem::Version
251
- version: 2.1.0
242
+ version: 2.3.0
252
243
  required_rubygems_version: !ruby/object:Gem::Requirement
253
244
  requirements:
254
245
  - - ">="
@@ -262,26 +253,26 @@ summary: Ruby bindings for the Stripe API
262
253
  test_files:
263
254
  - test/api_stub_helpers.rb
264
255
  - test/openapi/README.md
265
- - test/stripe/account_external_accounts_operations_test.rb
266
256
  - test/stripe/account_link_test.rb
267
- - test/stripe/account_login_links_operations_test.rb
268
- - test/stripe/account_persons_operations_test.rb
269
257
  - test/stripe/account_test.rb
270
258
  - test/stripe/alipay_account_test.rb
271
259
  - test/stripe/api_operations_test.rb
272
260
  - test/stripe/api_resource_test.rb
273
261
  - test/stripe/apple_pay_domain_test.rb
274
262
  - test/stripe/application_fee_refund_test.rb
275
- - test/stripe/application_fee_refunds_operations_test.rb
276
263
  - test/stripe/application_fee_test.rb
277
264
  - test/stripe/balance_test.rb
265
+ - test/stripe/balance_transaction_test.rb
278
266
  - test/stripe/bank_account_test.rb
267
+ - test/stripe/capability_test.rb
279
268
  - test/stripe/charge_test.rb
280
269
  - test/stripe/checkout/session_test.rb
270
+ - test/stripe/connection_manager_test.rb
281
271
  - test/stripe/country_spec_test.rb
282
272
  - test/stripe/coupon_test.rb
273
+ - test/stripe/credit_note_test.rb
274
+ - test/stripe/customer_balance_transaction_test.rb
283
275
  - test/stripe/customer_card_test.rb
284
- - test/stripe/customer_sources_operations_test.rb
285
276
  - test/stripe/customer_test.rb
286
277
  - test/stripe/dispute_test.rb
287
278
  - test/stripe/ephemeral_key_test.rb
@@ -289,11 +280,9 @@ test_files:
289
280
  - test/stripe/exchange_rate_test.rb
290
281
  - test/stripe/file_link_test.rb
291
282
  - test/stripe/file_test.rb
292
- - test/stripe/file_upload_test.rb
293
283
  - test/stripe/invoice_item_test.rb
294
284
  - test/stripe/invoice_line_item_test.rb
295
285
  - test/stripe/invoice_test.rb
296
- - test/stripe/issuer_fraud_record_test.rb
297
286
  - test/stripe/issuing/authorization_test.rb
298
287
  - test/stripe/issuing/card_test.rb
299
288
  - test/stripe/issuing/cardholder_test.rb
@@ -301,6 +290,7 @@ test_files:
301
290
  - test/stripe/issuing/transaction_test.rb
302
291
  - test/stripe/list_object_test.rb
303
292
  - test/stripe/login_link_test.rb
293
+ - test/stripe/multipart_encoder_test.rb
304
294
  - test/stripe/oauth_test.rb
305
295
  - test/stripe/order_return_test.rb
306
296
  - test/stripe/order_test.rb
@@ -310,6 +300,7 @@ test_files:
310
300
  - test/stripe/person_test.rb
311
301
  - test/stripe/plan_test.rb
312
302
  - test/stripe/product_test.rb
303
+ - test/stripe/radar/early_fraud_warning_test.rb
313
304
  - test/stripe/radar/value_list_item_test.rb
314
305
  - test/stripe/radar/value_list_test.rb
315
306
  - test/stripe/recipient_test.rb
@@ -318,6 +309,7 @@ test_files:
318
309
  - test/stripe/reporting/report_type_test.rb
319
310
  - test/stripe/reversal_test.rb
320
311
  - test/stripe/review_test.rb
312
+ - test/stripe/setup_intent_test.rb
321
313
  - test/stripe/sigma/scheduled_query_run_test.rb
322
314
  - test/stripe/sku_test.rb
323
315
  - test/stripe/source_test.rb
@@ -326,19 +318,17 @@ test_files:
326
318
  - test/stripe/stripe_object_test.rb
327
319
  - test/stripe/stripe_response_test.rb
328
320
  - test/stripe/subscription_item_test.rb
329
- - test/stripe/subscription_schedule_revision_test.rb
330
- - test/stripe/subscription_schedule_revisions_operations_test.rb
331
321
  - test/stripe/subscription_schedule_test.rb
332
322
  - test/stripe/subscription_test.rb
323
+ - test/stripe/tax_id_test.rb
324
+ - test/stripe/tax_rate_test.rb
333
325
  - test/stripe/terminal/connection_token_test.rb
334
326
  - test/stripe/terminal/location_test.rb
335
327
  - test/stripe/terminal/reader_test.rb
336
328
  - test/stripe/three_d_secure_test.rb
337
329
  - test/stripe/topup_test.rb
338
- - test/stripe/transfer_reversals_operations_test.rb
339
330
  - test/stripe/transfer_test.rb
340
331
  - test/stripe/usage_record_summary_test.rb
341
- - test/stripe/usage_record_test.rb
342
332
  - test/stripe/util_test.rb
343
333
  - test/stripe/webhook_endpoint_test.rb
344
334
  - test/stripe/webhook_test.rb
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stripe
4
- class AlipayAccount < APIResource
5
- include Stripe::APIOperations::Save
6
- include Stripe::APIOperations::Delete
7
-
8
- OBJECT_NAME = "alipay_account".freeze
9
-
10
- def resource_url
11
- if !respond_to?(:customer) || customer.nil?
12
- raise NotImplementedError,
13
- "Alipay accounts cannot be accessed without a customer ID."
14
- end
15
-
16
- "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
17
- end
18
-
19
- def self.update(_id, _params = nil, _opts = nil)
20
- raise NotImplementedError, "Alipay accounts cannot be updated without a customer ID. Update an Alipay account by `a = customer.sources.retrieve('alipay_account_id'); a.save`"
21
- end
22
-
23
- def self.retrieve(_id, _opts = nil)
24
- raise NotImplementedError, "Alipay accounts cannot be retrieved without a customer ID. Retrieve an Alipay account using customer.sources.retrieve('alipay_account_id')"
25
- end
26
- end
27
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stripe
4
- class ApplicationFee < APIResource
5
- extend Stripe::APIOperations::List
6
- extend Stripe::APIOperations::NestedResource
7
-
8
- OBJECT_NAME = "application_fee".freeze
9
-
10
- nested_resource_class_methods :refund, operations: %i[create retrieve update list]
11
-
12
- # If you don't need access to an updated fee object after the refund, it's
13
- # more performant to just call `fee.refunds.create` directly.
14
- def refund(params = {}, opts = {})
15
- refunds.create(params, opts)
16
-
17
- # now that a refund has been created, we expect the state of this object
18
- # to change as well (i.e. `refunded` will now be `true`) so refresh it
19
- # from the server
20
- refresh
21
- end
22
- end
23
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stripe
4
- class ApplicationFeeRefund < APIResource
5
- include Stripe::APIOperations::Save
6
- extend Stripe::APIOperations::List
7
-
8
- OBJECT_NAME = "fee_refund".freeze
9
-
10
- def resource_url
11
- "#{ApplicationFee.resource_url}/#{CGI.escape(fee)}/refunds/#{CGI.escape(id)}"
12
- end
13
-
14
- def self.update(_id, _params = nil, _opts = nil)
15
- raise NotImplementedError, "Refunds cannot be updated without an application fee ID. Update a refund by using `a = appfee.refunds.retrieve('refund_id'); a.save`"
16
- end
17
-
18
- def self.retrieve(_id, _api_key = nil)
19
- raise NotImplementedError, "Refunds cannot be retrieved without an application fee ID. Retrieve a refund using appfee.refunds.retrieve('refund_id')"
20
- end
21
- end
22
- end