bongloy 4.21.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +76 -0
  3. data/.editorconfig +10 -0
  4. data/.gitattributes +4 -0
  5. data/.github/ISSUE_TEMPLATE.md +5 -0
  6. data/.github/README.md +79 -0
  7. data/.github/pull.yml +5 -0
  8. data/.gitignore +8 -0
  9. data/.rubocop.yml +43 -0
  10. data/.rubocop_todo.yml +38 -0
  11. data/.travis.yml +43 -0
  12. data/.vscode/extensions.json +7 -0
  13. data/.vscode/settings.json +8 -0
  14. data/CHANGELOG.md +770 -0
  15. data/CONTRIBUTORS +3 -0
  16. data/Gemfile +39 -0
  17. data/History.txt +1 -0
  18. data/LICENSE +21 -0
  19. data/README.md +282 -0
  20. data/Rakefile +36 -0
  21. data/VERSION +1 -0
  22. data/bin/stripe-console +16 -0
  23. data/bongloy.gemspec +37 -0
  24. data/lib/bongloy.rb +7 -0
  25. data/lib/data/ca-certificates.crt +4043 -0
  26. data/lib/stripe.rb +208 -0
  27. data/lib/stripe/api_operations/create.rb +12 -0
  28. data/lib/stripe/api_operations/delete.rb +35 -0
  29. data/lib/stripe/api_operations/list.rb +30 -0
  30. data/lib/stripe/api_operations/nested_resource.rb +70 -0
  31. data/lib/stripe/api_operations/request.rb +53 -0
  32. data/lib/stripe/api_operations/save.rb +94 -0
  33. data/lib/stripe/api_resource.rb +107 -0
  34. data/lib/stripe/errors.rb +156 -0
  35. data/lib/stripe/list_object.rb +110 -0
  36. data/lib/stripe/oauth.rb +63 -0
  37. data/lib/stripe/object_types.rb +98 -0
  38. data/lib/stripe/resources.rb +79 -0
  39. data/lib/stripe/resources/account.rb +174 -0
  40. data/lib/stripe/resources/account_link.rb +9 -0
  41. data/lib/stripe/resources/alipay_account.rb +34 -0
  42. data/lib/stripe/resources/apple_pay_domain.rb +16 -0
  43. data/lib/stripe/resources/application_fee.rb +24 -0
  44. data/lib/stripe/resources/application_fee_refund.rb +30 -0
  45. data/lib/stripe/resources/balance.rb +7 -0
  46. data/lib/stripe/resources/balance_transaction.rb +13 -0
  47. data/lib/stripe/resources/bank_account.rb +42 -0
  48. data/lib/stripe/resources/bitcoin_receiver.rb +23 -0
  49. data/lib/stripe/resources/bitcoin_transaction.rb +15 -0
  50. data/lib/stripe/resources/capability.rb +33 -0
  51. data/lib/stripe/resources/card.rb +37 -0
  52. data/lib/stripe/resources/charge.rb +84 -0
  53. data/lib/stripe/resources/checkout/session.rb +11 -0
  54. data/lib/stripe/resources/country_spec.rb +9 -0
  55. data/lib/stripe/resources/coupon.rb +12 -0
  56. data/lib/stripe/resources/credit_note.rb +18 -0
  57. data/lib/stripe/resources/customer.rb +95 -0
  58. data/lib/stripe/resources/customer_balance_transaction.rb +30 -0
  59. data/lib/stripe/resources/discount.rb +7 -0
  60. data/lib/stripe/resources/dispute.rb +23 -0
  61. data/lib/stripe/resources/ephemeral_key.rb +19 -0
  62. data/lib/stripe/resources/event.rb +9 -0
  63. data/lib/stripe/resources/exchange_rate.rb +9 -0
  64. data/lib/stripe/resources/file.rb +44 -0
  65. data/lib/stripe/resources/file_link.rb +11 -0
  66. data/lib/stripe/resources/invoice.rb +48 -0
  67. data/lib/stripe/resources/invoice_item.rb +12 -0
  68. data/lib/stripe/resources/invoice_line_item.rb +7 -0
  69. data/lib/stripe/resources/issuer_fraud_record.rb +9 -0
  70. data/lib/stripe/resources/issuing/authorization.rb +25 -0
  71. data/lib/stripe/resources/issuing/card.rb +20 -0
  72. data/lib/stripe/resources/issuing/card_details.rb +9 -0
  73. data/lib/stripe/resources/issuing/cardholder.rb +13 -0
  74. data/lib/stripe/resources/issuing/dispute.rb +13 -0
  75. data/lib/stripe/resources/issuing/transaction.rb +12 -0
  76. data/lib/stripe/resources/login_link.rb +14 -0
  77. data/lib/stripe/resources/order.rb +32 -0
  78. data/lib/stripe/resources/order_return.rb +9 -0
  79. data/lib/stripe/resources/payment_intent.rb +30 -0
  80. data/lib/stripe/resources/payment_method.rb +24 -0
  81. data/lib/stripe/resources/payout.rb +24 -0
  82. data/lib/stripe/resources/person.rb +31 -0
  83. data/lib/stripe/resources/plan.rb +12 -0
  84. data/lib/stripe/resources/product.rb +12 -0
  85. data/lib/stripe/resources/radar/early_fraud_warning.rb +11 -0
  86. data/lib/stripe/resources/radar/value_list.rb +14 -0
  87. data/lib/stripe/resources/radar/value_list_item.rb +13 -0
  88. data/lib/stripe/resources/recipient.rb +17 -0
  89. data/lib/stripe/resources/recipient_transfer.rb +7 -0
  90. data/lib/stripe/resources/refund.rb +11 -0
  91. data/lib/stripe/resources/reporting/report_run.rb +12 -0
  92. data/lib/stripe/resources/reporting/report_type.rb +12 -0
  93. data/lib/stripe/resources/reversal.rb +29 -0
  94. data/lib/stripe/resources/review.rb +16 -0
  95. data/lib/stripe/resources/setup_intent.rb +24 -0
  96. data/lib/stripe/resources/sigma/scheduled_query_run.rb +15 -0
  97. data/lib/stripe/resources/sku.rb +12 -0
  98. data/lib/stripe/resources/source.rb +42 -0
  99. data/lib/stripe/resources/source_transaction.rb +7 -0
  100. data/lib/stripe/resources/subscription.rb +25 -0
  101. data/lib/stripe/resources/subscription_item.rb +17 -0
  102. data/lib/stripe/resources/subscription_schedule.rb +32 -0
  103. data/lib/stripe/resources/subscription_schedule_revision.rb +34 -0
  104. data/lib/stripe/resources/tax_id.rb +26 -0
  105. data/lib/stripe/resources/tax_rate.rb +11 -0
  106. data/lib/stripe/resources/terminal/connection_token.rb +11 -0
  107. data/lib/stripe/resources/terminal/location.rb +14 -0
  108. data/lib/stripe/resources/terminal/reader.rb +14 -0
  109. data/lib/stripe/resources/three_d_secure.rb +13 -0
  110. data/lib/stripe/resources/token.rb +9 -0
  111. data/lib/stripe/resources/topup.rb +18 -0
  112. data/lib/stripe/resources/transfer.rb +27 -0
  113. data/lib/stripe/resources/usage_record.rb +23 -0
  114. data/lib/stripe/resources/usage_record_summary.rb +7 -0
  115. data/lib/stripe/resources/webhook_endpoint.rb +12 -0
  116. data/lib/stripe/singleton_api_resource.rb +26 -0
  117. data/lib/stripe/stripe_client.rb +686 -0
  118. data/lib/stripe/stripe_object.rb +583 -0
  119. data/lib/stripe/stripe_response.rb +50 -0
  120. data/lib/stripe/util.rb +336 -0
  121. data/lib/stripe/version.rb +5 -0
  122. data/lib/stripe/webhook.rb +90 -0
  123. data/stripe.gemspec +37 -0
  124. data/test/api_stub_helpers.rb +1 -0
  125. data/test/openapi/README.md +9 -0
  126. data/test/stripe/account_link_test.rb +18 -0
  127. data/test/stripe/account_test.rb +428 -0
  128. data/test/stripe/alipay_account_test.rb +37 -0
  129. data/test/stripe/api_operations_test.rb +80 -0
  130. data/test/stripe/api_resource_test.rb +544 -0
  131. data/test/stripe/apple_pay_domain_test.rb +46 -0
  132. data/test/stripe/application_fee_refund_test.rb +37 -0
  133. data/test/stripe/application_fee_test.rb +58 -0
  134. data/test/stripe/balance_test.rb +13 -0
  135. data/test/stripe/bank_account_test.rb +36 -0
  136. data/test/stripe/capability_test.rb +45 -0
  137. data/test/stripe/charge_test.rb +80 -0
  138. data/test/stripe/checkout/session_test.rb +41 -0
  139. data/test/stripe/country_spec_test.rb +20 -0
  140. data/test/stripe/coupon_test.rb +61 -0
  141. data/test/stripe/credit_note_test.rb +61 -0
  142. data/test/stripe/customer_balance_transaction_test.rb +37 -0
  143. data/test/stripe/customer_card_test.rb +42 -0
  144. data/test/stripe/customer_test.rb +269 -0
  145. data/test/stripe/dispute_test.rb +51 -0
  146. data/test/stripe/ephemeral_key_test.rb +93 -0
  147. data/test/stripe/errors_test.rb +20 -0
  148. data/test/stripe/exchange_rate_test.rb +20 -0
  149. data/test/stripe/file_link_test.rb +41 -0
  150. data/test/stripe/file_test.rb +97 -0
  151. data/test/stripe/file_upload_test.rb +79 -0
  152. data/test/stripe/invoice_item_test.rb +66 -0
  153. data/test/stripe/invoice_line_item_test.rb +8 -0
  154. data/test/stripe/invoice_test.rb +213 -0
  155. data/test/stripe/issuer_fraud_record_test.rb +20 -0
  156. data/test/stripe/issuing/authorization_test.rb +72 -0
  157. data/test/stripe/issuing/card_test.rb +62 -0
  158. data/test/stripe/issuing/cardholder_test.rb +53 -0
  159. data/test/stripe/issuing/dispute_test.rb +45 -0
  160. data/test/stripe/issuing/transaction_test.rb +48 -0
  161. data/test/stripe/list_object_test.rb +156 -0
  162. data/test/stripe/login_link_test.rb +37 -0
  163. data/test/stripe/oauth_test.rb +88 -0
  164. data/test/stripe/order_return_test.rb +21 -0
  165. data/test/stripe/order_test.rb +82 -0
  166. data/test/stripe/payment_intent_test.rb +107 -0
  167. data/test/stripe/payment_method_test.rb +84 -0
  168. data/test/stripe/payout_test.rb +57 -0
  169. data/test/stripe/person_test.rb +46 -0
  170. data/test/stripe/plan_test.rb +98 -0
  171. data/test/stripe/product_test.rb +59 -0
  172. data/test/stripe/radar/early_fraud_warning_test.rb +22 -0
  173. data/test/stripe/radar/value_list_item_test.rb +48 -0
  174. data/test/stripe/radar/value_list_test.rb +61 -0
  175. data/test/stripe/recipient_test.rb +62 -0
  176. data/test/stripe/refund_test.rb +39 -0
  177. data/test/stripe/reporting/report_run_test.rb +33 -0
  178. data/test/stripe/reporting/report_type_test.rb +22 -0
  179. data/test/stripe/reversal_test.rb +43 -0
  180. data/test/stripe/review_test.rb +27 -0
  181. data/test/stripe/setup_intent_test.rb +84 -0
  182. data/test/stripe/sigma/scheduled_query_run_test.rb +22 -0
  183. data/test/stripe/sku_test.rb +60 -0
  184. data/test/stripe/source_test.rb +99 -0
  185. data/test/stripe/source_transaction_test.rb +19 -0
  186. data/test/stripe/stripe_client_test.rb +842 -0
  187. data/test/stripe/stripe_object_test.rb +525 -0
  188. data/test/stripe/stripe_response_test.rb +49 -0
  189. data/test/stripe/subscription_item_test.rb +63 -0
  190. data/test/stripe/subscription_schedule_revision_test.rb +37 -0
  191. data/test/stripe/subscription_schedule_test.rb +116 -0
  192. data/test/stripe/subscription_test.rb +80 -0
  193. data/test/stripe/tax_id_test.rb +31 -0
  194. data/test/stripe/tax_rate_test.rb +43 -0
  195. data/test/stripe/terminal/connection_token_test.rb +16 -0
  196. data/test/stripe/terminal/location_test.rb +68 -0
  197. data/test/stripe/terminal/reader_test.rb +62 -0
  198. data/test/stripe/three_d_secure_test.rb +23 -0
  199. data/test/stripe/topup_test.rb +62 -0
  200. data/test/stripe/transfer_test.rb +88 -0
  201. data/test/stripe/usage_record_summary_test.rb +19 -0
  202. data/test/stripe/usage_record_test.rb +28 -0
  203. data/test/stripe/util_test.rb +402 -0
  204. data/test/stripe/webhook_endpoint_test.rb +59 -0
  205. data/test/stripe/webhook_test.rb +96 -0
  206. data/test/stripe_mock.rb +77 -0
  207. data/test/stripe_test.rb +63 -0
  208. data/test/test_data.rb +61 -0
  209. data/test/test_helper.rb +71 -0
  210. metadata +372 -0
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class FileLink < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "file_link".freeze
10
+ end
11
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class Invoice < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ include Stripe::APIOperations::Delete
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "invoice".freeze
11
+
12
+ custom_method :finalize_invoice, http_verb: :post, http_path: "finalize"
13
+ custom_method :mark_uncollectible, http_verb: :post
14
+ custom_method :pay, http_verb: :post
15
+ custom_method :send_invoice, http_verb: :post, http_path: "send"
16
+ custom_method :void_invoice, http_verb: :post, http_path: "void"
17
+
18
+ def finalize_invoice(params = {}, opts = {})
19
+ resp, opts = request(:post, resource_url + "/finalize", params, opts)
20
+ initialize_from(resp.data, opts)
21
+ end
22
+
23
+ def mark_uncollectible(params = {}, opts = {})
24
+ resp, opts = request(:post, resource_url + "/mark_uncollectible", params, opts)
25
+ initialize_from(resp.data, opts)
26
+ end
27
+
28
+ def pay(params = {}, opts = {})
29
+ resp, opts = request(:post, resource_url + "/pay", params, opts)
30
+ initialize_from(resp.data, opts)
31
+ end
32
+
33
+ def send_invoice(params = {}, opts = {})
34
+ resp, opts = request(:post, resource_url + "/send", params, opts)
35
+ initialize_from(resp.data, opts)
36
+ end
37
+
38
+ def void_invoice(params = {}, opts = {})
39
+ resp, opts = request(:post, resource_url + "/void", params, opts)
40
+ initialize_from(resp.data, opts)
41
+ end
42
+
43
+ def self.upcoming(params, opts = {})
44
+ resp, opts = request(:get, resource_url + "/upcoming", params, opts)
45
+ Util.convert_to_stripe_object(resp.data, opts)
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class InvoiceItem < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ include Stripe::APIOperations::Delete
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "invoiceitem".freeze
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class InvoiceLineItem < StripeObject
5
+ OBJECT_NAME = "line_item".freeze
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class IssuerFraudRecord < APIResource
5
+ extend Stripe::APIOperations::List
6
+
7
+ OBJECT_NAME = "issuer_fraud_record".freeze
8
+ end
9
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Issuing
5
+ class Authorization < APIResource
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "issuing.authorization".freeze
10
+
11
+ custom_method :approve, http_verb: :post
12
+ custom_method :decline, http_verb: :post
13
+
14
+ def approve(params = {}, opts = {})
15
+ resp, opts = request(:post, resource_url + "/approve", params, opts)
16
+ initialize_from(resp.data, opts)
17
+ end
18
+
19
+ def decline(params = {}, opts = {})
20
+ resp, opts = request(:post, resource_url + "/decline", params, opts)
21
+ initialize_from(resp.data, opts)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Issuing
5
+ class Card < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "issuing.card".freeze
11
+
12
+ custom_method :details, http_verb: :get
13
+
14
+ def details(params = {}, opts = {})
15
+ resp, opts = request(:get, resource_url + "/details", params, opts)
16
+ Util.convert_to_stripe_object(resp.data, opts)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Issuing
5
+ class CardDetails < Stripe::StripeObject
6
+ OBJECT_NAME = "issuing.card_details".freeze
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Issuing
5
+ class Cardholder < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "issuing.cardholder".freeze
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Issuing
5
+ class Dispute < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "issuing.dispute".freeze
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Issuing
5
+ class Transaction < APIResource
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "issuing.transaction".freeze
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class LoginLink < APIResource
5
+ OBJECT_NAME = "login_link".freeze
6
+
7
+ def self.retrieve(_id, _opts = nil)
8
+ raise NotImplementedError,
9
+ "Login links do not have IDs and cannot be retrieved. They can " \
10
+ "only be created using `Account.create_login_link('account_id', " \
11
+ "create_params)`"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class Order < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "order".freeze
10
+
11
+ custom_method :pay, http_verb: :post
12
+ custom_method :return_order, http_verb: :post, http_path: "returns"
13
+
14
+ def pay(params = {}, opts = {})
15
+ resp, opts = request(:post, resource_url + "/pay", params, opts)
16
+ Util.convert_to_stripe_object(resp.data, opts)
17
+ end
18
+
19
+ def return_order(params = {}, opts = {})
20
+ resp, opts = request(:post, resource_url + "/returns", params, opts)
21
+ Util.convert_to_stripe_object(resp.data, opts)
22
+ end
23
+
24
+ private def pay_url
25
+ resource_url + "/pay"
26
+ end
27
+
28
+ private def returns_url
29
+ resource_url + "/returns"
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class OrderReturn < APIResource
5
+ extend Stripe::APIOperations::List
6
+
7
+ OBJECT_NAME = "order_return".freeze
8
+ end
9
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class PaymentIntent < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "payment_intent".freeze
10
+
11
+ custom_method :cancel, http_verb: :post
12
+ custom_method :capture, http_verb: :post
13
+ custom_method :confirm, http_verb: :post
14
+
15
+ def cancel(params = {}, opts = {})
16
+ resp, opts = request(:post, resource_url + "/cancel", params, opts)
17
+ initialize_from(resp.data, opts)
18
+ end
19
+
20
+ def capture(params = {}, opts = {})
21
+ resp, opts = request(:post, resource_url + "/capture", params, opts)
22
+ initialize_from(resp.data, opts)
23
+ end
24
+
25
+ def confirm(params = {}, opts = {})
26
+ resp, opts = request(:post, resource_url + "/confirm", params, opts)
27
+ initialize_from(resp.data, opts)
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class PaymentMethod < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "payment_method".freeze
10
+
11
+ custom_method :attach, http_verb: :post
12
+ custom_method :detach, http_verb: :post
13
+
14
+ def attach(params = {}, opts = {})
15
+ resp, opts = request(:post, resource_url + "/attach", params, opts)
16
+ initialize_from(resp.data, opts)
17
+ end
18
+
19
+ def detach(params = {}, opts = {})
20
+ resp, opts = request(:post, resource_url + "/detach", params, opts)
21
+ initialize_from(resp.data, opts)
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class Payout < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "payout".freeze
10
+
11
+ custom_method :cancel, http_verb: :post
12
+
13
+ def cancel(params = {}, opts = {})
14
+ resp, opts = request(:post, resource_url + "/cancel", params, opts)
15
+ initialize_from(resp.data, opts)
16
+ end
17
+
18
+ def cancel_url
19
+ resource_url + "/cancel"
20
+ end
21
+ extend Gem::Deprecate
22
+ deprecate :cancel_url, :none, 2019, 11
23
+ end
24
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class Person < APIResource
5
+ extend Stripe::APIOperations::List
6
+ include Stripe::APIOperations::Save
7
+
8
+ OBJECT_NAME = "person".freeze
9
+
10
+ def resource_url
11
+ if !respond_to?(:account) || account.nil?
12
+ raise NotImplementedError,
13
+ "Persons cannot be accessed without an account ID."
14
+ end
15
+ "#{Account.resource_url}/#{CGI.escape(account)}/persons/#{CGI.escape(id)}"
16
+ end
17
+
18
+ def self.retrieve(_id, _opts = {})
19
+ raise NotImplementedError,
20
+ "Persons cannot be retrieved without an account ID. Retrieve a " \
21
+ "person using `Account.retrieve_person('account_id', 'person_id')`"
22
+ end
23
+
24
+ def self.update(_id, _params = nil, _opts = nil)
25
+ raise NotImplementedError,
26
+ "Persons cannot be updated without an account ID. Update a " \
27
+ "person using `Account.update_person('account_id', 'person_id', " \
28
+ "update_params)`"
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class Plan < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ include Stripe::APIOperations::Delete
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "plan".freeze
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class Product < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ include Stripe::APIOperations::Delete
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "product".freeze
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Radar
5
+ class EarlyFraudWarning < APIResource
6
+ extend Stripe::APIOperations::List
7
+
8
+ OBJECT_NAME = "radar.early_fraud_warning".freeze
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Radar
5
+ class ValueList < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ include Stripe::APIOperations::Delete
8
+ extend Stripe::APIOperations::List
9
+ include Stripe::APIOperations::Save
10
+
11
+ OBJECT_NAME = "radar.value_list".freeze
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ module Radar
5
+ class ValueListItem < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ include Stripe::APIOperations::Delete
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "radar.value_list_item".freeze
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ # Recipients objects are deprecated. Please use Stripe Connect instead.
5
+ class Recipient < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ include Stripe::APIOperations::Delete
8
+ extend Stripe::APIOperations::List
9
+ include Stripe::APIOperations::Save
10
+
11
+ OBJECT_NAME = "recipient".freeze
12
+
13
+ def transfers
14
+ Transfer.all({ recipient: id }, @api_key)
15
+ end
16
+ end
17
+ end