Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1305

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 10.5.0 - 2024-01-04
* [#1306](https://github.com/stripe/stripe-ruby/pull/1306) Update generated code
* Add support for `retrieve` method on resource `Tax.Registration`

## 10.5.0-beta.1 - 2023-12-22
* [#1302](https://github.com/stripe/stripe-ruby/pull/1302) Update generated code for beta

Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v737
v742
8 changes: 8 additions & 0 deletions lib/stripe/resources/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Account < APIResource
resource_plural: "capabilities"
nested_resource_class_methods :person, operations: %i[create retrieve update delete list]

# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
def persons(params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -34,6 +35,9 @@ def persons(params = {}, opts = {})
)
end

# With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
#
# Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
def reject(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -43,6 +47,7 @@ def reject(params = {}, opts = {})
)
end

# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
def self.persons(account, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -52,6 +57,9 @@ def self.persons(account, params = {}, opts = {})
)
end

# With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
#
# Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
def self.reject(account, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
2 changes: 2 additions & 0 deletions lib/stripe/resources/apps/secret.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Secret < APIResource

OBJECT_NAME = "apps.secret"

# Deletes a secret from the secret store by name and scope.
def self.delete_where(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -27,6 +28,7 @@ def self.delete_where(params = {}, opts = {})
)
end

# Finds a secret in the secret store by name and scope.
def self.find(params = {}, opts = {})
request_stripe_object(
method: :get,
Expand Down
4 changes: 4 additions & 0 deletions lib/stripe/resources/capital/financing_offer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class FinancingOffer < APIResource

OBJECT_NAME = "capital.financing_offer"

# Acknowledges that platform has received and delivered the financing_offer to
# the intended merchant recipient.
def mark_delivered(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -19,6 +21,8 @@ def mark_delivered(params = {}, opts = {})
)
end

# Acknowledges that platform has received and delivered the financing_offer to
# the intended merchant recipient.
def self.mark_delivered(financing_offer, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
10 changes: 10 additions & 0 deletions lib/stripe/resources/charge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class Charge < APIResource

OBJECT_NAME = "charge"

# Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.
#
# Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail.
#
# Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture).
def capture(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -23,6 +28,11 @@ def capture(params = {}, opts = {})
)
end

# Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.
#
# Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail.
#
# Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture).
def self.capture(charge, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
8 changes: 8 additions & 0 deletions lib/stripe/resources/checkout/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class Session < APIResource

OBJECT_NAME = "checkout.session"

# A Session can be expired when it is in one of these statuses: open
#
# After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
def expire(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -32,6 +35,7 @@ def expire(params = {}, opts = {})
)
end

# When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
def list_line_items(params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -41,6 +45,9 @@ def list_line_items(params = {}, opts = {})
)
end

# A Session can be expired when it is in one of these statuses: open
#
# After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
def self.expire(session, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -50,6 +57,7 @@ def self.expire(session, params = {}, opts = {})
)
end

# When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
def self.list_line_items(session, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand Down
8 changes: 8 additions & 0 deletions lib/stripe/resources/climate/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class Order < APIResource

OBJECT_NAME = "climate.order"

# Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the
# reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
# might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe
# provides 90 days advance notice and refunds the amount_total.
def cancel(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -21,6 +25,10 @@ def cancel(params = {}, opts = {})
)
end

# Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the
# reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
# might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe
# provides 90 days advance notice and refunds the amount_total.
def self.cancel(order, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
4 changes: 4 additions & 0 deletions lib/stripe/resources/credit_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CreditNote < APIResource

OBJECT_NAME = "credit_note"

# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
def void_credit_note(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -21,6 +22,7 @@ def void_credit_note(params = {}, opts = {})
)
end

# When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
def self.list_preview_line_items(params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -30,6 +32,7 @@ def self.list_preview_line_items(params = {}, opts = {})
)
end

# Get a preview of a credit note without creating it.
def self.preview(params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -39,6 +42,7 @@ def self.preview(params = {}, opts = {})
)
end

# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
def self.void_credit_note(id, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
16 changes: 16 additions & 0 deletions lib/stripe/resources/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class Customer < APIResource
nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]

# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
def create_funding_instructions(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -28,6 +31,7 @@ def create_funding_instructions(params = {}, opts = {})
)
end

# Removes the currently applied discount on a customer.
def delete_discount(params = {}, opts = {})
request_stripe_object(
method: :delete,
Expand All @@ -37,6 +41,7 @@ def delete_discount(params = {}, opts = {})
)
end

# Returns a list of PaymentMethods for a given Customer
def list_payment_methods(params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -46,6 +51,7 @@ def list_payment_methods(params = {}, opts = {})
)
end

# Retrieves a PaymentMethod object for a given Customer.
def retrieve_payment_method(payment_method, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -55,6 +61,9 @@ def retrieve_payment_method(payment_method, params = {}, opts = {})
)
end

# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
def self.create_funding_instructions(customer, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -64,6 +73,7 @@ def self.create_funding_instructions(customer, params = {}, opts = {})
)
end

# Removes the currently applied discount on a customer.
def self.delete_discount(customer, params = {}, opts = {})
request_stripe_object(
method: :delete,
Expand All @@ -73,6 +83,7 @@ def self.delete_discount(customer, params = {}, opts = {})
)
end

# Returns a list of PaymentMethods for a given Customer
def self.list_payment_methods(customer, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -82,6 +93,7 @@ def self.list_payment_methods(customer, params = {}, opts = {})
)
end

# Retrieves a PaymentMethod object for a given Customer.
def self.retrieve_payment_method(customer, payment_method, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand Down Expand Up @@ -109,6 +121,7 @@ def self.search_auto_paging_each(params = {}, opts = {}, &blk)
search(params, opts).auto_paging_each(&blk)
end

# Retrieves a customer's cash balance.
def self.retrieve_cash_balance(customer, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -118,6 +131,7 @@ def self.retrieve_cash_balance(customer, params = {}, opts = {})
)
end

# Changes the settings on a customer's cash balance.
def self.update_cash_balance(customer, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -134,6 +148,7 @@ def test_helpers
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Customer

# Create an incoming testmode bank transfer
def self.fund_cash_balance(customer, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -143,6 +158,7 @@ def self.fund_cash_balance(customer, params = {}, opts = {})
)
end

# Create an incoming testmode bank transfer
def fund_cash_balance(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
Expand Down
6 changes: 6 additions & 0 deletions lib/stripe/resources/dispute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class Dispute < APIResource

OBJECT_NAME = "dispute"

# Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
#
# The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.
def close(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -22,6 +25,9 @@ def close(params = {}, opts = {})
)
end

# Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
#
# The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.
def self.close(dispute, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
10 changes: 10 additions & 0 deletions lib/stripe/resources/financial_connections/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Account < APIResource

nested_resource_class_methods :inferred_balance, operations: %i[list]

# Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
def disconnect(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -21,6 +22,7 @@ def disconnect(params = {}, opts = {})
)
end

# Lists all owners for a given Account
def list_owners(params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -30,6 +32,7 @@ def list_owners(params = {}, opts = {})
)
end

# Refreshes the data associated with a Financial Connections Account.
def refresh_account(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -39,6 +42,7 @@ def refresh_account(params = {}, opts = {})
)
end

# Subscribes to periodic refreshes of data associated with a Financial Connections Account.
def subscribe(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -48,6 +52,7 @@ def subscribe(params = {}, opts = {})
)
end

# Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
def unsubscribe(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -57,6 +62,7 @@ def unsubscribe(params = {}, opts = {})
)
end

# Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
def self.disconnect(account, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -66,6 +72,7 @@ def self.disconnect(account, params = {}, opts = {})
)
end

# Lists all owners for a given Account
def self.list_owners(account, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -75,6 +82,7 @@ def self.list_owners(account, params = {}, opts = {})
)
end

# Refreshes the data associated with a Financial Connections Account.
def self.refresh_account(account, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -84,6 +92,7 @@ def self.refresh_account(account, params = {}, opts = {})
)
end

# Subscribes to periodic refreshes of data associated with a Financial Connections Account.
def self.subscribe(account, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -93,6 +102,7 @@ def self.subscribe(account, params = {}, opts = {})
)
end

# Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
def self.unsubscribe(account, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
Loading