stripe 13.2.0 → 13.3.0.pre.beta.2

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/CHANGELOG.md +1396 -645
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/object_types.rb +32 -0
  6. data/lib/stripe/request_signing_authenticator.rb +79 -0
  7. data/lib/stripe/resources/account.rb +230 -0
  8. data/lib/stripe/resources/account_link.rb +9 -0
  9. data/lib/stripe/resources/account_notice.rb +60 -0
  10. data/lib/stripe/resources/account_session.rb +103 -0
  11. data/lib/stripe/resources/apple_pay_domain.rb +13 -0
  12. data/lib/stripe/resources/application.rb +20 -0
  13. data/lib/stripe/resources/application_fee.rb +34 -0
  14. data/lib/stripe/resources/application_fee_refund.rb +17 -0
  15. data/lib/stripe/resources/apps/secret.rb +22 -0
  16. data/lib/stripe/resources/balance.rb +59 -0
  17. data/lib/stripe/resources/balance_transaction.rb +34 -0
  18. data/lib/stripe/resources/bank_account.rb +60 -2
  19. data/lib/stripe/resources/billing/alert.rb +21 -0
  20. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  21. data/lib/stripe/resources/billing/credit_balance_summary.rb +25 -0
  22. data/lib/stripe/resources/billing/credit_balance_transaction.rb +45 -1
  23. data/lib/stripe/resources/billing/credit_grant.rb +46 -2
  24. data/lib/stripe/resources/billing/meter.rb +49 -7
  25. data/lib/stripe/resources/billing/meter_error_report.rb +44 -0
  26. data/lib/stripe/resources/billing/meter_event.rb +17 -3
  27. data/lib/stripe/resources/billing/meter_event_adjustment.rb +17 -1
  28. data/lib/stripe/resources/billing/meter_event_summary.rb +15 -0
  29. data/lib/stripe/resources/billing_portal/configuration.rb +70 -0
  30. data/lib/stripe/resources/billing_portal/session.rb +61 -0
  31. data/lib/stripe/resources/capability.rb +38 -0
  32. data/lib/stripe/resources/capital/financing_offer.rb +94 -0
  33. data/lib/stripe/resources/capital/financing_summary.rb +32 -0
  34. data/lib/stripe/resources/capital/financing_transaction.rb +56 -0
  35. data/lib/stripe/resources/card.rb +72 -0
  36. data/lib/stripe/resources/cash_balance.rb +14 -0
  37. data/lib/stripe/resources/charge.rb +469 -0
  38. data/lib/stripe/resources/checkout/session.rb +496 -0
  39. data/lib/stripe/resources/climate/order.rb +55 -0
  40. data/lib/stripe/resources/climate/product.rb +24 -0
  41. data/lib/stripe/resources/climate/supplier.rb +18 -0
  42. data/lib/stripe/resources/confirmation_token.rb +297 -0
  43. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  44. data/lib/stripe/resources/country_spec.rb +27 -0
  45. data/lib/stripe/resources/coupon.rb +44 -0
  46. data/lib/stripe/resources/credit_note.rb +91 -0
  47. data/lib/stripe/resources/credit_note_line_item.rb +46 -0
  48. data/lib/stripe/resources/customer.rb +93 -0
  49. data/lib/stripe/resources/customer_balance_transaction.rb +27 -0
  50. data/lib/stripe/resources/customer_cash_balance_transaction.rb +72 -0
  51. data/lib/stripe/resources/customer_session.rb +34 -0
  52. data/lib/stripe/resources/discount.rb +29 -0
  53. data/lib/stripe/resources/dispute.rb +88 -0
  54. data/lib/stripe/resources/entitlements/active_entitlement.rb +11 -0
  55. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  56. data/lib/stripe/resources/entitlements/feature.rb +15 -0
  57. data/lib/stripe/resources/ephemeral_key.rb +13 -0
  58. data/lib/stripe/resources/event.rb +44 -0
  59. data/lib/stripe/resources/exchange_rate.rb +7 -0
  60. data/lib/stripe/resources/file.rb +23 -0
  61. data/lib/stripe/resources/file_link.rb +19 -0
  62. data/lib/stripe/resources/financial_connections/account.rb +87 -0
  63. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  64. data/lib/stripe/resources/financial_connections/account_owner.rb +17 -0
  65. data/lib/stripe/resources/financial_connections/account_ownership.rb +9 -0
  66. data/lib/stripe/resources/financial_connections/institution.rb +61 -0
  67. data/lib/stripe/resources/financial_connections/session.rb +49 -0
  68. data/lib/stripe/resources/financial_connections/transaction.rb +28 -0
  69. data/lib/stripe/resources/forwarding/request.rb +40 -0
  70. data/lib/stripe/resources/funding_instructions.rb +82 -0
  71. data/lib/stripe/resources/gift_cards/card.rb +96 -0
  72. data/lib/stripe/resources/gift_cards/transaction.rb +132 -0
  73. data/lib/stripe/resources/identity/verification_report.rb +92 -0
  74. data/lib/stripe/resources/identity/verification_session.rb +76 -0
  75. data/lib/stripe/resources/invoice.rb +418 -0
  76. data/lib/stripe/resources/invoice_item.rb +54 -0
  77. data/lib/stripe/resources/invoice_line_item.rb +83 -0
  78. data/lib/stripe/resources/invoice_payment.rb +46 -0
  79. data/lib/stripe/resources/invoice_rendering_template.rb +17 -0
  80. data/lib/stripe/resources/issuing/authorization.rb +129 -0
  81. data/lib/stripe/resources/issuing/card.rb +86 -0
  82. data/lib/stripe/resources/issuing/cardholder.rb +76 -0
  83. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +145 -0
  84. data/lib/stripe/resources/issuing/dispute.rb +65 -0
  85. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +49 -0
  86. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +43 -0
  87. data/lib/stripe/resources/issuing/personalization_design.rb +38 -0
  88. data/lib/stripe/resources/issuing/physical_bundle.rb +18 -0
  89. data/lib/stripe/resources/issuing/settlement.rb +49 -0
  90. data/lib/stripe/resources/issuing/token.rb +46 -0
  91. data/lib/stripe/resources/issuing/transaction.rb +106 -0
  92. data/lib/stripe/resources/line_item.rb +50 -0
  93. data/lib/stripe/resources/login_link.rb +7 -0
  94. data/lib/stripe/resources/mandate.rb +78 -0
  95. data/lib/stripe/resources/margin.rb +56 -0
  96. data/lib/stripe/resources/order.rb +322 -0
  97. data/lib/stripe/resources/payment_attempt_record.rb +100 -0
  98. data/lib/stripe/resources/payment_intent.rb +712 -0
  99. data/lib/stripe/resources/payment_link.rb +198 -0
  100. data/lib/stripe/resources/payment_method.rb +368 -0
  101. data/lib/stripe/resources/payment_method_configuration.rb +430 -0
  102. data/lib/stripe/resources/payment_method_domain.rb +57 -0
  103. data/lib/stripe/resources/payment_record.rb +194 -0
  104. data/lib/stripe/resources/payout.rb +56 -0
  105. data/lib/stripe/resources/person.rb +128 -0
  106. data/lib/stripe/resources/plan.rb +52 -0
  107. data/lib/stripe/resources/price.rb +77 -0
  108. data/lib/stripe/resources/product.rb +60 -0
  109. data/lib/stripe/resources/product_feature.rb +12 -0
  110. data/lib/stripe/resources/promotion_code.rb +35 -0
  111. data/lib/stripe/resources/quote.rb +356 -0
  112. data/lib/stripe/resources/quote_line.rb +136 -0
  113. data/lib/stripe/resources/quote_preview_invoice.rb +374 -0
  114. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +170 -0
  115. data/lib/stripe/resources/radar/early_fraud_warning.rb +17 -0
  116. data/lib/stripe/resources/radar/value_list.rb +23 -0
  117. data/lib/stripe/resources/radar/value_list_item.rb +17 -0
  118. data/lib/stripe/resources/refund.rb +130 -0
  119. data/lib/stripe/resources/reporting/report_run.rb +29 -0
  120. data/lib/stripe/resources/reporting/report_type.rb +19 -0
  121. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  122. data/lib/stripe/resources/reversal.rb +21 -0
  123. data/lib/stripe/resources/review.rb +36 -0
  124. data/lib/stripe/resources/setup_attempt.rb +101 -0
  125. data/lib/stripe/resources/setup_intent.rb +158 -0
  126. data/lib/stripe/resources/shipping_rate.rb +42 -0
  127. data/lib/stripe/resources/sigma/scheduled_query_run.rb +26 -0
  128. data/lib/stripe/resources/source.rb +195 -0
  129. data/lib/stripe/resources/source_mandate_notification.rb +59 -0
  130. data/lib/stripe/resources/source_transaction.rb +48 -0
  131. data/lib/stripe/resources/subscription.rb +214 -0
  132. data/lib/stripe/resources/subscription_item.rb +46 -0
  133. data/lib/stripe/resources/subscription_schedule.rb +173 -0
  134. data/lib/stripe/resources/tax/association.rb +60 -0
  135. data/lib/stripe/resources/tax/calculation.rb +72 -0
  136. data/lib/stripe/resources/tax/calculation_line_item.rb +33 -0
  137. data/lib/stripe/resources/tax/form.rb +124 -0
  138. data/lib/stripe/resources/tax/registration.rb +379 -0
  139. data/lib/stripe/resources/tax/settings.rb +33 -0
  140. data/lib/stripe/resources/tax/transaction.rb +68 -0
  141. data/lib/stripe/resources/tax/transaction_line_item.rb +30 -0
  142. data/lib/stripe/resources/tax_code.rb +9 -0
  143. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  144. data/lib/stripe/resources/tax_id.rb +30 -0
  145. data/lib/stripe/resources/tax_rate.rb +42 -0
  146. data/lib/stripe/resources/terminal/configuration.rb +107 -0
  147. data/lib/stripe/resources/terminal/connection_token.rb +7 -0
  148. data/lib/stripe/resources/terminal/location.rb +20 -0
  149. data/lib/stripe/resources/terminal/reader.rb +178 -0
  150. data/lib/stripe/resources/terminal/reader_collected_data.rb +30 -0
  151. data/lib/stripe/resources/test_helpers/test_clock.rb +27 -0
  152. data/lib/stripe/resources/token.rb +29 -0
  153. data/lib/stripe/resources/topup.rb +33 -0
  154. data/lib/stripe/resources/transfer.rb +35 -0
  155. data/lib/stripe/resources/treasury/credit_reversal.rb +32 -0
  156. data/lib/stripe/resources/treasury/debit_reversal.rb +38 -0
  157. data/lib/stripe/resources/treasury/financial_account.rb +57 -0
  158. data/lib/stripe/resources/treasury/financial_account_features.rb +91 -0
  159. data/lib/stripe/resources/treasury/inbound_transfer.rb +66 -0
  160. data/lib/stripe/resources/treasury/outbound_payment.rb +85 -0
  161. data/lib/stripe/resources/treasury/outbound_transfer.rb +82 -0
  162. data/lib/stripe/resources/treasury/received_credit.rb +70 -0
  163. data/lib/stripe/resources/treasury/received_debit.rb +67 -0
  164. data/lib/stripe/resources/treasury/transaction.rb +42 -0
  165. data/lib/stripe/resources/treasury/transaction_entry.rb +34 -0
  166. data/lib/stripe/resources/usage_record.rb +13 -0
  167. data/lib/stripe/resources/usage_record_summary.rb +18 -0
  168. data/lib/stripe/resources/v2/amount.rb +9 -0
  169. data/lib/stripe/resources/v2/billing/meter_event.rb +18 -0
  170. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +20 -0
  171. data/lib/stripe/resources/v2/billing/meter_event_session.rb +14 -0
  172. data/lib/stripe/resources/v2/event.rb +21 -0
  173. data/lib/stripe/resources/v2/event_destination.rb +49 -0
  174. data/lib/stripe/resources/webhook_endpoint.rb +27 -0
  175. data/lib/stripe/resources.rb +31 -0
  176. data/lib/stripe/services/account_notice_service.rb +39 -0
  177. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -1
  178. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +2 -2
  179. data/lib/stripe/services/billing/credit_grant_service.rb +3 -3
  180. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +1 -1
  181. data/lib/stripe/services/billing/meter_event_service.rb +1 -1
  182. data/lib/stripe/services/billing/meter_service.rb +5 -5
  183. data/lib/stripe/services/capital/financing_offer_service.rb +42 -0
  184. data/lib/stripe/services/capital/financing_summary_service.rb +19 -0
  185. data/lib/stripe/services/capital/financing_transaction_service.rb +31 -0
  186. data/lib/stripe/services/capital_service.rb +15 -0
  187. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +19 -0
  188. data/lib/stripe/services/financial_connections/account_service.rb +3 -1
  189. data/lib/stripe/services/financial_connections/institution_service.rb +30 -0
  190. data/lib/stripe/services/financial_connections_service.rb +2 -1
  191. data/lib/stripe/services/gift_cards/card_service.rb +63 -0
  192. data/lib/stripe/services/gift_cards/transaction_service.rb +74 -0
  193. data/lib/stripe/services/gift_cards_service.rb +14 -0
  194. data/lib/stripe/services/invoice_payment_service.rb +28 -0
  195. data/lib/stripe/services/invoice_service.rb +44 -1
  196. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +74 -0
  197. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +30 -0
  198. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +30 -0
  199. data/lib/stripe/services/issuing_service.rb +5 -1
  200. data/lib/stripe/services/margin_service.rb +50 -0
  201. data/lib/stripe/services/order_line_item_service.rb +17 -0
  202. data/lib/stripe/services/order_service.rb +78 -0
  203. data/lib/stripe/services/payment_attempt_record_service.rb +28 -0
  204. data/lib/stripe/services/payment_intent_service.rb +37 -0
  205. data/lib/stripe/services/payment_record_service.rb +78 -0
  206. data/lib/stripe/services/quote_line_service.rb +17 -0
  207. data/lib/stripe/services/quote_preview_invoice_service.rb +17 -0
  208. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +17 -0
  209. data/lib/stripe/services/quote_service.rb +49 -1
  210. data/lib/stripe/services/subscription_schedule_service.rb +11 -0
  211. data/lib/stripe/services/tax/association_service.rb +19 -0
  212. data/lib/stripe/services/tax/form_service.rb +37 -0
  213. data/lib/stripe/services/tax_service.rb +3 -1
  214. data/lib/stripe/services/terminal/reader_collected_data_service.rb +19 -0
  215. data/lib/stripe/services/terminal/reader_service.rb +33 -0
  216. data/lib/stripe/services/terminal_service.rb +2 -1
  217. data/lib/stripe/services/v1_services.rb +8 -1
  218. data/lib/stripe/services.rb +25 -0
  219. data/lib/stripe/stripe_configuration.rb +3 -1
  220. data/lib/stripe/stripe_object.rb +5 -0
  221. data/lib/stripe/util.rb +7 -1
  222. data/lib/stripe/version.rb +1 -1
  223. data/lib/stripe.rb +45 -0
  224. data/stripe.gemspec +2 -1
  225. metadata +62 -4
