From cfeaa0ca2349d9a9d633908afff6f79282cc2d2c Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com> Date: Tue, 23 Aug 2022 08:51:43 -0400 Subject: [PATCH 01/10] API Updates (#1123) --- OPENAPI_VERSION | 2 +- lib/stripe/resources/account.rb | 6 ++++ lib/stripe/resources/account_link.rb | 4 +++ .../resources/application_fee_refund.rb | 5 +++ lib/stripe/resources/apps/secret.rb | 9 ++++++ lib/stripe/resources/balance.rb | 11 +++++++ lib/stripe/resources/balance_transaction.rb | 4 +++ lib/stripe/resources/bank_account.rb | 7 ++++ .../resources/billing_portal/configuration.rb | 1 + .../resources/billing_portal/session.rb | 14 ++++++++ lib/stripe/resources/capability.rb | 3 ++ lib/stripe/resources/card.rb | 5 +++ lib/stripe/resources/cash_balance.rb | 1 + lib/stripe/resources/charge.rb | 5 +++ lib/stripe/resources/checkout/session.rb | 14 ++++++++ lib/stripe/resources/country_spec.rb | 6 ++++ lib/stripe/resources/coupon.rb | 3 ++ lib/stripe/resources/credit_note.rb | 3 ++ lib/stripe/resources/customer.rb | 3 ++ .../resources/customer_balance_transaction.rb | 6 ++++ .../customer_cash_balance_transaction.rb | 4 +++ lib/stripe/resources/discount.rb | 4 +++ lib/stripe/resources/dispute.rb | 7 ++++ lib/stripe/resources/event.rb | 29 +++++++++++++++++ lib/stripe/resources/exchange_rate.rb | 11 +++++++ lib/stripe/resources/file.rb | 7 ++++ lib/stripe/resources/file_link.rb | 3 ++ .../financial_connections/account.rb | 1 + .../account_ownership.rb | 1 + .../financial_connections/session.rb | 1 + lib/stripe/resources/funding_instructions.rb | 5 +++ .../resources/identity/verification_report.rb | 11 +++++++ .../identity/verification_session.rb | 11 +++++++ lib/stripe/resources/invoice.rb | 32 +++++++++++++++++++ lib/stripe/resources/invoice_item.rb | 7 ++++ lib/stripe/resources/issuing/authorization.rb | 5 +++ lib/stripe/resources/issuing/card.rb | 1 + lib/stripe/resources/issuing/cardholder.rb | 3 ++ lib/stripe/resources/issuing/dispute.rb | 3 ++ lib/stripe/resources/issuing/transaction.rb | 5 +++ lib/stripe/resources/line_item.rb | 1 + lib/stripe/resources/mandate.rb | 1 + lib/stripe/resources/order.rb | 5 +++ lib/stripe/resources/payment_intent.rb | 11 +++++++ lib/stripe/resources/payment_link.rb | 5 +++ lib/stripe/resources/payment_method.rb | 5 +++ lib/stripe/resources/payout.rb | 8 +++++ lib/stripe/resources/person.rb | 6 ++++ lib/stripe/resources/plan.rb | 8 +++++ lib/stripe/resources/price.rb | 6 ++++ lib/stripe/resources/product.rb | 8 +++++ lib/stripe/resources/promotion_code.rb | 2 ++ lib/stripe/resources/quote.rb | 2 ++ .../resources/radar/early_fraud_warning.rb | 4 +++ lib/stripe/resources/radar/value_list.rb | 3 ++ lib/stripe/resources/radar/value_list_item.rb | 3 ++ lib/stripe/resources/refund.rb | 5 +++ lib/stripe/resources/reporting/report_run.rb | 8 +++++ lib/stripe/resources/reporting/report_type.rb | 8 +++++ lib/stripe/resources/reversal.rb | 13 ++++++++ lib/stripe/resources/review.rb | 4 +++ lib/stripe/resources/setup_attempt.rb | 4 +++ lib/stripe/resources/setup_intent.rb | 22 +++++++++++++ lib/stripe/resources/shipping_rate.rb | 3 ++ .../resources/sigma/scheduled_query_run.rb | 4 +++ lib/stripe/resources/sku.rb | 6 ++++ lib/stripe/resources/source.rb | 6 ++++ lib/stripe/resources/source_transaction.rb | 4 +++ lib/stripe/resources/subscription.rb | 3 ++ lib/stripe/resources/subscription_item.rb | 2 ++ lib/stripe/resources/subscription_schedule.rb | 3 ++ lib/stripe/resources/tax_code.rb | 1 + lib/stripe/resources/tax_id.rb | 4 +++ lib/stripe/resources/tax_rate.rb | 3 ++ .../resources/terminal/configuration.rb | 1 + .../resources/terminal/connection_token.rb | 3 ++ lib/stripe/resources/terminal/location.rb | 3 ++ lib/stripe/resources/terminal/reader.rb | 3 ++ .../resources/test_helpers/test_clock.rb | 3 ++ lib/stripe/resources/token.rb | 22 +++++++++++++ lib/stripe/resources/topup.rb | 5 +++ lib/stripe/resources/transfer.rb | 10 ++++++ .../resources/treasury/credit_reversal.rb | 1 + .../resources/treasury/debit_reversal.rb | 1 + .../resources/treasury/financial_account.rb | 2 ++ .../resources/treasury/inbound_transfer.rb | 1 + .../resources/treasury/outbound_payment.rb | 3 ++ .../resources/treasury/outbound_transfer.rb | 3 ++ .../resources/treasury/received_credit.rb | 1 + .../resources/treasury/received_debit.rb | 1 + lib/stripe/resources/treasury/transaction.rb | 1 + .../resources/treasury/transaction_entry.rb | 1 + lib/stripe/resources/usage_record.rb | 4 +++ lib/stripe/resources/webhook_endpoint.rb | 7 ++++ 94 files changed, 519 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d9f3b7218..c13f8f959 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v183 \ No newline at end of file +v184 \ No newline at end of file diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index 2f05ab265..bfb8572d9 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -2,6 +2,12 @@ # frozen_string_literal: true module Stripe + # This is an object representing a Stripe account. You can retrieve it to see + # properties on the account like its current e-mail address or if the account is + # enabled yet to make live charges. + # + # Some properties, marked below, are available only to platforms that want to + # [create and manage Express or Custom accounts](https://stripe.com/docs/connect/accounts). class Account < APIResource extend Gem::Deprecate extend Stripe::APIOperations::Create diff --git a/lib/stripe/resources/account_link.rb b/lib/stripe/resources/account_link.rb index df4b8b149..c61d960c4 100644 --- a/lib/stripe/resources/account_link.rb +++ b/lib/stripe/resources/account_link.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # Account Links are the means by which a Connect platform grants a connected account permission to access + # Stripe-hosted applications, such as Connect Onboarding. + # + # Related guide: [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding). class AccountLink < APIResource extend Stripe::APIOperations::Create diff --git a/lib/stripe/resources/application_fee_refund.rb b/lib/stripe/resources/application_fee_refund.rb index 9d6ea9a8c..937ca4c1a 100644 --- a/lib/stripe/resources/application_fee_refund.rb +++ b/lib/stripe/resources/application_fee_refund.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # `Application Fee Refund` objects allow you to refund an application fee that + # has previously been created but not yet refunded. Funds will be refunded to + # the Stripe account from which the fee was originally collected. + # + # Related guide: [Refunding Application Fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee). class ApplicationFeeRefund < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/apps/secret.rb b/lib/stripe/resources/apps/secret.rb index a37666f3e..dff71a051 100644 --- a/lib/stripe/resources/apps/secret.rb +++ b/lib/stripe/resources/apps/secret.rb @@ -3,6 +3,15 @@ module Stripe module Apps + # Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends. + # + # The primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control. + # + # All Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key. + # + # A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions. + # + # Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects). class Secret < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/balance.rb b/lib/stripe/resources/balance.rb index 92e1b7f50..403b2d78b 100644 --- a/lib/stripe/resources/balance.rb +++ b/lib/stripe/resources/balance.rb @@ -2,6 +2,17 @@ # frozen_string_literal: true module Stripe + # This is an object representing your Stripe balance. You can retrieve it to see + # the balance currently on your Stripe account. + # + # You can also retrieve the balance history, which contains a list of + # [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance + # (charges, payouts, and so forth). + # + # The available and pending amounts for each currency are broken down further by + # payment source types. + # + # Related guide: [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). class Balance < SingletonAPIResource OBJECT_NAME = "balance" end diff --git a/lib/stripe/resources/balance_transaction.rb b/lib/stripe/resources/balance_transaction.rb index ae6149370..d321fe4d7 100644 --- a/lib/stripe/resources/balance_transaction.rb +++ b/lib/stripe/resources/balance_transaction.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # Balance transactions represent funds moving through your Stripe account. + # They're created for every type of transaction that comes into or flows out of your Stripe account balance. + # + # Related guide: [Balance Transaction Types](https://stripe.com/docs/reports/balance-transaction-types). class BalanceTransaction < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/bank_account.rb b/lib/stripe/resources/bank_account.rb index d37f17c49..2004a4150 100644 --- a/lib/stripe/resources/bank_account.rb +++ b/lib/stripe/resources/bank_account.rb @@ -2,6 +2,13 @@ # frozen_string_literal: true module Stripe + # These bank accounts are payment methods on `Customer` objects. + # + # On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer + # destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). + # They can be bank accounts or debit cards as well, and are documented in the links above. + # + # Related guide: [Bank Debits and Transfers](https://stripe.com/docs/payments/bank-debits-transfers). class BankAccount < APIResource include Stripe::APIOperations::Delete extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/billing_portal/configuration.rb b/lib/stripe/resources/billing_portal/configuration.rb index 3b60682ec..a5c9d05c3 100644 --- a/lib/stripe/resources/billing_portal/configuration.rb +++ b/lib/stripe/resources/billing_portal/configuration.rb @@ -3,6 +3,7 @@ module Stripe module BillingPortal + # A portal configuration describes the functionality and behavior of a portal session. class Configuration < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/billing_portal/session.rb b/lib/stripe/resources/billing_portal/session.rb index c269095d6..641bfdee8 100644 --- a/lib/stripe/resources/billing_portal/session.rb +++ b/lib/stripe/resources/billing_portal/session.rb @@ -3,6 +3,20 @@ module Stripe module BillingPortal + # The Billing customer portal is a Stripe-hosted UI for subscription and + # billing management. + # + # A portal configuration describes the functionality and features that you + # want to provide to your customers through the portal. + # + # A portal session describes the instantiation of the customer portal for + # a particular customer. By visiting the session's URL, the customer + # can manage their subscriptions and billing details. For security reasons, + # sessions are short-lived and will expire if the customer does not visit the URL. + # Create sessions on-demand when customers intend to manage their subscriptions + # and billing details. + # + # Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). class Session < APIResource extend Stripe::APIOperations::Create diff --git a/lib/stripe/resources/capability.rb b/lib/stripe/resources/capability.rb index 58f519640..067013609 100644 --- a/lib/stripe/resources/capability.rb +++ b/lib/stripe/resources/capability.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # This is an object representing a capability for a Stripe account. + # + # Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities). class Capability < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/card.rb b/lib/stripe/resources/card.rb index 0e494d510..4261f0b90 100644 --- a/lib/stripe/resources/card.rb +++ b/lib/stripe/resources/card.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # You can store multiple cards on a customer in order to charge the customer + # later. You can also store multiple debit cards on a recipient in order to + # transfer to those cards later. + # + # Related guide: [Card Payments with Sources](https://stripe.com/docs/sources/cards). class Card < APIResource include Stripe::APIOperations::Delete extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/cash_balance.rb b/lib/stripe/resources/cash_balance.rb index 6671a9f1e..b8f0e1f4b 100644 --- a/lib/stripe/resources/cash_balance.rb +++ b/lib/stripe/resources/cash_balance.rb @@ -2,6 +2,7 @@ # frozen_string_literal: true module Stripe + # A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account. class CashBalance < APIResource OBJECT_NAME = "cash_balance" diff --git a/lib/stripe/resources/charge.rb b/lib/stripe/resources/charge.rb index b7603443a..de8caf720 100644 --- a/lib/stripe/resources/charge.rb +++ b/lib/stripe/resources/charge.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # To charge a credit or a debit card, you create a `Charge` object. You can + # retrieve and refund individual charges as well as list all charges. Charges + # are identified by a unique, random ID. + # + # Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). class Charge < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/checkout/session.rb b/lib/stripe/resources/checkout/session.rb index 3eb083494..8b9731ed4 100644 --- a/lib/stripe/resources/checkout/session.rb +++ b/lib/stripe/resources/checkout/session.rb @@ -3,6 +3,20 @@ module Stripe module Checkout + # A Checkout Session represents your customer's session as they pay for + # one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) + # or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a + # new Session each time your customer attempts to pay. + # + # Once payment is successful, the Checkout Session will contain a reference + # to the [Customer](https://stripe.com/docs/api/customers), and either the successful + # [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active + # [Subscription](https://stripe.com/docs/api/subscriptions). + # + # You can create a Checkout Session on your server and pass its ID to the + # client to begin Checkout. + # + # Related guide: [Checkout Quickstart](https://stripe.com/docs/checkout/quickstart). class Session < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/country_spec.rb b/lib/stripe/resources/country_spec.rb index 360fc3a90..e28ae9c27 100644 --- a/lib/stripe/resources/country_spec.rb +++ b/lib/stripe/resources/country_spec.rb @@ -2,6 +2,12 @@ # frozen_string_literal: true module Stripe + # Stripe needs to collect certain pieces of information about each account + # created. These requirements can differ depending on the account's country. The + # Country Specs API makes these rules available to your integration. + # + # You can also view the information from this API call as [an online + # guide](https://stripe.com/docs/connect/required-verification-information). class CountrySpec < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/coupon.rb b/lib/stripe/resources/coupon.rb index 91ddefcc6..d5cffb9f8 100644 --- a/lib/stripe/resources/coupon.rb +++ b/lib/stripe/resources/coupon.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # A coupon contains information about a percent-off or amount-off discount you + # might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + # [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). class Coupon < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/credit_note.rb b/lib/stripe/resources/credit_note.rb index d685f86d3..4e5e20a2e 100644 --- a/lib/stripe/resources/credit_note.rb +++ b/lib/stripe/resources/credit_note.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # Issue a credit note to adjust an invoice's amount after the invoice is finalized. + # + # Related guide: [Credit Notes](https://stripe.com/docs/billing/invoices/credit-notes). class CreditNote < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/customer.rb b/lib/stripe/resources/customer.rb index 4bab84431..28eab6765 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer. + # + # Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment). class Customer < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/customer_balance_transaction.rb b/lib/stripe/resources/customer_balance_transaction.rb index de93210f4..4984a4c87 100644 --- a/lib/stripe/resources/customer_balance_transaction.rb +++ b/lib/stripe/resources/customer_balance_transaction.rb @@ -2,6 +2,12 @@ # frozen_string_literal: true module Stripe + # Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) value, + # which denotes a debit or credit that's automatically applied to their next invoice upon finalization. + # You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update), + # or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`. + # + # Related guide: [Customer Balance](https://stripe.com/docs/billing/customer/balance) to learn more. class CustomerBalanceTransaction < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/customer_cash_balance_transaction.rb b/lib/stripe/resources/customer_cash_balance_transaction.rb index 667309cc2..3c28e823b 100644 --- a/lib/stripe/resources/customer_cash_balance_transaction.rb +++ b/lib/stripe/resources/customer_cash_balance_transaction.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # Customers with certain payments enabled have a cash balance, representing funds that were paid + # by the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions + # represent when funds are moved into or out of this balance. This includes funding by the customer, allocation + # to payments, and refunds to the customer. class CustomerCashBalanceTransaction < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/discount.rb b/lib/stripe/resources/discount.rb index 779fe5934..c8f3e6e7b 100644 --- a/lib/stripe/resources/discount.rb +++ b/lib/stripe/resources/discount.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). class Discount < StripeObject OBJECT_NAME = "discount" end diff --git a/lib/stripe/resources/dispute.rb b/lib/stripe/resources/dispute.rb index 9689b1e15..226a405d5 100644 --- a/lib/stripe/resources/dispute.rb +++ b/lib/stripe/resources/dispute.rb @@ -2,6 +2,13 @@ # frozen_string_literal: true module Stripe + # A dispute occurs when a customer questions your charge with their card issuer. + # When this happens, you're given the opportunity to respond to the dispute with + # evidence that shows that the charge is legitimate. You can find more + # information about the dispute process in our [Disputes and + # Fraud](https://stripe.com/docs/disputes) documentation. + # + # Related guide: [Disputes and Fraud](https://stripe.com/docs/disputes). class Dispute < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/event.rb b/lib/stripe/resources/event.rb index ca0223593..d02134b18 100644 --- a/lib/stripe/resources/event.rb +++ b/lib/stripe/resources/event.rb @@ -2,6 +2,35 @@ # frozen_string_literal: true module Stripe + # Events are our way of letting you know when something interesting happens in + # your account. When an interesting event occurs, we create a new `Event` + # object. For example, when a charge succeeds, we create a `charge.succeeded` + # event; and when an invoice payment attempt fails, we create an + # `invoice.payment_failed` event. Note that many API requests may cause multiple + # events to be created. For example, if you create a new subscription for a + # customer, you will receive both a `customer.subscription.created` event and a + # `charge.succeeded` event. + # + # Events occur when the state of another API resource changes. The state of that + # resource at the time of the change is embedded in the event's data field. For + # example, a `charge.succeeded` event will contain a charge, and an + # `invoice.payment_failed` event will contain an invoice. + # + # As with other API resources, you can use endpoints to retrieve an + # [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events) + # from the API. We also have a separate + # [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the + # `Event` objects directly to an endpoint on your server. Webhooks are managed + # in your + # [account settings](https://dashboard.stripe.com/account/webhooks), + # and our [Using Webhooks](https://stripe.com/docs/webhooks) guide will help you get set up. + # + # When using [Connect](https://stripe.com/docs/connect), you can also receive notifications of + # events that occur in connected accounts. For these events, there will be an + # additional `account` attribute in the received `Event` object. + # + # **NOTE:** Right now, access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) is + # guaranteed only for 30 days. class Event < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/exchange_rate.rb b/lib/stripe/resources/exchange_rate.rb index 62a606157..333c49063 100644 --- a/lib/stripe/resources/exchange_rate.rb +++ b/lib/stripe/resources/exchange_rate.rb @@ -2,6 +2,17 @@ # frozen_string_literal: true module Stripe + # `Exchange Rate` objects allow you to determine the rates that Stripe is + # currently using to convert from one currency to another. Since this number is + # variable throughout the day, there are various reasons why you might want to + # know the current rate (for example, to dynamically price an item for a user + # with a default payment in a foreign currency). + # + # If you want a guarantee that the charge is made with a certain exchange rate + # you expect is current, you can pass in `exchange_rate` to charges endpoints. + # If the value is no longer up to date, the charge won't go through. Please + # refer to our [Exchange Rates API](https://stripe.com/docs/exchange-rates) guide for more + # details. class ExchangeRate < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/file.rb b/lib/stripe/resources/file.rb index f04f50b2c..4cd9d9325 100644 --- a/lib/stripe/resources/file.rb +++ b/lib/stripe/resources/file.rb @@ -2,6 +2,13 @@ # frozen_string_literal: true module Stripe + # This is an object representing a file hosted on Stripe's servers. The + # file may have been uploaded by yourself using the [create file](https://stripe.com/docs/api#create_file) + # request (for example, when uploading dispute evidence) or it may have + # been created by Stripe (for example, the results of a [Sigma scheduled + # query](https://stripe.com/docs/api#scheduled_queries)). + # + # Related guide: [File Upload Guide](https://stripe.com/docs/file-upload). class File < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/file_link.rb b/lib/stripe/resources/file_link.rb index 1868171d7..4211c0653 100644 --- a/lib/stripe/resources/file_link.rb +++ b/lib/stripe/resources/file_link.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # To share the contents of a `File` object with non-Stripe users, you can + # create a `FileLink`. `FileLink`s contain a URL that can be used to + # retrieve the contents of the file without authentication. class FileLink < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/financial_connections/account.rb b/lib/stripe/resources/financial_connections/account.rb index 6d7f466c3..90c9950f3 100644 --- a/lib/stripe/resources/financial_connections/account.rb +++ b/lib/stripe/resources/financial_connections/account.rb @@ -3,6 +3,7 @@ module Stripe module FinancialConnections + # A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. class Account < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/financial_connections/account_ownership.rb b/lib/stripe/resources/financial_connections/account_ownership.rb index 5593b6c54..8889269a8 100644 --- a/lib/stripe/resources/financial_connections/account_ownership.rb +++ b/lib/stripe/resources/financial_connections/account_ownership.rb @@ -3,6 +3,7 @@ module Stripe module FinancialConnections + # Describes a snapshot of the owners of an account at a particular point in time. class AccountOwnership < StripeObject OBJECT_NAME = "financial_connections.account_ownership" end diff --git a/lib/stripe/resources/financial_connections/session.rb b/lib/stripe/resources/financial_connections/session.rb index 89a80b9c9..0b190a811 100644 --- a/lib/stripe/resources/financial_connections/session.rb +++ b/lib/stripe/resources/financial_connections/session.rb @@ -3,6 +3,7 @@ module Stripe module FinancialConnections + # A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. class Session < APIResource extend Stripe::APIOperations::Create diff --git a/lib/stripe/resources/funding_instructions.rb b/lib/stripe/resources/funding_instructions.rb index cb89f18d1..e8aba9896 100644 --- a/lib/stripe/resources/funding_instructions.rb +++ b/lib/stripe/resources/funding_instructions.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) that is + # automatically applied to future invoices and payments using the `customer_balance` payment method. + # Customers can fund this balance by initiating a bank transfer to any account in the + # `financial_addresses` field. + # Related guide: [Customer Balance - Funding Instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions) to learn more class FundingInstructions < APIResource OBJECT_NAME = "funding_instructions" diff --git a/lib/stripe/resources/identity/verification_report.rb b/lib/stripe/resources/identity/verification_report.rb index 3235e4d40..e6b2e5d78 100644 --- a/lib/stripe/resources/identity/verification_report.rb +++ b/lib/stripe/resources/identity/verification_report.rb @@ -3,6 +3,17 @@ module Stripe module Identity + # A VerificationReport is the result of an attempt to collect and verify data from a user. + # The collection of verification checks performed is determined from the `type` and `options` + # parameters used. You can find the result of each verification check performed in the + # appropriate sub-resource: `document`, `id_number`, `selfie`. + # + # Each VerificationReport contains a copy of any data collected by the user as well as + # reference IDs which can be used to access collected images through the [FileUpload](https://stripe.com/docs/api/files) + # API. To configure and create VerificationReports, use the + # [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. + # + # Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). class VerificationReport < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/identity/verification_session.rb b/lib/stripe/resources/identity/verification_session.rb index 6af101979..e9fcf9126 100644 --- a/lib/stripe/resources/identity/verification_session.rb +++ b/lib/stripe/resources/identity/verification_session.rb @@ -3,6 +3,17 @@ module Stripe module Identity + # A VerificationSession guides you through the process of collecting and verifying the identities + # of your users. It contains details about the type of verification, such as what [verification + # check](https://stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for + # each verification in your system. + # + # A VerificationSession transitions through [multiple + # statuses](https://stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through + # the verification flow. The VerificationSession contains the user's verified data after + # verification checks are complete. + # + # Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions) class VerificationSession < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index fa07ed593..c931d0d1b 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -2,6 +2,38 @@ # frozen_string_literal: true module Stripe + # Invoices are statements of amounts owed by a customer, and are either + # generated one-off, or generated periodically from a subscription. + # + # They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments + # that may be caused by subscription upgrades/downgrades (if necessary). + # + # If your invoice is configured to be billed through automatic charges, + # Stripe automatically finalizes your invoice and attempts payment. Note + # that finalizing the invoice, + # [when automatic](https://stripe.com/docs/billing/invoices/workflow/#auto_advance), does + # not happen immediately as the invoice is created. Stripe waits + # until one hour after the last webhook was successfully sent (or the last + # webhook timed out after failing). If you (and the platforms you may have + # connected to) have no webhooks configured, Stripe waits one hour after + # creation to finalize the invoice. + # + # If your invoice is configured to be billed by sending an email, then based on your + # [email settings](https://dashboard.stripe.com/account/billing/automatic), + # Stripe will email the invoice to your customer and await payment. These + # emails can contain a link to a hosted page to pay the invoice. + # + # Stripe applies any customer credit on the account before determining the + # amount due for the invoice (i.e., the amount that will be actually + # charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge + # per currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the + # invoice is automatically marked paid, and we add the amount due to the + # customer's credit balance which is applied to the next invoice. + # + # More details on the customer's credit balance are + # [here](https://stripe.com/docs/billing/customer/balance). + # + # Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). class Invoice < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/invoice_item.rb b/lib/stripe/resources/invoice_item.rb index ca8eddc01..9400de676 100644 --- a/lib/stripe/resources/invoice_item.rb +++ b/lib/stripe/resources/invoice_item.rb @@ -2,6 +2,13 @@ # frozen_string_literal: true module Stripe + # Sometimes you want to add a charge or credit to a customer, but actually + # charge or credit the customer's card only at the end of a regular billing + # cycle. This is useful for combining several charges (to minimize + # per-transaction fees), or for having Stripe tabulate your usage-based billing + # totals. + # + # Related guide: [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). class InvoiceItem < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/issuing/authorization.rb b/lib/stripe/resources/issuing/authorization.rb index a90dc6d85..aea539561 100644 --- a/lib/stripe/resources/issuing/authorization.rb +++ b/lib/stripe/resources/issuing/authorization.rb @@ -3,6 +3,11 @@ module Stripe module Issuing + # When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + # object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + # purchase to be completed successfully. + # + # Related guide: [Issued Card Authorizations](https://stripe.com/docs/issuing/purchases/authorizations). class Authorization < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/issuing/card.rb b/lib/stripe/resources/issuing/card.rb index 2e20bef01..88764b666 100644 --- a/lib/stripe/resources/issuing/card.rb +++ b/lib/stripe/resources/issuing/card.rb @@ -3,6 +3,7 @@ module Stripe module Issuing + # You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. class Card < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/issuing/cardholder.rb b/lib/stripe/resources/issuing/cardholder.rb index 9f972fadd..8e2dc639b 100644 --- a/lib/stripe/resources/issuing/cardholder.rb +++ b/lib/stripe/resources/issuing/cardholder.rb @@ -3,6 +3,9 @@ module Stripe module Issuing + # An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. + # + # Related guide: [How to create a Cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) class Cardholder < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/issuing/dispute.rb b/lib/stripe/resources/issuing/dispute.rb index a32a44e32..45d43a77d 100644 --- a/lib/stripe/resources/issuing/dispute.rb +++ b/lib/stripe/resources/issuing/dispute.rb @@ -3,6 +3,9 @@ module Stripe module Issuing + # As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with. + # + # Related guide: [Disputing Transactions](https://stripe.com/docs/issuing/purchases/disputes) class Dispute < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/issuing/transaction.rb b/lib/stripe/resources/issuing/transaction.rb index b0cde379d..668fe4bb4 100644 --- a/lib/stripe/resources/issuing/transaction.rb +++ b/lib/stripe/resources/issuing/transaction.rb @@ -3,6 +3,11 @@ module Stripe module Issuing + # Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving + # your Stripe account, such as a completed purchase or refund, is represented by an Issuing + # `Transaction` object. + # + # Related guide: [Issued Card Transactions](https://stripe.com/docs/issuing/purchases/transactions). class Transaction < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/line_item.rb b/lib/stripe/resources/line_item.rb index 108773cd7..7e31701b3 100644 --- a/lib/stripe/resources/line_item.rb +++ b/lib/stripe/resources/line_item.rb @@ -2,6 +2,7 @@ # frozen_string_literal: true module Stripe + # A line item. class LineItem < APIResource OBJECT_NAME = "item" end diff --git a/lib/stripe/resources/mandate.rb b/lib/stripe/resources/mandate.rb index c633ebe14..523c469cc 100644 --- a/lib/stripe/resources/mandate.rb +++ b/lib/stripe/resources/mandate.rb @@ -2,6 +2,7 @@ # frozen_string_literal: true module Stripe + # A Mandate is a record of the permission a customer has given you to debit their payment method. class Mandate < APIResource OBJECT_NAME = "mandate" end diff --git a/lib/stripe/resources/order.rb b/lib/stripe/resources/order.rb index 4549c9d30..0ca6e75df 100644 --- a/lib/stripe/resources/order.rb +++ b/lib/stripe/resources/order.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # An Order describes a purchase being made by a customer, including the + # products & quantities being purchased, the order status, the payment information, + # and the billing/shipping details. + # + # Related guide: [Orders overview](https://stripe.com/docs/orders) class Order < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/payment_intent.rb b/lib/stripe/resources/payment_intent.rb index 05ca3e9e0..9ad1449d0 100644 --- a/lib/stripe/resources/payment_intent.rb +++ b/lib/stripe/resources/payment_intent.rb @@ -2,6 +2,17 @@ # frozen_string_literal: true module Stripe + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). class PaymentIntent < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/payment_link.rb b/lib/stripe/resources/payment_link.rb index 03739f566..80b8726da 100644 --- a/lib/stripe/resources/payment_link.rb +++ b/lib/stripe/resources/payment_link.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times. + # + # When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links. + # + # Related guide: [Payment Links API](https://stripe.com/docs/payments/payment-links/api) class PaymentLink < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/payment_method.rb b/lib/stripe/resources/payment_method.rb index 18966b427..31798a955 100644 --- a/lib/stripe/resources/payment_method.rb +++ b/lib/stripe/resources/payment_method.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). class PaymentMethod < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/payout.rb b/lib/stripe/resources/payout.rb index ede6d244f..1446f5dd1 100644 --- a/lib/stripe/resources/payout.rb +++ b/lib/stripe/resources/payout.rb @@ -2,6 +2,14 @@ # frozen_string_literal: true module Stripe + # A `Payout` object is created when you receive funds from Stripe, or when you + # initiate a payout to either a bank account or debit card of a [connected + # Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, + # as well as list all payouts. Payouts are made on [varying + # schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and + # industry. + # + # Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). class Payout < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/person.rb b/lib/stripe/resources/person.rb index 2547c23ef..33162d69c 100644 --- a/lib/stripe/resources/person.rb +++ b/lib/stripe/resources/person.rb @@ -2,6 +2,12 @@ # frozen_string_literal: true module Stripe + # This is an object representing a person associated with a Stripe account. + # + # A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. + # See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps. + # + # Related guide: [Handling Identity Verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information). class Person < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/plan.rb b/lib/stripe/resources/plan.rb index fc7627b4f..c160dec30 100644 --- a/lib/stripe/resources/plan.rb +++ b/lib/stripe/resources/plan.rb @@ -2,6 +2,14 @@ # frozen_string_literal: true module Stripe + # You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + # + # Plans define the base price, currency, and billing cycle for recurring purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). class Plan < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/price.rb b/lib/stripe/resources/price.rb index d743a03a9..414c9dc16 100644 --- a/lib/stripe/resources/price.rb +++ b/lib/stripe/resources/price.rb @@ -2,6 +2,12 @@ # frozen_string_literal: true module Stripe + # Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). class Price < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/product.rb b/lib/stripe/resources/product.rb index f430028a4..caa84ac0a 100644 --- a/lib/stripe/resources/product.rb +++ b/lib/stripe/resources/product.rb @@ -2,6 +2,14 @@ # frozen_string_literal: true module Stripe + # Products describe the specific goods or services you offer to your customers. + # For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. + # They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), + # [share a Payment Link](https://stripe.com/docs/payments/payment-links/overview), + # [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront), + # and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) class Product < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/promotion_code.rb b/lib/stripe/resources/promotion_code.rb index 3d3130e20..ad5e28025 100644 --- a/lib/stripe/resources/promotion_code.rb +++ b/lib/stripe/resources/promotion_code.rb @@ -2,6 +2,8 @@ # frozen_string_literal: true module Stripe + # A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to + # create multiple codes for a single coupon. class PromotionCode < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/quote.rb b/lib/stripe/resources/quote.rb index 195e0c3ba..001840987 100644 --- a/lib/stripe/resources/quote.rb +++ b/lib/stripe/resources/quote.rb @@ -2,6 +2,8 @@ # frozen_string_literal: true module Stripe + # A Quote is a way to model prices that you'd like to provide to a customer. + # Once accepted, it will automatically create an invoice, subscription or subscription schedule. class Quote < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/radar/early_fraud_warning.rb b/lib/stripe/resources/radar/early_fraud_warning.rb index 898d8e33d..1ff76afde 100644 --- a/lib/stripe/resources/radar/early_fraud_warning.rb +++ b/lib/stripe/resources/radar/early_fraud_warning.rb @@ -3,6 +3,10 @@ module Stripe module Radar + # An early fraud warning indicates that the card issuer has notified us that a + # charge may be fraudulent. + # + # Related guide: [Early Fraud Warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings). class EarlyFraudWarning < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/radar/value_list.rb b/lib/stripe/resources/radar/value_list.rb index 9f35a6001..ee0e6ca42 100644 --- a/lib/stripe/resources/radar/value_list.rb +++ b/lib/stripe/resources/radar/value_list.rb @@ -3,6 +3,9 @@ module Stripe module Radar + # Value lists allow you to group values together which can then be referenced in rules. + # + # Related guide: [Default Stripe Lists](https://stripe.com/docs/radar/lists#managing-list-items). class ValueList < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/radar/value_list_item.rb b/lib/stripe/resources/radar/value_list_item.rb index 175d516a7..1ef76de89 100644 --- a/lib/stripe/resources/radar/value_list_item.rb +++ b/lib/stripe/resources/radar/value_list_item.rb @@ -3,6 +3,9 @@ module Stripe module Radar + # Value list items allow you to add specific values to a given Radar value list, which can then be used in rules. + # + # Related guide: [Managing List Items](https://stripe.com/docs/radar/lists#managing-list-items). class ValueListItem < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/refund.rb b/lib/stripe/resources/refund.rb index c896d0ef6..f7aa8a55c 100644 --- a/lib/stripe/resources/refund.rb +++ b/lib/stripe/resources/refund.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # `Refund` objects allow you to refund a charge that has previously been created + # but not yet refunded. Funds will be refunded to the credit or debit card that + # was originally charged. + # + # Related guide: [Refunds](https://stripe.com/docs/refunds). class Refund < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/reporting/report_run.rb b/lib/stripe/resources/reporting/report_run.rb index aa7486d7f..29cd6d566 100644 --- a/lib/stripe/resources/reporting/report_run.rb +++ b/lib/stripe/resources/reporting/report_run.rb @@ -3,6 +3,14 @@ module Stripe module Reporting + # The Report Run object represents an instance of a report type generated with + # specific run parameters. Once the object is created, Stripe begins processing the report. + # When the report has finished running, it will give you a reference to a file + # where you can retrieve your results. For an overview, see + # [API Access to Reports](https://stripe.com/docs/reporting/statements/api). + # + # Note that certain report types can only be run based on your live-mode data (not test-mode + # data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). class ReportRun < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/reporting/report_type.rb b/lib/stripe/resources/reporting/report_type.rb index 97e821208..09aed3e86 100644 --- a/lib/stripe/resources/reporting/report_type.rb +++ b/lib/stripe/resources/reporting/report_type.rb @@ -3,6 +3,14 @@ module Stripe module Reporting + # The Report Type resource corresponds to a particular type of report, such as + # the "Activity summary" or "Itemized payouts" reports. These objects are + # identified by an ID belonging to a set of enumerated values. See + # [API Access to Reports documentation](https://stripe.com/docs/reporting/statements/api) + # for those Report Type IDs, along with required and optional parameters. + # + # Note that certain report types can only be run based on your live-mode data (not test-mode + # data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). class ReportType < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/reversal.rb b/lib/stripe/resources/reversal.rb index 090a40f97..8d1de380d 100644 --- a/lib/stripe/resources/reversal.rb +++ b/lib/stripe/resources/reversal.rb @@ -2,6 +2,19 @@ # frozen_string_literal: true module Stripe + # [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a + # connected account, either entirely or partially, and can also specify whether + # to refund any related application fees. Transfer reversals add to the + # platform's balance and subtract from the destination account's balance. + # + # Reversing a transfer that was made for a [destination + # charge](https://stripe.com/docs/connect/destination-charges) is allowed only up to the amount of + # the charge. It is possible to reverse a + # [transfer_group](https://stripe.com/docs/connect/charges-transfers#transfer-options) + # transfer only if the destination account has enough balance to cover the + # reversal. + # + # Related guide: [Reversing Transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers). class Reversal < APIResource extend Stripe::APIOperations::List include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/review.rb b/lib/stripe/resources/review.rb index b961bc838..e3c55be0b 100644 --- a/lib/stripe/resources/review.rb +++ b/lib/stripe/resources/review.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # Reviews can be used to supplement automated fraud detection with human expertise. + # + # Learn more about [Radar](https://stripe.com/radar) and reviewing payments + # [here](https://stripe.com/docs/radar/reviews). class Review < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/setup_attempt.rb b/lib/stripe/resources/setup_attempt.rb index b13ae324d..35bff2b92 100644 --- a/lib/stripe/resources/setup_attempt.rb +++ b/lib/stripe/resources/setup_attempt.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # A SetupAttempt describes one attempted confirmation of a SetupIntent, + # whether that confirmation was successful or unsuccessful. You can use + # SetupAttempts to inspect details of a specific attempt at setting up a + # payment method using a SetupIntent. class SetupAttempt < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/setup_intent.rb b/lib/stripe/resources/setup_intent.rb index dff2d33b5..8293a67c5 100644 --- a/lib/stripe/resources/setup_intent.rb +++ b/lib/stripe/resources/setup_intent.rb @@ -2,6 +2,28 @@ # frozen_string_literal: true module Stripe + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. + # Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. + # The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) may need to be run through + # [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection + # in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). + # If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success, + # it will automatically attach the resulting payment method to that Customer. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you ensure that your customers experience the minimum set of required friction, + # even as regulations change over time. + # + # Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). class SetupIntent < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/shipping_rate.rb b/lib/stripe/resources/shipping_rate.rb index 95631a95a..1d749f5cb 100644 --- a/lib/stripe/resources/shipping_rate.rb +++ b/lib/stripe/resources/shipping_rate.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # Shipping rates describe the price of shipping presented to your customers and can be + # applied to [Checkout Sessions](https://stripe.com/docs/payments/checkout/shipping) + # and [Orders](https://stripe.com/docs/orders/shipping) to collect shipping costs. class ShippingRate < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/sigma/scheduled_query_run.rb b/lib/stripe/resources/sigma/scheduled_query_run.rb index 4d6555fb6..94e94b6fa 100644 --- a/lib/stripe/resources/sigma/scheduled_query_run.rb +++ b/lib/stripe/resources/sigma/scheduled_query_run.rb @@ -3,6 +3,10 @@ module Stripe module Sigma + # If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll + # receive a `sigma.scheduled_query_run.created` webhook each time the query + # runs. The webhook contains a `ScheduledQueryRun` object, which you can use to + # retrieve the query results. class ScheduledQueryRun < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/sku.rb b/lib/stripe/resources/sku.rb index db2de066f..f7d72b2e5 100644 --- a/lib/stripe/resources/sku.rb +++ b/lib/stripe/resources/sku.rb @@ -2,6 +2,12 @@ # frozen_string_literal: true module Stripe + # Stores representations of [stock keeping units](http://en.wikipedia.org/wiki/Stock_keeping_unit). + # SKUs describe specific product variations, taking into account any combination of: attributes, + # currency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents + # the `size: large`, `color: red` version of that shirt. + # + # Can also be used to manage inventory. class SKU < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/source.rb b/lib/stripe/resources/source.rb index feaf54c4a..a93ccfb69 100644 --- a/lib/stripe/resources/source.rb +++ b/lib/stripe/resources/source.rb @@ -2,6 +2,12 @@ # frozen_string_literal: true module Stripe + # `Source` objects allow you to accept a variety of payment methods. They + # represent a customer's payment instrument, and can be used with the Stripe API + # just like a `Card` object: once chargeable, they can be charged, or can be + # attached to customers. + # + # Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). class Source < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Save diff --git a/lib/stripe/resources/source_transaction.rb b/lib/stripe/resources/source_transaction.rb index 6a09a7f92..14b5aff22 100644 --- a/lib/stripe/resources/source_transaction.rb +++ b/lib/stripe/resources/source_transaction.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # Some payment methods have no required amount that a customer must send. + # Customers can be instructed to send any amount, and it can be made up of + # multiple transactions. As such, sources can have multiple associated + # transactions. class SourceTransaction < StripeObject OBJECT_NAME = "source_transaction" end diff --git a/lib/stripe/resources/subscription.rb b/lib/stripe/resources/subscription.rb index d2d41fed3..7c9cbb1e8 100644 --- a/lib/stripe/resources/subscription.rb +++ b/lib/stripe/resources/subscription.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # Subscriptions allow you to charge a customer on a recurring basis. + # + # Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). class Subscription < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/subscription_item.rb b/lib/stripe/resources/subscription_item.rb index 87d925a62..406f6c000 100644 --- a/lib/stripe/resources/subscription_item.rb +++ b/lib/stripe/resources/subscription_item.rb @@ -2,6 +2,8 @@ # frozen_string_literal: true module Stripe + # Subscription items allow you to create customer subscriptions with more than + # one plan, making it easy to represent complex billing relationships. class SubscriptionItem < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/subscription_schedule.rb b/lib/stripe/resources/subscription_schedule.rb index d56c118e2..4b1ed4121 100644 --- a/lib/stripe/resources/subscription_schedule.rb +++ b/lib/stripe/resources/subscription_schedule.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. + # + # Related guide: [Subscription Schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules). class SubscriptionSchedule < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/tax_code.rb b/lib/stripe/resources/tax_code.rb index f3e27d981..17bec8897 100644 --- a/lib/stripe/resources/tax_code.rb +++ b/lib/stripe/resources/tax_code.rb @@ -2,6 +2,7 @@ # frozen_string_literal: true module Stripe + # [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes. class TaxCode < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/tax_id.rb b/lib/stripe/resources/tax_id.rb index 18b09b86b..204f3c3ac 100644 --- a/lib/stripe/resources/tax_id.rb +++ b/lib/stripe/resources/tax_id.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers). + # A customer's tax IDs are displayed on invoices and credit notes issued for the customer. + # + # Related guide: [Customer Tax Identification Numbers](https://stripe.com/docs/billing/taxes/tax-ids). class TaxId < APIResource include Stripe::APIOperations::Delete extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/tax_rate.rb b/lib/stripe/resources/tax_rate.rb index a47ee1ebd..197988b6e 100644 --- a/lib/stripe/resources/tax_rate.rb +++ b/lib/stripe/resources/tax_rate.rb @@ -2,6 +2,9 @@ # frozen_string_literal: true module Stripe + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). class TaxRate < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/terminal/configuration.rb b/lib/stripe/resources/terminal/configuration.rb index f66421da8..765be8c1f 100644 --- a/lib/stripe/resources/terminal/configuration.rb +++ b/lib/stripe/resources/terminal/configuration.rb @@ -3,6 +3,7 @@ module Stripe module Terminal + # A Configurations object represents how features should be configured for terminal readers. class Configuration < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/terminal/connection_token.rb b/lib/stripe/resources/terminal/connection_token.rb index 7459a020c..d39a8ae10 100644 --- a/lib/stripe/resources/terminal/connection_token.rb +++ b/lib/stripe/resources/terminal/connection_token.rb @@ -3,6 +3,9 @@ module Stripe module Terminal + # A Connection Token is used by the Stripe Terminal SDK to connect to a reader. + # + # Related guide: [Fleet Management](https://stripe.com/docs/terminal/fleet/locations). class ConnectionToken < APIResource extend Stripe::APIOperations::Create diff --git a/lib/stripe/resources/terminal/location.rb b/lib/stripe/resources/terminal/location.rb index 193ecba4c..1fbcb6e96 100644 --- a/lib/stripe/resources/terminal/location.rb +++ b/lib/stripe/resources/terminal/location.rb @@ -3,6 +3,9 @@ module Stripe module Terminal + # A Location represents a grouping of readers. + # + # Related guide: [Fleet Management](https://stripe.com/docs/terminal/fleet/locations). class Location < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/terminal/reader.rb b/lib/stripe/resources/terminal/reader.rb index 52d088977..743368e33 100644 --- a/lib/stripe/resources/terminal/reader.rb +++ b/lib/stripe/resources/terminal/reader.rb @@ -3,6 +3,9 @@ module Stripe module Terminal + # A Reader represents a physical device for accepting payment details. + # + # Related guide: [Connecting to a Reader](https://stripe.com/docs/terminal/payments/connect-reader). class Reader < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/test_helpers/test_clock.rb b/lib/stripe/resources/test_helpers/test_clock.rb index 3f93e56ec..c2fd34ddb 100644 --- a/lib/stripe/resources/test_helpers/test_clock.rb +++ b/lib/stripe/resources/test_helpers/test_clock.rb @@ -3,6 +3,9 @@ module Stripe module TestHelpers + # A test clock enables deterministic control over objects in testmode. With a test clock, you can create + # objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, + # you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. class TestClock < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/token.rb b/lib/stripe/resources/token.rb index f9186e872..9cf981697 100644 --- a/lib/stripe/resources/token.rb +++ b/lib/stripe/resources/token.rb @@ -2,6 +2,28 @@ # frozen_string_literal: true module Stripe + # Tokenization is the process Stripe uses to collect sensitive card or bank + # account details, or personally identifiable information (PII), directly from + # your customers in a secure manner. A token representing this information is + # returned to your server to use. You should use our + # [recommended payments integrations](https://stripe.com/docs/payments) to perform this process + # client-side. This ensures that no sensitive card data touches your server, + # and allows your integration to operate in a PCI-compliant way. + # + # If you cannot use client-side tokenization, you can also create tokens using + # the API with either your publishable or secret API key. Keep in mind that if + # your integration uses this method, you are responsible for any PCI compliance + # that may be required, and you must keep your secret API key safe. Unlike with + # client-side tokenization, your customer's information is not sent directly to + # Stripe, so we cannot determine how it is handled or stored. + # + # Tokens cannot be stored or used more than once. To store card or bank account + # information for later use, you can create [Customer](https://stripe.com/docs/api#customers) + # objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). Note that + # [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, + # performs best with integrations that use client-side tokenization. + # + # Related guide: [Accept a payment](https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token) class Token < APIResource extend Stripe::APIOperations::Create diff --git a/lib/stripe/resources/topup.rb b/lib/stripe/resources/topup.rb index 22e6c9079..17491878b 100644 --- a/lib/stripe/resources/topup.rb +++ b/lib/stripe/resources/topup.rb @@ -2,6 +2,11 @@ # frozen_string_literal: true module Stripe + # To top up your Stripe balance, you create a top-up object. You can retrieve + # individual top-ups, as well as list all top-ups. Top-ups are identified by a + # unique, random ID. + # + # Related guide: [Topping Up your Platform Account](https://stripe.com/docs/connect/top-ups). class Topup < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/transfer.rb b/lib/stripe/resources/transfer.rb index 7d8420dba..6742ac9d5 100644 --- a/lib/stripe/resources/transfer.rb +++ b/lib/stripe/resources/transfer.rb @@ -2,6 +2,16 @@ # frozen_string_literal: true module Stripe + # A `Transfer` object is created when you move funds between Stripe accounts as + # part of Connect. + # + # Before April 6, 2017, transfers also represented movement of funds from a + # Stripe account to a card or bank account. This behavior has since been split + # out into a [Payout](https://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. For more + # information, read about the + # [transfer/payout split](https://stripe.com/docs/transfer-payout-split). + # + # Related guide: [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers). class Transfer < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/credit_reversal.rb b/lib/stripe/resources/treasury/credit_reversal.rb index 8a4d76a27..f1fe0f4a5 100644 --- a/lib/stripe/resources/treasury/credit_reversal.rb +++ b/lib/stripe/resources/treasury/credit_reversal.rb @@ -3,6 +3,7 @@ module Stripe module Treasury + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. class CreditReversal < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/debit_reversal.rb b/lib/stripe/resources/treasury/debit_reversal.rb index a16838c2a..42a50016d 100644 --- a/lib/stripe/resources/treasury/debit_reversal.rb +++ b/lib/stripe/resources/treasury/debit_reversal.rb @@ -3,6 +3,7 @@ module Stripe module Treasury + # You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. class DebitReversal < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/financial_account.rb b/lib/stripe/resources/treasury/financial_account.rb index 9a9d42773..24c4b3014 100644 --- a/lib/stripe/resources/treasury/financial_account.rb +++ b/lib/stripe/resources/treasury/financial_account.rb @@ -3,6 +3,8 @@ module Stripe module Treasury + # Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. + # FinancialAccounts serve as the source and destination of Treasury's money movement APIs. class FinancialAccount < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/inbound_transfer.rb b/lib/stripe/resources/treasury/inbound_transfer.rb index 57f23e027..659c74f48 100644 --- a/lib/stripe/resources/treasury/inbound_transfer.rb +++ b/lib/stripe/resources/treasury/inbound_transfer.rb @@ -3,6 +3,7 @@ module Stripe module Treasury + # Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. class InboundTransfer < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/outbound_payment.rb b/lib/stripe/resources/treasury/outbound_payment.rb index d87e666f1..aaa116a53 100644 --- a/lib/stripe/resources/treasury/outbound_payment.rb +++ b/lib/stripe/resources/treasury/outbound_payment.rb @@ -3,6 +3,9 @@ module Stripe module Treasury + # Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. class OutboundPayment < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/outbound_transfer.rb b/lib/stripe/resources/treasury/outbound_transfer.rb index 48e74f663..82c39ac05 100644 --- a/lib/stripe/resources/treasury/outbound_transfer.rb +++ b/lib/stripe/resources/treasury/outbound_transfer.rb @@ -3,6 +3,9 @@ module Stripe module Treasury + # Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + # + # Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. class OutboundTransfer < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/received_credit.rb b/lib/stripe/resources/treasury/received_credit.rb index 525ba434d..1f39ae301 100644 --- a/lib/stripe/resources/treasury/received_credit.rb +++ b/lib/stripe/resources/treasury/received_credit.rb @@ -3,6 +3,7 @@ module Stripe module Treasury + # ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. class ReceivedCredit < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/received_debit.rb b/lib/stripe/resources/treasury/received_debit.rb index 3889c6f05..343301b55 100644 --- a/lib/stripe/resources/treasury/received_debit.rb +++ b/lib/stripe/resources/treasury/received_debit.rb @@ -3,6 +3,7 @@ module Stripe module Treasury + # ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. class ReceivedDebit < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/transaction.rb b/lib/stripe/resources/treasury/transaction.rb index edcaf283e..b4a3ab115 100644 --- a/lib/stripe/resources/treasury/transaction.rb +++ b/lib/stripe/resources/treasury/transaction.rb @@ -3,6 +3,7 @@ module Stripe module Treasury + # Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance. class Transaction < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/treasury/transaction_entry.rb b/lib/stripe/resources/treasury/transaction_entry.rb index beaca6416..1e5795cae 100644 --- a/lib/stripe/resources/treasury/transaction_entry.rb +++ b/lib/stripe/resources/treasury/transaction_entry.rb @@ -3,6 +3,7 @@ module Stripe module Treasury + # TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions). class TransactionEntry < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/usage_record.rb b/lib/stripe/resources/usage_record.rb index fc212fdcf..3ea3ce3a4 100644 --- a/lib/stripe/resources/usage_record.rb +++ b/lib/stripe/resources/usage_record.rb @@ -2,6 +2,10 @@ # frozen_string_literal: true module Stripe + # Usage records allow you to report customer usage and metrics to Stripe for + # metered billing of subscription prices. + # + # Related guide: [Metered Billing](https://stripe.com/docs/billing/subscriptions/metered-billing). class UsageRecord < APIResource OBJECT_NAME = "usage_record" end diff --git a/lib/stripe/resources/webhook_endpoint.rb b/lib/stripe/resources/webhook_endpoint.rb index b4aa9b399..77daef502 100644 --- a/lib/stripe/resources/webhook_endpoint.rb +++ b/lib/stripe/resources/webhook_endpoint.rb @@ -2,6 +2,13 @@ # frozen_string_literal: true module Stripe + # You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be + # notified about events that happen in your Stripe account or connected + # accounts. + # + # Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. + # + # Related guide: [Setting up Webhooks](https://stripe.com/docs/webhooks/configure). class WebhookEndpoint < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete From 53ab9bf668fff272ac33e6f444f49cd5598bc606 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:34:02 -0700 Subject: [PATCH 02/10] Add beta readme.md section (#1121) --- README.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fb22ace67..910d481eb 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,6 @@ The library also provides other features. For example: - Built-in mechanisms for the serialization of parameters according to the expectations of Stripe's API. -## Support - -New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. - ## Documentation See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby). @@ -297,6 +293,30 @@ You can disable this behavior if you prefer: Stripe.enable_telemetry = false ``` +### Beta SDKs + +Stripe has features in the beta phase that can be accessed via the beta version of this package. +We would love for you to try these and share feedback with us before these features reach the stable phase. +To install a beta version use `gem install` with the exact version you'd like to use: + +```sh +gem install stripe -v 7.1.0.pre.beta.2 +``` + +> Note: There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your Gemfile. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. + +We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. + +If your beta feature requires a `Stripe-Version` header to be sent, use the `Stripe.api_version` field to set it: + +```python +Stripe.api_version += "; feature_beta=v3" +``` + +## Support + +New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. + ## Development The test suite depends on [stripe-mock], so make sure to fetch and run it from a From 78863b4b0ffc7eecad02165c8df6d28fd0470788 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 24 Aug 2022 08:57:58 -0700 Subject: [PATCH 03/10] Update README.md (#1125) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 910d481eb..bc2401460 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,8 @@ To install a beta version use `gem install` with the exact version you'd like to gem install stripe -v 7.1.0.pre.beta.2 ``` -> Note: There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your Gemfile. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. +> **Note** +> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your Gemfile. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. From 2076cfd42e2a85fad8ebe221732b1f57ac8eef51 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Wed, 24 Aug 2022 09:56:47 -0700 Subject: [PATCH 04/10] Add coveralls --- .github/workflows/ci.yml | 4 ++++ Gemfile | 1 + README.md | 1 + test/test_helper.rb | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 577ba1cb2..0784a7d9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,10 @@ jobs: run: docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5 - name: test run: bundle install && bundle exec rake test + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + COVERALLS_SERVICE_NAME: github-action publish: name: Publish diff --git a/Gemfile b/Gemfile index ab22a8a0e..450146e6f 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ source "https://rubygems.org" gemspec group :development do + gem "coveralls_reborn", "~> 0.25.0" if RUBY_VERSION >= "3.1" gem "mocha", "~> 0.13.2" gem "rack", ">= 2.0.6" gem "rake" diff --git a/README.md b/README.md index bc2401460..e32af3dd7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Gem Version](https://badge.fury.io/rb/stripe.svg)](https://badge.fury.io/rb/stripe) [![Build Status](https://github.com/stripe/stripe-ruby/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-ruby/actions?query=branch%3Amaster) +[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-ruby/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-ruby?branch=master) The Stripe Ruby library provides convenient access to the Stripe API from applications written in the Ruby language. It includes a pre-defined set of diff --git a/test/test_helper.rb b/test/test_helper.rb index 7af834b0e..55650ede9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,5 +1,10 @@ # frozen_string_literal: true +if RUBY_VERSION >= "3.1" + require "coveralls" + Coveralls.wear! +end + require "stripe" require "test/unit" require "mocha/setup" From f6474127896c7d0e812f9f0e6b6cd2aadaf682dd Mon Sep 17 00:00:00 2001 From: Annie Li Date: Wed, 24 Aug 2022 10:56:47 -0700 Subject: [PATCH 05/10] Add comment and change to starts_with --- test/test_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 55650ede9..555105f7d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true -if RUBY_VERSION >= "3.1" +# Report test coverage to coveralls for only one Ruby version to avoid +# repeated builds. This also accounts for coveralls_reborn requiring +# RUBY_VERSION >= 2.5. +if RUBY_VERSION.start_with?("3.1") require "coveralls" Coveralls.wear! end From dc93d96cb9646ea782e9efe597a1e0ddd6b1a707 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Wed, 24 Aug 2022 11:01:48 -0700 Subject: [PATCH 06/10] Change check to 3.1. --- test/test_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 555105f7d..4876b9fba 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -3,7 +3,7 @@ # Report test coverage to coveralls for only one Ruby version to avoid # repeated builds. This also accounts for coveralls_reborn requiring # RUBY_VERSION >= 2.5. -if RUBY_VERSION.start_with?("3.1") +if RUBY_VERSION.start_with?("3.1.") require "coveralls" Coveralls.wear! end From 4d87c3af1e34be04e46f20b8a6178c4531f95deb Mon Sep 17 00:00:00 2001 From: Annie Li Date: Wed, 24 Aug 2022 11:55:55 -0700 Subject: [PATCH 07/10] Restart CI due to Github Actions incident From 0b67ca31979a7a15b02431f0c6785ce3dac447dc Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Wed, 24 Aug 2022 16:04:14 -0400 Subject: [PATCH 08/10] Set version to 7.1.0 to simplify merge --- VERSION | 2 +- lib/stripe/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index c3a98f61f..a3fcc7121 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.2.0-beta.1 +7.1.0 diff --git a/lib/stripe/version.rb b/lib/stripe/version.rb index c263f6369..95f1f764b 100644 --- a/lib/stripe/version.rb +++ b/lib/stripe/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stripe - VERSION = "7.2.0-beta.1" + VERSION = "7.1.0" end From bf05d0ce43051daca71eaf88caec00f47f11aa14 Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Wed, 24 Aug 2022 16:04:14 -0400 Subject: [PATCH 09/10] Reset version to 7.2.0-beta.1 --- VERSION | 2 +- lib/stripe/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index a3fcc7121..c3a98f61f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.1.0 +7.2.0-beta.1 diff --git a/lib/stripe/version.rb b/lib/stripe/version.rb index 95f1f764b..c263f6369 100644 --- a/lib/stripe/version.rb +++ b/lib/stripe/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stripe - VERSION = "7.1.0" + VERSION = "7.2.0-beta.1" end From 3c78633ce80372b5fe30513ddfa06fc05ddfed5b Mon Sep 17 00:00:00 2001 From: Dominic Charley-Roy Date: Wed, 24 Aug 2022 16:04:45 -0400 Subject: [PATCH 10/10] Codegen for openapi v185 --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 2 + lib/stripe/resources.rb | 2 + lib/stripe/resources/gift_cards/card.rb | 25 +++++++++ .../resources/gift_cards/transaction.rb | 56 +++++++++++++++++++ 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 lib/stripe/resources/gift_cards/card.rb create mode 100644 lib/stripe/resources/gift_cards/transaction.rb diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c13f8f959..073a3a984 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v184 \ No newline at end of file +v185 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 537907f54..adb9f6483 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -50,6 +50,8 @@ def self.object_names_to_classes FinancialConnections::AccountOwnership, FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session, FundingInstructions::OBJECT_NAME => FundingInstructions, + GiftCards::Card::OBJECT_NAME => GiftCards::Card, + GiftCards::Transaction::OBJECT_NAME => GiftCards::Transaction, Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport, Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession, Invoice::OBJECT_NAME => Invoice, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 56201e4c9..1eb054eb7 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -37,6 +37,8 @@ require "stripe/resources/financial_connections/account_ownership" require "stripe/resources/financial_connections/session" require "stripe/resources/funding_instructions" +require "stripe/resources/gift_cards/card" +require "stripe/resources/gift_cards/transaction" require "stripe/resources/identity/verification_report" require "stripe/resources/identity/verification_session" require "stripe/resources/invoice" diff --git a/lib/stripe/resources/gift_cards/card.rb b/lib/stripe/resources/gift_cards/card.rb new file mode 100644 index 000000000..3d1dae626 --- /dev/null +++ b/lib/stripe/resources/gift_cards/card.rb @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module GiftCards + # A gift card represents a single gift card owned by a customer, including the + # remaining balance, gift card code, and whether or not it is active. + class Card < APIResource + extend Stripe::APIOperations::Create + extend Stripe::APIOperations::List + include Stripe::APIOperations::Save + + OBJECT_NAME = "gift_cards.card" + + def self.validate(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: "/v1/gift_cards/cards/validate", + params: params, + opts: opts + ) + end + end + end +end diff --git a/lib/stripe/resources/gift_cards/transaction.rb b/lib/stripe/resources/gift_cards/transaction.rb new file mode 100644 index 000000000..6592ccb66 --- /dev/null +++ b/lib/stripe/resources/gift_cards/transaction.rb @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module GiftCards + # A gift card transaction represents a single transaction on a referenced gift card. + # A transaction is in one of three states, `confirmed`, `held` or `canceled`. A `confirmed` + # transaction is one that has added/deducted funds. A `held` transaction has created a + # temporary hold on funds, which can then be cancelled or confirmed. A `held` transaction + # can be confirmed into a `confirmed` transaction, or canceled into a `canceled` transaction. + # A `canceled` transaction has no effect on a gift card's balance. + class Transaction < APIResource + extend Stripe::APIOperations::Create + extend Stripe::APIOperations::List + include Stripe::APIOperations::Save + + OBJECT_NAME = "gift_cards.transaction" + + def cancel(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/gift_cards/transactions/%s/cancel", { id: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + def confirm(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/gift_cards/transactions/%s/confirm", { id: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + def self.cancel(id, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/gift_cards/transactions/%s/cancel", { id: CGI.escape(id) }), + params: params, + opts: opts + ) + end + + def self.confirm(id, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/gift_cards/transactions/%s/confirm", { id: CGI.escape(id) }), + params: params, + opts: opts + ) + end + end + end +end