Skip to content

Commit

Permalink
API Updates (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe authored Aug 23, 2022
1 parent cb53c3b commit cfeaa0c
Show file tree
Hide file tree
Showing 94 changed files with 519 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v183
v184
6 changes: 6 additions & 0 deletions lib/stripe/resources/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/stripe/resources/account_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions lib/stripe/resources/application_fee_refund.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions lib/stripe/resources/apps/secret.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions lib/stripe/resources/balance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/stripe/resources/balance_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions lib/stripe/resources/bank_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources/billing_portal/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions lib/stripe/resources/billing_portal/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/resources/capability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/stripe/resources/card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources/cash_balance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 5 additions & 0 deletions lib/stripe/resources/charge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions lib/stripe/resources/checkout/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions lib/stripe/resources/country_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/resources/coupon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/resources/credit_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/resources/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions lib/stripe/resources/customer_balance_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/stripe/resources/customer_cash_balance_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions lib/stripe/resources/discount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions lib/stripe/resources/dispute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions lib/stripe/resources/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions lib/stripe/resources/exchange_rate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions lib/stripe/resources/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/resources/file_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources/financial_connections/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources/financial_connections/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions lib/stripe/resources/funding_instructions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Loading

0 comments on commit cfeaa0c

Please sign in to comment.