@@ -0,0 +1,43 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Issuing
6
+ # A fraud liability debit occurs when Stripe debits a platform's account for fraud losses on Issuing transactions.
7
+ class FraudLiabilityDebit < APIResource
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "issuing.fraud_liability_debit"
11
+ def self.object_name
12
+ "issuing.fraud_liability_debit"
13
+ end
14
+
15
+ # Debited amount. This is equal to the disputed amount and is given in the card’s currency and in the smallest currency unit.
16
+ attr_reader :amount
17
+ # ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this debit.
18
+ attr_reader :balance_transaction
19
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
20
+ attr_reader :created
21
+ # The currency of the debit. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
22
+ attr_reader :currency
23
+ # The ID of the linked dispute.
24
+ attr_reader :dispute
25
+ # Unique identifier for the object.
26
+ attr_reader :id
27
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
28
+ attr_reader :livemode
29
+ # String representing the object's type. Objects of the same type share the same value.
30
+ attr_reader :object
31
+
32
+ # Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
33
+ def self.list(filters = {}, opts = {})
34
+ request_stripe_object(
35
+ method: :get,
36
+ path: "/v1/issuing/fraud_liability_debits",
37
+ params: filters,
38
+ opts: opts
39
+ )
40
+ end
41
+ end
42
+ end
43
+ end
@@ -14,6 +14,44 @@ module Stripe
14
14
  "issuing.personalization_design"
