Skip to content

Commit

Permalink
Update generated code (#1448)
Browse files Browse the repository at this point in the history
* Update generated code for v1261

* Update generated code for v1268

* Update generated code for v1268

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Sep 26, 2024
1 parent 07ee576 commit b1fe348
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 21 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1255
v1268
2 changes: 1 addition & 1 deletion lib/stripe/api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Stripe
module ApiVersion
CURRENT = "2024-06-20"
CURRENT = "2024-09-30.acacia"
end
end
3 changes: 3 additions & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def self.object_names_to_classes
BalanceTransaction.object_name => BalanceTransaction,
BankAccount.object_name => BankAccount,
Billing::Alert.object_name => Billing::Alert,
Billing::CreditBalanceSummary.object_name => Billing::CreditBalanceSummary,
Billing::CreditBalanceTransaction.object_name => Billing::CreditBalanceTransaction,
Billing::CreditGrant.object_name => Billing::CreditGrant,
Billing::Meter.object_name => Billing::Meter,
Billing::MeterEvent.object_name => Billing::MeterEvent,
Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
require "stripe/resources/balance_transaction"
require "stripe/resources/bank_account"
require "stripe/resources/billing/alert"
require "stripe/resources/billing/credit_balance_summary"
require "stripe/resources/billing/credit_balance_transaction"
require "stripe/resources/billing/credit_grant"
require "stripe/resources/billing/meter"
require "stripe/resources/billing/meter_event"
require "stripe/resources/billing/meter_event_adjustment"
Expand Down
14 changes: 14 additions & 0 deletions lib/stripe/resources/billing/credit_balance_summary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Billing
# Indicates the credit balance for credits granted to a customer.
class CreditBalanceSummary < SingletonAPIResource
OBJECT_NAME = "billing.credit_balance_summary"
def self.object_name
"billing.credit_balance_summary"
end
end
end
end
26 changes: 26 additions & 0 deletions lib/stripe/resources/billing/credit_balance_transaction.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Billing
# A credit balance transaction is a resource representing a transaction (either a credit or a debit) against an existing credit grant.
class CreditBalanceTransaction < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "billing.credit_balance_transaction"
def self.object_name
"billing.credit_balance_transaction"
end

# Retrieve a list of credit balance transactions
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/billing/credit_balance_transactions",
params: filters,
opts: opts
)
end
end
end
end
88 changes: 88 additions & 0 deletions lib/stripe/resources/billing/credit_grant.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Billing
# A credit grant is a resource that records a grant of some credit to a customer.
class CreditGrant < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

OBJECT_NAME = "billing.credit_grant"
def self.object_name
"billing.credit_grant"
end

# Creates a credit grant
def self.create(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/billing/credit_grants",
params: params,
opts: opts
)
end

# Expires a credit grant
def expire(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/credit_grants/%<id>s/expire", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

# Expires a credit grant
def self.expire(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/credit_grants/%<id>s/expire", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end

# Retrieve a list of credit grants
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/billing/credit_grants",
params: filters,
opts: opts
)
end

# Updates a credit grant
def self.update(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/credit_grants/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end

# Voids a credit grant
def void_grant(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/credit_grants/%<id>s/void", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

# Voids a credit grant
def self.void_grant(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/credit_grants/%<id>s/void", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
end
end
end
5 changes: 2 additions & 3 deletions lib/stripe/resources/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
# frozen_string_literal: true

module Stripe
# This object represents a customer of your business. Use it to 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)
# This object represents a customer of your business. Use it to [create recurring charges](https://stripe.com/docs/invoicing/customer), [save payment](https://stripe.com/docs/payments/save-during-payment) and contact information,
# and track payments that belong to the same customer.
class Customer < APIResource
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Delete
Expand Down
2 changes: 2 additions & 0 deletions lib/stripe/resources/invoice_rendering_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# frozen_string_literal: true

module Stripe
# Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates
# can be created from within the Dashboard, and they can be used over the API when creating invoices.
class InvoiceRenderingTemplate < APIResource
extend Stripe::APIOperations::List

Expand Down
12 changes: 6 additions & 6 deletions lib/stripe/resources/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def self.object_name
"subscription"
end

# Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
# Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://stripe.com/metadata).
#
# Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
# Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed.
#
# By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
# By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
def cancel(params = {}, opts = {})
request_stripe_object(
method: :delete,
Expand All @@ -30,11 +30,11 @@ def cancel(params = {}, opts = {})
)
end

# Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
# Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://stripe.com/metadata).
#
# Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
# Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed.
#
# By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
# By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
def self.cancel(subscription_exposed_id, params = {}, opts = {})
request_stripe_object(
method: :delete,
Expand Down
10 changes: 0 additions & 10 deletions test/stripe/generated_examples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1813,16 +1813,6 @@ class CodegennedExampleTest < Test::Unit::TestCase
)
assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent"
end
should "Test terminal readers process setup intent post" do
Stripe::Terminal::Reader.process_setup_intent(
"tmr_xxxxxxxxxxxxx",
{
setup_intent: "seti_xxxxxxxxxxxxx",
customer_consent_collected: true,
}
)
assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent"
end
should "Test test helpers customers fund cash balance post" do
Stripe::Customer::TestHelpers.fund_cash_balance(
"cus_123",
Expand Down

0 comments on commit b1fe348

Please sign in to comment.