15
15
  end
16
16
 
17
+ class CarrierText < Stripe::StripeObject
18
+ attr_reader :footer_body, :footer_title, :header_body, :header_title
19
+ end
20
+
21
+ class Preferences < Stripe::StripeObject
22
+ attr_reader :is_default, :is_platform_default
23
+ end
24
+
25
+ class RejectionReasons < Stripe::StripeObject
26
+ attr_reader :card_logo, :carrier_text
27
+ end
28
+ # The file for the card logo to use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`.
29
+ attr_reader :card_logo
30
+ # Hash containing carrier text, for use with physical bundles that support carrier text.
31
+ attr_reader :carrier_text
32
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
33
+ attr_reader :created
34
+ # Unique identifier for the object.
35
+ attr_reader :id
36
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
37
+ attr_reader :livemode
38
+ # A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters.
39
+ attr_reader :lookup_key
40
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
41
+ attr_reader :metadata
42
+ # Friendly display name.
43
+ attr_reader :name
44
+ # String representing the object's type. Objects of the same type share the same value.
45
+ attr_reader :object
46
+ # The physical bundle object belonging to this personalization design.
47
+ attr_reader :physical_bundle
48
+ # Attribute for field preferences
49
+ attr_reader :preferences
50
+ # Attribute for field rejection_reasons
51
+ attr_reader :rejection_reasons
52
+ # Whether this personalization design can be used to create cards.
53
+ attr_reader :status
54
+
17
55
  # Creates a personalization design object.
18
56
  def self.create(params = {}, opts = {})
19
57
  request_stripe_object(
@@ -12,6 +12,24 @@ module Stripe
12
12
  "issuing.physical_bundle"
13
13
  end
14
14
 
15
+ class Features < Stripe::StripeObject
16
+ attr_reader :card_logo, :carrier_text, :second_line
17
+ end
18
+ # Attribute for field features
19
+ attr_reader :features
20
+ # Unique identifier for the object.
21
+ attr_reader :id
22
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
23
+ attr_reader :livemode
24
+ # Friendly display name.
25
+ attr_reader :name
26
+ # String representing the object's type. Objects of the same type share the same value.
27
+ attr_reader :object
28
+ # Whether this physical bundle can be used to create cards.
29
+ attr_reader :status
30
+ # Whether this physical bundle is a standard Stripe offering or custom-made for you.
31
+ attr_reader :type
32
+
15
33
  # Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
16
34
  def self.list(filters = {}, opts = {})
17
35
  request_stripe_object(
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Issuing
6
+ # When a non-stripe BIN is used, any use of an [issued card](https://stripe.com/docs/issuing) must be settled directly with the card network. The net amount owed is represented by an Issuing `Settlement` object.
7
+ class Settlement < APIResource
8
+ OBJECT_NAME = "issuing.settlement"
9
+ def self.object_name
10
+ "issuing.settlement"
11
+ end
12
+
13
+ # The Bank Identification Number reflecting this settlement record.
14
+ attr_reader :bin
15
+ # The date that the transactions are cleared and posted to user's accounts.
16
+ attr_reader :clearing_date
17
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
18
+ attr_reader :created
19
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
20
+ attr_reader :currency
21
+ # Unique identifier for the object.
22
+ attr_reader :id
23
+ # The total interchange received as reimbursement for the transactions.
24
+ attr_reader :interchange_fees
25
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
26
+ attr_reader :livemode
27
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
28
+ attr_reader :metadata
29
+ # The total net amount required to settle with the network.
30
+ attr_reader :net_total
31
+ # The card network for this settlement report. One of ["visa", "maestro"]
32
+ attr_reader :network
33
+ # The total amount of fees owed to the network.
34
+ attr_reader :network_fees
35
+ # The Settlement Identification Number assigned by the network.
36
+ attr_reader :network_settlement_identifier
37
+ # String representing the object's type. Objects of the same type share the same value.
38
+ attr_reader :object
39
+ # One of `international` or `uk_national_net`.
40
+ attr_reader :settlement_service
41
+ # The current processing status of this settlement.
42
+ attr_reader :status
43
+ # The total number of transactions reflected in this settlement.
44
+ attr_reader :transaction_count
45
+ # The total transaction amount reflected in this settlement.
46
+ attr_reader :transaction_volume
47
+ end
48
+ end
49
+ end
@@ -13,6 +13,52 @@ module Stripe
13
13
  "issuing.token"
14
14
  end
15
15
 
16
+ class NetworkData < Stripe::StripeObject
17
+ class Device < Stripe::StripeObject
18
+ attr_reader :device_fingerprint, :ip_address, :location, :name, :phone_number, :type
19
+ end
20
+
21
+ class Mastercard < Stripe::StripeObject
22
+ attr_reader :card_reference_id, :token_reference_id, :token_requestor_id, :token_requestor_name
23
+ end
24
+
25
+ class Visa < Stripe::StripeObject
26
+ attr_reader :card_reference_id, :token_reference_id, :token_requestor_id, :token_risk_score
27
+ end
28
+
29
+ class WalletProvider < Stripe::StripeObject
30
+ class CardholderAddress < Stripe::StripeObject
31
+ attr_reader :line1, :postal_code
32
+ end
33
+ attr_reader :account_id, :account_trust_score, :card_number_source, :cardholder_address, :cardholder_name, :device_trust_score, :hashed_account_email_address, :reason_codes, :suggested_decision, :suggested_decision_version
34
+ end
35
+ attr_reader :device, :mastercard, :type, :visa, :wallet_provider
36
+ end
37
+ # Card associated with this token.
38
+ attr_reader :card
39
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
40
+ attr_reader :created
41
+ # The hashed ID derived from the device ID from the card network associated with the token.
42
+ attr_reader :device_fingerprint
43
+ # Unique identifier for the object.
44
+ attr_reader :id
45
+ # The last four digits of the token.
46
+ attr_reader :last4
47
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
48
+ attr_reader :livemode
49
+ # The token service provider / card network associated with the token.
50
+ attr_reader :network
51
+ # Attribute for field network_data
52
+ attr_reader :network_data
53
+ # Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch.
54
+ attr_reader :network_updated_at
55
+ # String representing the object's type. Objects of the same type share the same value.
56
+ attr_reader :object
57
+ # The usage state of the token.
58
+ attr_reader :status
59
+ # The digital wallet for this token, if one was used.
60
+ attr_reader :wallet_provider
61
+
16
62
  # Lists all Issuing Token objects for a given card.
17
63
  def self.list(filters = {}, opts = {})
18
64
  request_stripe_object(method: :get, path: "/v1/issuing/tokens", params: filters, opts: opts)
@@ -17,6 +17,112 @@ module Stripe
17
17
  "issuing.transaction"
18
18
  end
19
19
 
20
+ class AmountDetails < Stripe::StripeObject
21
+ attr_reader :atm_fee, :cashback_amount
22
+ end
23
+
24
+ class MerchantData < Stripe::StripeObject
25
+ attr_reader :category, :category_code, :city, :country, :name, :network_id, :postal_code, :state, :terminal_id, :url
26
+ end
27
+
28
+ class NetworkData < Stripe::StripeObject
29
+ attr_reader :authorization_code, :processing_date, :transaction_id
30
+ end
31
+
32
+ class PurchaseDetails < Stripe::StripeObject
33
+ class Fleet < Stripe::StripeObject
34
+ class CardholderPromptData < Stripe::StripeObject
35
+ attr_reader :driver_id, :odometer, :unspecified_id, :user_id, :vehicle_number
36
+ end
37
+
38
+ class ReportedBreakdown < Stripe::StripeObject
39
+ class Fuel < Stripe::StripeObject
40
+ attr_reader :gross_amount_decimal
41
+ end
42
+
43
+ class NonFuel < Stripe::StripeObject
44
+ attr_reader :gross_amount_decimal
45
+ end
46
+
47
+ class Tax < Stripe::StripeObject
48
+ attr_reader :local_amount_decimal, :national_amount_decimal
49
+ end
50
+ attr_reader :fuel, :non_fuel, :tax
51
+ end
52
+ attr_reader :cardholder_prompt_data, :purchase_type, :reported_breakdown, :service_type
53
+ end
54
+
55
+ class Flight < Stripe::StripeObject
56
+ class Segment < Stripe::StripeObject
57
+ attr_reader :arrival_airport_code, :carrier, :departure_airport_code, :flight_number, :service_class, :stopover_allowed
58
+ end
59
+ attr_reader :departure_at, :passenger_name, :refundable, :segments, :travel_agency
60
+ end
61
+
62
+ class Fuel < Stripe::StripeObject
63
+ attr_reader :industry_product_code, :quantity_decimal, :type, :unit, :unit_cost_decimal
64
+ end
65
+
66
+ class Lodging < Stripe::StripeObject
67
+ attr_reader :check_in_at, :nights
68
+ end
69
+
70
+ class Receipt < Stripe::StripeObject
71
+ attr_reader :description, :quantity, :total, :unit_cost
72
+ end
73
+ attr_reader :fleet, :flight, :fuel, :lodging, :receipt, :reference
74
+ end
75
+
76
+ class Treasury < Stripe::StripeObject
77
+ attr_reader :received_credit, :received_debit
78
+ end
79
+ # The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
80
+ attr_reader :amount
81
+ # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
82
+ attr_reader :amount_details
83
+ # The `Authorization` object that led to this transaction.
84
+ attr_reader :authorization
85
+ # ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction.
86
+ attr_reader :balance_transaction
87
+ # The card used to make this transaction.
88
+ attr_reader :card
89
+ # The cardholder to whom this transaction belongs.
90
+ attr_reader :cardholder
91
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
92
+ attr_reader :created
93
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
94
+ attr_reader :currency
95
+ # If you've disputed the transaction, the ID of the dispute.
96
+ attr_reader :dispute
97
+ # Unique identifier for the object.
98
+ attr_reader :id
99
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
100
+ attr_reader :livemode
101
+ # The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency.
102
+ attr_reader :merchant_amount
103
+ # The currency with which the merchant is taking payment.
104
+ attr_reader :merchant_currency
105
+ # Attribute for field merchant_data
106
+ attr_reader :merchant_data
107
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
108
+ attr_reader :metadata
109
+ # Details about the transaction, such as processing dates, set by the card network.
110
+ attr_reader :network_data
111
+ # String representing the object's type. Objects of the same type share the same value.
112
+ attr_reader :object
113
+ # Additional purchase information that is optionally provided by the merchant.
114
+ attr_reader :purchase_details
115
+ # Attribute for field settlement
116
+ attr_reader :settlement
117
+ # [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.
118
+ attr_reader :token
119
+ # [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts
120
+ attr_reader :treasury
121
+ # The nature of the transaction.
122
+ attr_reader :type
123
+ # The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`.
124
+ attr_reader :wallet
125
+
20
126
  # Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
21
127
  def self.list(filters = {}, opts = {})
22
128
  request_stripe_object(
@@ -8,5 +8,55 @@ module Stripe
8
8
  def self.object_name
9
9
  "item"
10
10
  end
11
+
12
+ class AdjustableQuantity < Stripe::StripeObject
13
+ attr_reader :enabled, :maximum, :minimum
14
+ end
15
+
16
+ class Discount < Stripe::StripeObject
17
+ attr_reader :amount, :discount
18
+ end
19
+
20
+ class Display < Stripe::StripeObject
21
+ attr_reader :description, :images, :name
22
+ end
23
+
24
+ class Tax < Stripe::StripeObject
25
+ attr_reader :amount, :rate, :taxability_reason, :taxable_amount
26
+ end
27
+ # Attribute for field adjustable_quantity
28
+ attr_reader :adjustable_quantity
29
+ # Total discount amount applied. If no discounts were applied, defaults to 0.
30
+ attr_reader :amount_discount
31
+ # Total before any discounts or taxes are applied.
32
+ attr_reader :amount_subtotal
33
+ # Total tax amount applied. If no tax was applied, defaults to 0.
34
+ attr_reader :amount_tax
35
+ # Total after discounts and taxes.
36
+ attr_reader :amount_total
37
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
38
+ attr_reader :currency
39
+ # An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name.
40
+ attr_reader :description
41
+ # The discounts applied to the line item.
42
+ attr_reader :discounts
43
+ # Attribute for field display
44
+ attr_reader :display
45
+ # Unique identifier for the object.
46
+ attr_reader :id
47
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
48
+ attr_reader :metadata
49
+ # String representing the object's type. Objects of the same type share the same value.
50
+ attr_reader :object
51
+ # The price used to generate the line item.
52
+ attr_reader :price
53
+ # The ID of the product for this line item.
54
+ #
55
+ # This will always be the same as `price.product`.
56
+ attr_reader :product
57
+ # The quantity of products being purchased.
58
+ attr_reader :quantity
59
+ # The taxes applied to the line item.
60
+ attr_reader :taxes
11
61
  end
12
62
  end
@@ -9,6 +9,13 @@ module Stripe
9
9
  "login_link"
10
10
  end
11
11
 
12
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
13
+ attr_reader :created
14
+ # String representing the object's type. Objects of the same type share the same value.
15
+ attr_reader :object
16
+ # The URL for the login link.
17
+ attr_reader :url
18
+
12
19
  def self.retrieve(_id, _opts = nil)
13
20
  raise NotImplementedError,
14
21
  "Login links do not have IDs and cannot be retrieved. They can " \
@@ -8,5 +8,83 @@ module Stripe
8
8
  def self.object_name
9
9
  "mandate"
10
10
  end
11
+
12
+ class CustomerAcceptance < Stripe::StripeObject
13
+ class Offline < Stripe::StripeObject; end
14
+
15
+ class Online < Stripe::StripeObject
16
+ attr_reader :ip_address, :user_agent
17
+ end
18
+ attr_reader :accepted_at, :offline, :online, :type
19
+ end
20
+
21
+ class MultiUse < Stripe::StripeObject; end
22
+
23
+ class PaymentMethodDetails < Stripe::StripeObject
24
+ class AcssDebit < Stripe::StripeObject
25
+ attr_reader :default_for, :interval_description, :payment_schedule, :transaction_type
26
+ end
27
+
28
+ class AmazonPay < Stripe::StripeObject; end
29
+
30
+ class AuBecsDebit < Stripe::StripeObject
31
+ attr_reader :url
32
+ end
33
+
34
+ class BacsDebit < Stripe::StripeObject
35
+ attr_reader :network_status, :reference, :revocation_reason, :url
36
+ end
37
+
38
+ class Card < Stripe::StripeObject; end
39
+ class Cashapp < Stripe::StripeObject; end
40
+ class KakaoPay < Stripe::StripeObject; end
41
+ class KrCard < Stripe::StripeObject; end
42
+ class Link < Stripe::StripeObject; end
43
+
44
+ class Paypal < Stripe::StripeObject
45
+ attr_reader :billing_agreement_id, :fingerprint, :payer_id, :verified_email
46
+ end
47
+
48
+ class Payto < Stripe::StripeObject
49
+ attr_reader :amount, :amount_type, :end_date, :payment_schedule, :payments_per_period, :purpose, :start_date
50
+ end
51
+
52
+ class RevolutPay < Stripe::StripeObject; end
53
+
54
+ class SepaDebit < Stripe::StripeObject
55
+ attr_reader :reference, :url
56
+ end
57
+
58
+ class UsBankAccount < Stripe::StripeObject
59
+ attr_reader :collection_method
60
+ end
61
+ attr_reader :acss_debit, :amazon_pay, :au_becs_debit, :bacs_debit, :card, :cashapp, :kakao_pay, :kr_card, :link, :paypal, :payto, :revolut_pay, :sepa_debit, :type, :us_bank_account
62
+ end
63
+
64
+ class SingleUse < Stripe::StripeObject
65
+ attr_reader :amount, :currency
66
+ end
67
+ # Attribute for field customer_acceptance
68
+ attr_reader :customer_acceptance
69
+ # Unique identifier for the object.
70
+ attr_reader :id
71
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
72
+ attr_reader :livemode
73
+ # Attribute for field multi_use
74
+ attr_reader :multi_use
75
+ # String representing the object's type. Objects of the same type share the same value.
76
+ attr_reader :object
77
+ # The account (if any) that the mandate is intended for.
78
+ attr_reader :on_behalf_of
79
+ # ID of the payment method associated with this mandate.
80
+ attr_reader :payment_method
81
+ # Attribute for field payment_method_details
82
+ attr_reader :payment_method_details
83
+ # Attribute for field single_use
84
+ attr_reader :single_use
85
+ # The mandate status indicates whether or not you can use it to initiate a payment.
86
+ attr_reader :status
87
+ # The type of the mandate.
88
+ attr_reader :type
11
89
  end
12
90
  end
@@ -0,0 +1,56 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ # A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who
6
+ # resell products and services and earn a discount (margin) for doing so.
7
+ class Margin < APIResource
8
+ extend Stripe::APIOperations::Create
9
+ extend Stripe::APIOperations::List
10
+ include Stripe::APIOperations::Save
11
+
12
+ OBJECT_NAME = "margin"
13
+ def self.object_name
14
+ "margin"
15
+ end
16
+
17
+ # Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`.
18
+ attr_reader :active
19
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
20
+ attr_reader :created
21
+ # Unique identifier for the object.
22
+ attr_reader :id
23
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
24
+ attr_reader :livemode
25
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
26
+ attr_reader :metadata
27
+ # Name of the margin that's displayed on, for example, invoices.
28
+ attr_reader :name
29
+ # String representing the object's type. Objects of the same type share the same value.
30
+ attr_reader :object
31
+ # Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied.
32
+ attr_reader :percent_off
33
+ # Time at which the object was last updated. Measured in seconds since the Unix epoch.
34
+ attr_reader :updated
35
+
36
+ # Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.
37
+ def self.create(params = {}, opts = {})
38
+ request_stripe_object(method: :post, path: "/v1/billing/margins", params: params, opts: opts)
39
+ end
40
+
41
+ # Retrieve a list of your margins.
42
+ def self.list(filters = {}, opts = {})
43
+ request_stripe_object(method: :get, path: "/v1/billing/margins", params: filters, opts: opts)
44
+ end
45
+
46
+ # Update the specified margin object. Certain fields of the margin object are not editable.
47
+ def self.update(id, params = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :post,
50
+ path: format("/v1/billing/margins/%<id>s", { id: CGI.escape(id) }),
51
+ params: params,
52
+ opts: opts
53
+ )
54
+ end
55
+ end
56
+ end