Compare commits

...

7 Commits

Author SHA1 Message Date
stripe-openapi[bot]
a7d998ab2d
Merge pull request #1328 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-14 10:56:01 -08:00
Stripe OpenAPI
479d17b26a Merge upstream and update generated code for v827 2024-02-14 11:55:51 +00:00
helenye-stripe
06d1bfbc9b
Start running Sorbet in CI (#1324)
* Rebase

* Gemfile, makefile, sorbet
2024-02-12 15:23:36 -08:00
helenye-stripe
ce8d7ca4cc
Add methods for dynamically referenced constants (#1327)
* Update dynamic constant references

* Manual additionsg

* Fix lint

* Use const_Get

* Remove puts
2024-02-09 17:15:39 -08:00
Annie Li
bc375b791e Bump version to 10.8.0 2024-02-08 14:06:01 -08:00
stripe-openapi[bot]
0dc3414645
Update generated code for v810 (#1322)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com>
2024-02-08 21:11:54 +00:00
helenye-stripe
d22938897e
Extract other CRUDL methods from mixins (#1323) 2024-02-06 10:19:06 -08:00
205 changed files with 226102 additions and 149 deletions

View File

@ -4,6 +4,12 @@
* [#1321](https://github.com/stripe/stripe-ruby/pull/1321) Update generated code for beta
* Release specs are identical.
## 10.8.0 - 2024-02-08
* [#1322](https://github.com/stripe/stripe-ruby/pull/1322) Update generated code
* [#1323](https://github.com/stripe/stripe-ruby/pull/1323) Extract other CRUDL api operations from mixins
* Extract more CRUDL operations, namely `create`, `delete`, `update`, and `list` into the resources. These methods will no longer rely on the APIOperation mixins.
* [#1314](https://github.com/stripe/stripe-ruby/pull/1314) Update mocha gem to 1.16
## 10.8.0-beta.1 - 2024-02-01
* [#1318](https://github.com/stripe/stripe-ruby/pull/1318) Update generated code for beta
* Add support for new resources `Entitlements.Event` and `Entitlements.Feature`

View File

@ -31,6 +31,9 @@ group :development do
# don't install on truffleruby
gem "jaro_winkler", "1.5.4" unless RUBY_ENGINE == "truffleruby"
gem "sorbet-static"
gem "tapioca"
platforms :mri do
gem "byebug"
gem "pry"

View File

@ -9,5 +9,12 @@ codegen-format:
ci-test:
bundle install && bundle exec rake test
@version=$$(ruby -e "puts RUBY_VERSION.split('.')[0..1].join.to_i"); \
if [ $$version -ge 27 ]; then \
echo "Ruby version >= 2.7, continue with srb tc"; \
bundle exec srb tc; \
else \
echo "Ruby version < 2.7, skipping srb tc"; \
fi
test: ci-test

View File

@ -1 +1 @@
v810
v827

27
bin/tapioca Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'tapioca' is installed as part of a gem, and
# this file is here to facilitate running it.
#
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
bundle_binstub = File.expand_path("bundle", __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("tapioca", "tapioca")

View File

@ -11,6 +11,15 @@ module Stripe
# for example, where this is allowed.
attr_accessor :save_with_parent
# TODO: (major) Remove OBJECT_NAME and stop using const_get here
# This is a workaround to avoid breaking users who have defined their own
# APIResource subclasses with a custom OBJECT_NAME. We should never fallback
# on this case otherwise.
OBJECT_NAME = ""
def self.object_name
const_get(:OBJECT_NAME)
end
def self.class_name
name.split("::")[-1]
end
@ -23,7 +32,7 @@ module Stripe
end
# Namespaces are separated in object names with periods (.) and in URLs
# with forward slashes (/), so replace the former with the latter.
"/v1/#{self::OBJECT_NAME.downcase.tr('.', '/')}s"
"/v1/#{object_name.downcase.tr('.', '/')}s"
end
# A metaprogramming call that specifies that a field of a resource can be

View File

@ -14,6 +14,10 @@ module Stripe
@resource = resource
end
def self.resource_class
nil
end
# Adds a custom method to a test helper. This is used to add support for
# non-CRUDL API requests, e.g. capturing charges. custom_method takes the
# following parameters:
@ -27,12 +31,12 @@ module Stripe
# adds a `capture` class method to the resource class that, when called,
# will send a POST request to `/v1/<object_name>/capture`.
def self.custom_method(name, http_verb:, http_path: nil)
Util.custom_method self::RESOURCE_CLASS, self, name, http_verb, http_path
Util.custom_method resource_class, self, name, http_verb, http_path
end
def self.resource_url
"/v1/test_helpers/" \
"#{self::RESOURCE_CLASS::OBJECT_NAME.downcase.tr('.', '/')}s"
"#{resource_class.object_name.downcase.tr('.', '/')}s"
end
def resource_url

View File

@ -8,6 +8,9 @@ module Stripe
include Stripe::APIOperations::Create
OBJECT_NAME = "list"
def self.object_name
"list"
end
# This accessor allows a `ListObject` to inherit various filters that were
# given to a predecessor. This allows for things like consistent limits,

View File

@ -2,159 +2,161 @@
# frozen_string_literal: true
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
module Stripe
module ObjectTypes
def self.object_names_to_classes
{
# data structures
ListObject::OBJECT_NAME => ListObject,
SearchResultObject::OBJECT_NAME => SearchResultObject,
ListObject.object_name => ListObject,
SearchResultObject.object_name => SearchResultObject,
# business objects
File::OBJECT_NAME_ALT => File,
Account::OBJECT_NAME => Account,
AccountLink::OBJECT_NAME => AccountLink,
AccountNotice::OBJECT_NAME => AccountNotice,
AccountSession::OBJECT_NAME => AccountSession,
ApplePayDomain::OBJECT_NAME => ApplePayDomain,
ApplicationFee::OBJECT_NAME => ApplicationFee,
ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
Apps::Secret::OBJECT_NAME => Apps::Secret,
Balance::OBJECT_NAME => Balance,
BalanceTransaction::OBJECT_NAME => BalanceTransaction,
BankAccount::OBJECT_NAME => BankAccount,
BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
Capability::OBJECT_NAME => Capability,
Capital::FinancingOffer::OBJECT_NAME => Capital::FinancingOffer,
Capital::FinancingSummary::OBJECT_NAME => Capital::FinancingSummary,
Capital::FinancingTransaction::OBJECT_NAME => Capital::FinancingTransaction,
Card::OBJECT_NAME => Card,
CashBalance::OBJECT_NAME => CashBalance,
Charge::OBJECT_NAME => Charge,
Checkout::Session::OBJECT_NAME => Checkout::Session,
Climate::Order::OBJECT_NAME => Climate::Order,
Climate::Product::OBJECT_NAME => Climate::Product,
Climate::Supplier::OBJECT_NAME => Climate::Supplier,
ConfirmationToken::OBJECT_NAME => ConfirmationToken,
CountrySpec::OBJECT_NAME => CountrySpec,
Coupon::OBJECT_NAME => Coupon,
CreditNote::OBJECT_NAME => CreditNote,
CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem,
Customer::OBJECT_NAME => Customer,
CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
CustomerEntitlement::OBJECT_NAME => CustomerEntitlement,
CustomerEntitlementSummary::OBJECT_NAME => CustomerEntitlementSummary,
CustomerSession::OBJECT_NAME => CustomerSession,
Discount::OBJECT_NAME => Discount,
Dispute::OBJECT_NAME => Dispute,
Entitlements::Event::OBJECT_NAME => Entitlements::Event,
Entitlements::Feature::OBJECT_NAME => Entitlements::Feature,
EphemeralKey::OBJECT_NAME => EphemeralKey,
Event::OBJECT_NAME => Event,
ExchangeRate::OBJECT_NAME => ExchangeRate,
File::OBJECT_NAME => File,
FileLink::OBJECT_NAME => FileLink,
FinancialConnections::Account::OBJECT_NAME => FinancialConnections::Account,
FinancialConnections::AccountInferredBalance::OBJECT_NAME =>
File.object_name_alt => File,
Account.object_name => Account,
AccountLink.object_name => AccountLink,
AccountNotice.object_name => AccountNotice,
AccountSession.object_name => AccountSession,
ApplePayDomain.object_name => ApplePayDomain,
ApplicationFee.object_name => ApplicationFee,
ApplicationFeeRefund.object_name => ApplicationFeeRefund,
Apps::Secret.object_name => Apps::Secret,
Balance.object_name => Balance,
BalanceTransaction.object_name => BalanceTransaction,
BankAccount.object_name => BankAccount,
BillingPortal::Configuration.object_name => BillingPortal::Configuration,
BillingPortal::Session.object_name => BillingPortal::Session,
Capability.object_name => Capability,
Capital::FinancingOffer.object_name => Capital::FinancingOffer,
Capital::FinancingSummary.object_name => Capital::FinancingSummary,
Capital::FinancingTransaction.object_name => Capital::FinancingTransaction,
Card.object_name => Card,
CashBalance.object_name => CashBalance,
Charge.object_name => Charge,
Checkout::Session.object_name => Checkout::Session,
Climate::Order.object_name => Climate::Order,
Climate::Product.object_name => Climate::Product,
Climate::Supplier.object_name => Climate::Supplier,
ConfirmationToken.object_name => ConfirmationToken,
CountrySpec.object_name => CountrySpec,
Coupon.object_name => Coupon,
CreditNote.object_name => CreditNote,
CreditNoteLineItem.object_name => CreditNoteLineItem,
Customer.object_name => Customer,
CustomerBalanceTransaction.object_name => CustomerBalanceTransaction,
CustomerCashBalanceTransaction.object_name => CustomerCashBalanceTransaction,
CustomerEntitlement.object_name => CustomerEntitlement,
CustomerEntitlementSummary.object_name => CustomerEntitlementSummary,
CustomerSession.object_name => CustomerSession,
Discount.object_name => Discount,
Dispute.object_name => Dispute,
Entitlements::Event.object_name => Entitlements::Event,
Entitlements::Feature.object_name => Entitlements::Feature,
EphemeralKey.object_name => EphemeralKey,
Event.object_name => Event,
ExchangeRate.object_name => ExchangeRate,
File.object_name => File,
FileLink.object_name => FileLink,
FinancialConnections::Account.object_name => FinancialConnections::Account,
FinancialConnections::AccountInferredBalance.object_name =>
FinancialConnections::AccountInferredBalance,
FinancialConnections::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner,
FinancialConnections::AccountOwnership::OBJECT_NAME =>
FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
FinancialConnections::AccountOwnership.object_name =>
FinancialConnections::AccountOwnership,
FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
FinancialConnections::Transaction::OBJECT_NAME => FinancialConnections::Transaction,
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,
InvoiceItem::OBJECT_NAME => InvoiceItem,
InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
InvoicePayment::OBJECT_NAME => InvoicePayment,
Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
Issuing::Card::OBJECT_NAME => Issuing::Card,
Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
Issuing::CreditUnderwritingRecord::OBJECT_NAME => Issuing::CreditUnderwritingRecord,
Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
Issuing::PersonalizationDesign::OBJECT_NAME => Issuing::PersonalizationDesign,
Issuing::PhysicalBundle::OBJECT_NAME => Issuing::PhysicalBundle,
Issuing::Token::OBJECT_NAME => Issuing::Token,
Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
LineItem::OBJECT_NAME => LineItem,
LoginLink::OBJECT_NAME => LoginLink,
Mandate::OBJECT_NAME => Mandate,
Margin::OBJECT_NAME => Margin,
Order::OBJECT_NAME => Order,
PaymentIntent::OBJECT_NAME => PaymentIntent,
PaymentLink::OBJECT_NAME => PaymentLink,
PaymentMethod::OBJECT_NAME => PaymentMethod,
PaymentMethodConfiguration::OBJECT_NAME => PaymentMethodConfiguration,
PaymentMethodDomain::OBJECT_NAME => PaymentMethodDomain,
Payout::OBJECT_NAME => Payout,
Person::OBJECT_NAME => Person,
Plan::OBJECT_NAME => Plan,
Price::OBJECT_NAME => Price,
Product::OBJECT_NAME => Product,
PromotionCode::OBJECT_NAME => PromotionCode,
Quote::OBJECT_NAME => Quote,
QuotePhase::OBJECT_NAME => QuotePhase,
QuotePreviewInvoice::OBJECT_NAME => QuotePreviewInvoice,
QuotePreviewSubscriptionSchedule::OBJECT_NAME => QuotePreviewSubscriptionSchedule,
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
Refund::OBJECT_NAME => Refund,
Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
Reversal::OBJECT_NAME => Reversal,
Review::OBJECT_NAME => Review,
SetupAttempt::OBJECT_NAME => SetupAttempt,
SetupIntent::OBJECT_NAME => SetupIntent,
ShippingRate::OBJECT_NAME => ShippingRate,
Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
Source::OBJECT_NAME => Source,
SourceTransaction::OBJECT_NAME => SourceTransaction,
Subscription::OBJECT_NAME => Subscription,
SubscriptionItem::OBJECT_NAME => SubscriptionItem,
SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
Tax::Calculation::OBJECT_NAME => Tax::Calculation,
Tax::CalculationLineItem::OBJECT_NAME => Tax::CalculationLineItem,
Tax::Form::OBJECT_NAME => Tax::Form,
Tax::Registration::OBJECT_NAME => Tax::Registration,
Tax::Settings::OBJECT_NAME => Tax::Settings,
Tax::Transaction::OBJECT_NAME => Tax::Transaction,
Tax::TransactionLineItem::OBJECT_NAME => Tax::TransactionLineItem,
TaxCode::OBJECT_NAME => TaxCode,
TaxId::OBJECT_NAME => TaxId,
TaxRate::OBJECT_NAME => TaxRate,
Terminal::Configuration::OBJECT_NAME => Terminal::Configuration,
Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
Terminal::Location::OBJECT_NAME => Terminal::Location,
Terminal::Reader::OBJECT_NAME => Terminal::Reader,
TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
Token::OBJECT_NAME => Token,
Topup::OBJECT_NAME => Topup,
Transfer::OBJECT_NAME => Transfer,
Treasury::CreditReversal::OBJECT_NAME => Treasury::CreditReversal,
Treasury::DebitReversal::OBJECT_NAME => Treasury::DebitReversal,
Treasury::FinancialAccount::OBJECT_NAME => Treasury::FinancialAccount,
Treasury::FinancialAccountFeatures::OBJECT_NAME => Treasury::FinancialAccountFeatures,
Treasury::InboundTransfer::OBJECT_NAME => Treasury::InboundTransfer,
Treasury::OutboundPayment::OBJECT_NAME => Treasury::OutboundPayment,
Treasury::OutboundTransfer::OBJECT_NAME => Treasury::OutboundTransfer,
Treasury::ReceivedCredit::OBJECT_NAME => Treasury::ReceivedCredit,
Treasury::ReceivedDebit::OBJECT_NAME => Treasury::ReceivedDebit,
Treasury::Transaction::OBJECT_NAME => Treasury::Transaction,
Treasury::TransactionEntry::OBJECT_NAME => Treasury::TransactionEntry,
UsageRecord::OBJECT_NAME => UsageRecord,
UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
WebhookEndpoint::OBJECT_NAME => WebhookEndpoint,
FinancialConnections::Session.object_name => FinancialConnections::Session,
FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
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,
InvoiceItem.object_name => InvoiceItem,
InvoiceLineItem.object_name => InvoiceLineItem,
InvoicePayment.object_name => InvoicePayment,
Issuing::Authorization.object_name => Issuing::Authorization,
Issuing::Card.object_name => Issuing::Card,
Issuing::Cardholder.object_name => Issuing::Cardholder,
Issuing::CreditUnderwritingRecord.object_name => Issuing::CreditUnderwritingRecord,
Issuing::Dispute.object_name => Issuing::Dispute,
Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
Issuing::Token.object_name => Issuing::Token,
Issuing::Transaction.object_name => Issuing::Transaction,
LineItem.object_name => LineItem,
LoginLink.object_name => LoginLink,
Mandate.object_name => Mandate,
Margin.object_name => Margin,
Order.object_name => Order,
PaymentIntent.object_name => PaymentIntent,
PaymentLink.object_name => PaymentLink,
PaymentMethod.object_name => PaymentMethod,
PaymentMethodConfiguration.object_name => PaymentMethodConfiguration,
PaymentMethodDomain.object_name => PaymentMethodDomain,
Payout.object_name => Payout,
Person.object_name => Person,
Plan.object_name => Plan,
Price.object_name => Price,
Product.object_name => Product,
PromotionCode.object_name => PromotionCode,
Quote.object_name => Quote,
QuotePhase.object_name => QuotePhase,
QuotePreviewInvoice.object_name => QuotePreviewInvoice,
QuotePreviewSubscriptionSchedule.object_name => QuotePreviewSubscriptionSchedule,
Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
Radar::ValueList.object_name => Radar::ValueList,
Radar::ValueListItem.object_name => Radar::ValueListItem,
Refund.object_name => Refund,
Reporting::ReportRun.object_name => Reporting::ReportRun,
Reporting::ReportType.object_name => Reporting::ReportType,
Reversal.object_name => Reversal,
Review.object_name => Review,
SetupAttempt.object_name => SetupAttempt,
SetupIntent.object_name => SetupIntent,
ShippingRate.object_name => ShippingRate,
Sigma::ScheduledQueryRun.object_name => Sigma::ScheduledQueryRun,
Source.object_name => Source,
SourceTransaction.object_name => SourceTransaction,
Subscription.object_name => Subscription,
SubscriptionItem.object_name => SubscriptionItem,
SubscriptionSchedule.object_name => SubscriptionSchedule,
Tax::Calculation.object_name => Tax::Calculation,
Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
Tax::Form.object_name => Tax::Form,
Tax::Registration.object_name => Tax::Registration,
Tax::Settings.object_name => Tax::Settings,
Tax::Transaction.object_name => Tax::Transaction,
Tax::TransactionLineItem.object_name => Tax::TransactionLineItem,
TaxCode.object_name => TaxCode,
TaxId.object_name => TaxId,
TaxRate.object_name => TaxRate,
Terminal::Configuration.object_name => Terminal::Configuration,
Terminal::ConnectionToken.object_name => Terminal::ConnectionToken,
Terminal::Location.object_name => Terminal::Location,
Terminal::Reader.object_name => Terminal::Reader,
TestHelpers::TestClock.object_name => TestHelpers::TestClock,
Token.object_name => Token,
Topup.object_name => Topup,
Transfer.object_name => Transfer,
Treasury::CreditReversal.object_name => Treasury::CreditReversal,
Treasury::DebitReversal.object_name => Treasury::DebitReversal,
Treasury::FinancialAccount.object_name => Treasury::FinancialAccount,
Treasury::FinancialAccountFeatures.object_name => Treasury::FinancialAccountFeatures,
Treasury::InboundTransfer.object_name => Treasury::InboundTransfer,
Treasury::OutboundPayment.object_name => Treasury::OutboundPayment,
Treasury::OutboundTransfer.object_name => Treasury::OutboundTransfer,
Treasury::ReceivedCredit.object_name => Treasury::ReceivedCredit,
Treasury::ReceivedDebit.object_name => Treasury::ReceivedDebit,
Treasury::Transaction.object_name => Treasury::Transaction,
Treasury::TransactionEntry.object_name => Treasury::TransactionEntry,
UsageRecord.object_name => UsageRecord,
UsageRecordSummary.object_name => UsageRecordSummary,
WebhookEndpoint.object_name => WebhookEndpoint,
}
end
end
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/MethodLength

View File

@ -17,6 +17,9 @@ module Stripe
extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "account"
def self.object_name
"account"
end
nested_resource_class_methods :capability,
operations: %i[retrieve update list],

View File

@ -10,6 +10,9 @@ module Stripe
extend Stripe::APIOperations::Create
OBJECT_NAME = "account_link"
def self.object_name
"account_link"
end
# Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
def self.create(params = {}, opts = {})

View File

@ -10,6 +10,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "account_notice"
def self.object_name
"account_notice"
end
# Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
def self.list(filters = {}, opts = {})

View File

@ -13,6 +13,9 @@ module Stripe
extend Stripe::APIOperations::Create
OBJECT_NAME = "account_session"
def self.object_name
"account_session"
end
# Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
def self.create(params = {}, opts = {})

View File

@ -9,6 +9,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "apple_pay_domain"
def self.object_name
"apple_pay_domain"
end
def self.resource_url
"/v1/apple_pay/domains"

View File

@ -7,6 +7,9 @@ module Stripe
extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "application_fee"
def self.object_name
"application_fee"
end
nested_resource_class_methods :refund, operations: %i[create retrieve update list]

View File

@ -11,6 +11,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "fee_refund"
def self.object_name
"fee_refund"
end
def resource_url
"#{ApplicationFee.resource_url}/#{CGI.escape(fee)}/refunds" \

View File

@ -17,6 +17,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "apps.secret"
def self.object_name
"apps.secret"
end
# Deletes a secret from the secret store by name and scope.
def self.delete_where(params = {}, opts = {})

View File

@ -15,5 +15,8 @@ module Stripe
# Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances)
class Balance < SingletonAPIResource
OBJECT_NAME = "balance"
def self.object_name
"balance"
end
end
end

View File

@ -10,6 +10,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "balance_transaction"
def self.object_name
"balance_transaction"
end
# Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
#

View File

@ -15,6 +15,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "bank_account"
def self.object_name
"bank_account"
end
def verify(params = {}, opts = {})
resp, opts = execute_resource_request(:post, resource_url + "/verify", params, opts)

View File

@ -10,6 +10,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "billing_portal.configuration"
def self.object_name
"billing_portal.configuration"
end
# Creates a configuration that describes the functionality and behavior of a PortalSession
def self.create(params = {}, opts = {})

View File

@ -21,6 +21,9 @@ module Stripe
extend Stripe::APIOperations::Create
OBJECT_NAME = "billing_portal.session"
def self.object_name
"billing_portal.session"
end
# Creates a session of the customer portal.
def self.create(params = {}, opts = {})

View File

@ -9,6 +9,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "capability"
def self.object_name
"capability"
end
def resource_url
if !respond_to?(:account) || account.nil?

View File

@ -9,6 +9,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "capital.financing_offer"
def self.object_name
"capital.financing_offer"
end
# Acknowledges that platform has received and delivered the financing_offer to
# the intended merchant recipient.

View File

@ -7,6 +7,9 @@ module Stripe
# platforms to read the state of Capital offered to their connected accounts.
class FinancingSummary < SingletonAPIResource
OBJECT_NAME = "capital.financing_summary"
def self.object_name
"capital.financing_summary"
end
end
end
end

View File

@ -8,6 +8,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "capital.financing_transaction"
def self.object_name
"capital.financing_transaction"
end
# Returns a list of financing transactions. The transactions are returned in sorted order,
# with the most recent transactions appearing first.

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "card"
def self.object_name
"card"
end
def resource_url
if respond_to?(:customer) && !customer.nil? && !customer.empty?

View File

@ -5,6 +5,9 @@ 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"
def self.object_name
"cash_balance"
end
def resource_url
if !respond_to?(:customer) || customer.nil?

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "charge"
def self.object_name
"charge"
end
# Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.
#

View File

@ -22,6 +22,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "checkout.session"
def self.object_name
"checkout.session"
end
# A Session can be expired when it is in one of these statuses: open
#

View File

@ -11,6 +11,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "climate.order"
def self.object_name
"climate.order"
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

View File

@ -9,6 +9,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "climate.product"
def self.object_name
"climate.product"
end
# Lists all available Climate product objects.
def self.list(filters = {}, opts = {})

View File

@ -8,6 +8,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "climate.supplier"
def self.object_name
"climate.supplier"
end
# Lists all available Climate supplier objects.
def self.list(filters = {}, opts = {})

View File

@ -9,5 +9,8 @@ module Stripe
# To learn more or request access, visit the related guided: [Finalize payments on the server using Confirmation Tokens](https://stripe.com/docs/payments/finalize-payments-on-the-server-confirmation-tokens).
class ConfirmationToken < APIResource
OBJECT_NAME = "confirmation_token"
def self.object_name
"confirmation_token"
end
end
end

View File

@ -12,6 +12,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "country_spec"
def self.object_name
"country_spec"
end
# Lists all Country Spec objects available in the API.
def self.list(filters = {}, opts = {})

View File

@ -12,6 +12,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "coupon"
def self.object_name
"coupon"
end
# You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
#

View File

@ -11,6 +11,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "credit_note"
def self.object_name
"credit_note"
end
# 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 = {})

View File

@ -5,5 +5,8 @@ module Stripe
# The credit note line item object
class CreditNoteLineItem < StripeObject
OBJECT_NAME = "credit_note_line_item"
def self.object_name
"credit_note_line_item"
end
end
end

View File

@ -14,6 +14,9 @@ module Stripe
extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "customer"
def self.object_name
"customer"
end
nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list]
nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
@ -200,6 +203,9 @@ module Stripe
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Customer
def self.resource_class
"Customer"
end
# Create an incoming testmode bank transfer
def self.fund_cash_balance(customer, params = {}, opts = {})

View File

@ -12,6 +12,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "customer_balance_transaction"
def self.object_name
"customer_balance_transaction"
end
def resource_url
if !respond_to?(:customer) || customer.nil?

View File

@ -8,5 +8,8 @@ module Stripe
# to payments, and refunds to the customer.
class CustomerCashBalanceTransaction < APIResource
OBJECT_NAME = "customer_cash_balance_transaction"
def self.object_name
"customer_cash_balance_transaction"
end
end
end

View File

@ -5,5 +5,8 @@ module Stripe
# A entitlement for a customer describes access to a feature.
class CustomerEntitlement < APIResource
OBJECT_NAME = "customer_entitlement"
def self.object_name
"customer_entitlement"
end
end
end

View File

@ -5,5 +5,8 @@ module Stripe
# A summary of a customer's entitlements.
class CustomerEntitlementSummary < APIResource
OBJECT_NAME = "customer_entitlement_summary"
def self.object_name
"customer_entitlement_summary"
end
end
end

View File

@ -8,6 +8,9 @@ module Stripe
extend Stripe::APIOperations::Create
OBJECT_NAME = "customer_session"
def self.object_name
"customer_session"
end
# Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
def self.create(params = {}, opts = {})

View File

@ -8,5 +8,8 @@ module Stripe
# Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
class Discount < StripeObject
OBJECT_NAME = "discount"
def self.object_name
"discount"
end
end
end

View File

@ -12,6 +12,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "dispute"
def self.object_name
"dispute"
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.
#

View File

@ -8,6 +8,9 @@ module Stripe
extend Stripe::APIOperations::Create
OBJECT_NAME = "entitlements.event"
def self.object_name
"entitlements.event"
end
# Create an entitlement event manually, outside of the entitlement events automatically created by Stripe lifecycle events.
def self.create(params = {}, opts = {})

View File

@ -10,6 +10,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "entitlements.feature"
def self.object_name
"entitlements.feature"
end
# Creates a feature
def self.create(params = {}, opts = {})

View File

@ -7,6 +7,9 @@ module Stripe
include Stripe::APIOperations::Delete
OBJECT_NAME = "ephemeral_key"
def self.object_name
"ephemeral_key"
end
def self.create(params = {}, opts = {})
opts = Util.normalize_opts(opts)

View File

@ -36,6 +36,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "event"
def self.object_name
"event"
end
# List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
def self.list(filters = {}, opts = {})

View File

@ -32,6 +32,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "exchange_rate"
def self.object_name
"exchange_rate"
end
# Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports.
def self.list(filters = {}, opts = {})

View File

@ -14,12 +14,18 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "file"
def self.object_name
"file"
end
# This resource can have two different object names. In latter API
# versions, only `file` is used, but since stripe-ruby may be used with
# any API version, we need to support deserializing the older
# `file_upload` object into the same class.
OBJECT_NAME_ALT = "file_upload"
def self.object_name_alt
"file_upload"
end
def self.resource_url
"/v1/files"

View File

@ -11,6 +11,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "file_link"
def self.object_name
"file_link"
end
# Creates a new file link object.
def self.create(params = {}, opts = {})

View File

@ -9,6 +9,9 @@ module Stripe
extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "financial_connections.account"
def self.object_name
"financial_connections.account"
end
nested_resource_class_methods :inferred_balance, operations: %i[list]

View File

@ -6,6 +6,9 @@ module Stripe
# A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data.
class AccountInferredBalance < APIResource
OBJECT_NAME = "financial_connections.account_inferred_balance"
def self.object_name
"financial_connections.account_inferred_balance"
end
end
end
end

View File

@ -6,6 +6,9 @@ module Stripe
# Describes an owner of an account.
class AccountOwner < StripeObject
OBJECT_NAME = "financial_connections.account_owner"
def self.object_name
"financial_connections.account_owner"
end
end
end
end

View File

@ -6,6 +6,9 @@ module Stripe
# Describes a snapshot of the owners of an account at a particular point in time.
class AccountOwnership < StripeObject
OBJECT_NAME = "financial_connections.account_ownership"
def self.object_name
"financial_connections.account_ownership"
end
end
end
end

View File

@ -8,6 +8,9 @@ module Stripe
extend Stripe::APIOperations::Create
OBJECT_NAME = "financial_connections.session"
def self.object_name
"financial_connections.session"
end
# To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js.
def self.create(params = {}, opts = {})

View File

@ -8,6 +8,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "financial_connections.transaction"
def self.object_name
"financial_connections.transaction"
end
# Returns a list of Financial Connections Transaction objects.
def self.list(filters = {}, opts = {})

View File

@ -9,6 +9,9 @@ module Stripe
# Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions)
class FundingInstructions < APIResource
OBJECT_NAME = "funding_instructions"
def self.object_name
"funding_instructions"
end
def resource_url
if !respond_to?(:customer) || customer.nil?

View File

@ -11,6 +11,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "gift_cards.card"
def self.object_name
"gift_cards.card"
end
# Validates a gift card code, returning the matching gift card object if it exists.
def self.validate(params = {}, opts = {})

View File

@ -15,6 +15,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "gift_cards.transaction"
def self.object_name
"gift_cards.transaction"
end
# Cancel a gift card transaction
def cancel(params = {}, opts = {})

View File

@ -18,6 +18,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "identity.verification_report"
def self.object_name
"identity.verification_report"
end
# List all verification reports.
def self.list(filters = {}, opts = {})

View File

@ -20,6 +20,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "identity.verification_session"
def self.object_name
"identity.verification_session"
end
# A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
#

View File

@ -43,6 +43,9 @@ module Stripe
extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "invoice"
def self.object_name
"invoice"
end
nested_resource_class_methods :payment, operations: %i[retrieve list]

View File

@ -20,6 +20,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "invoiceitem"
def self.object_name
"invoiceitem"
end
# Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
def self.create(params = {}, opts = {})

View File

@ -4,5 +4,8 @@
module Stripe
class InvoiceLineItem < StripeObject
OBJECT_NAME = "line_item"
def self.object_name
"line_item"
end
end
end

View File

@ -5,5 +5,8 @@ module Stripe
# The invoice payment object
class InvoicePayment < APIResource
OBJECT_NAME = "invoice_payment"
def self.object_name
"invoice_payment"
end
end
end

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.authorization"
def self.object_name
"issuing.authorization"
end
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
@ -84,6 +87,9 @@ module Stripe
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Authorization
def self.resource_class
"Authorization"
end
# Capture a test-mode authorization.
def self.capture(authorization, params = {}, opts = {})

View File

@ -10,6 +10,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.card"
def self.object_name
"issuing.card"
end
# Creates an Issuing Card object.
def self.create(params = {}, opts = {})
@ -37,6 +40,9 @@ module Stripe
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Card
def self.resource_class
"Card"
end
# Updates the shipping status of the specified Issuing Card object to delivered.
def self.deliver_card(card, params = {}, opts = {})

View File

@ -12,6 +12,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.cardholder"
def self.object_name
"issuing.cardholder"
end
# Creates a new Issuing Cardholder object that can be issued cards.
def self.create(params = {}, opts = {})

View File

@ -10,6 +10,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "issuing.credit_underwriting_record"
def self.object_name
"issuing.credit_underwriting_record"
end
# Update a CreditUnderwritingRecord object to correct mistakes.
def correct(params = {}, opts = {})

View File

@ -12,6 +12,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.dispute"
def self.object_name
"issuing.dispute"
end
# Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
def submit(params = {}, opts = {})

View File

@ -10,6 +10,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.personalization_design"
def self.object_name
"issuing.personalization_design"
end
# Creates a personalization design object.
def self.create(params = {}, opts = {})
@ -47,6 +50,9 @@ module Stripe
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = PersonalizationDesign
def self.resource_class
"PersonalizationDesign"
end
# Updates the status of the specified testmode personalization design object to active.
def self.activate(personalization_design, params = {}, opts = {})

View File

@ -8,6 +8,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "issuing.physical_bundle"
def self.object_name
"issuing.physical_bundle"
end
# Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
def self.list(filters = {}, opts = {})

View File

@ -9,6 +9,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.token"
def self.object_name
"issuing.token"
end
# Lists all Issuing Token objects for a given card.
def self.list(filters = {}, opts = {})

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "issuing.transaction"
def self.object_name
"issuing.transaction"
end
# Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
def self.list(filters = {}, opts = {})
@ -40,6 +43,9 @@ module Stripe
class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = Transaction
def self.resource_class
"Transaction"
end
# Allows the user to capture an arbitrary amount, also known as a forced capture.
def self.create_force_capture(params = {}, opts = {})

View File

@ -5,5 +5,8 @@ module Stripe
# A line item.
class LineItem < APIResource
OBJECT_NAME = "item"
def self.object_name
"item"
end
end
end

View File

@ -5,6 +5,9 @@ module Stripe
# Login Links are single-use login link for an Express account to access their Stripe dashboard.
class LoginLink < APIResource
OBJECT_NAME = "login_link"
def self.object_name
"login_link"
end
def self.retrieve(_id, _opts = nil)
raise NotImplementedError,

View File

@ -5,5 +5,8 @@ module Stripe
# A Mandate is a record of the permission that your customer gives you to debit their payment method.
class Mandate < APIResource
OBJECT_NAME = "mandate"
def self.object_name
"mandate"
end
end
end

View File

@ -10,6 +10,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "margin"
def self.object_name
"margin"
end
# Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.
def self.create(params = {}, opts = {})

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "order"
def self.object_name
"order"
end
# Cancels the order as well as the payment intent if one is attached.
def cancel(params = {}, opts = {})

View File

@ -20,6 +20,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "payment_intent"
def self.object_name
"payment_intent"
end
# Manually reconcile the remaining amount for a customer_balance PaymentIntent.
def apply_customer_balance(params = {}, opts = {})
@ -80,8 +83,7 @@ module Stripe
# return to the requires_confirmation state
# after those actions are completed. Your server needs to then
# explicitly re-confirm the PaymentIntent to initiate the next payment
# attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual)
# to learn more about manual confirmation.
# attempt.
def confirm(params = {}, opts = {})
request_stripe_object(
method: :post,
@ -193,8 +195,7 @@ module Stripe
# return to the requires_confirmation state
# after those actions are completed. Your server needs to then
# explicitly re-confirm the PaymentIntent to initiate the next payment
# attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual)
# to learn more about manual confirmation.
# attempt.
def self.confirm(intent, params = {}, opts = {})
request_stripe_object(
method: :post,

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "payment_link"
def self.object_name
"payment_link"
end
# When retrieving a payment link, 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 = {})

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "payment_method"
def self.object_name
"payment_method"
end
# Attaches a PaymentMethod object to a Customer.
#

View File

@ -22,6 +22,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "payment_method_configuration"
def self.object_name
"payment_method_configuration"
end
# Creates a payment method configuration
def self.create(params = {}, opts = {})

View File

@ -12,6 +12,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "payment_method_domain"
def self.object_name
"payment_method_domain"
end
# Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain.
# The payment method doesn't appear in Elements for this domain until it is active.

View File

@ -16,6 +16,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "payout"
def self.object_name
"payout"
end
# You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
def cancel(params = {}, opts = {})

View File

@ -12,6 +12,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "person"
def self.object_name
"person"
end
def resource_url
if !respond_to?(:account) || account.nil?

View File

@ -17,6 +17,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "plan"
def self.object_name
"plan"
end
# 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.
def self.create(params = {}, opts = {})

View File

@ -15,6 +15,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "price"
def self.object_name
"price"
end
# Creates a new price for an existing product. The price can be recurring or one-time.
def self.create(params = {}, opts = {})

View File

@ -18,6 +18,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "product"
def self.object_name
"product"
end
# Creates a new product object.
def self.create(params = {}, opts = {})

View File

@ -10,6 +10,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "promotion_code"
def self.object_name
"promotion_code"
end
# A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
def self.create(params = {}, opts = {})

View File

@ -11,6 +11,9 @@ module Stripe
extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "quote"
def self.object_name
"quote"
end
nested_resource_class_methods :preview_invoice, operations: %i[list]
nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]

View File

@ -7,6 +7,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "quote_phase"
def self.object_name
"quote_phase"
end
# When retrieving a quote phase, 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 = {})

View File

@ -36,5 +36,8 @@ module Stripe
# Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending)
class QuotePreviewInvoice < APIResource
OBJECT_NAME = "quote_preview_invoice"
def self.object_name
"quote_preview_invoice"
end
end
end

View File

@ -4,5 +4,8 @@
module Stripe
class QuotePreviewSubscriptionSchedule < APIResource
OBJECT_NAME = "quote_preview_subscription_schedule"
def self.object_name
"quote_preview_subscription_schedule"
end
end
end

View File

@ -11,6 +11,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "radar.early_fraud_warning"
def self.object_name
"radar.early_fraud_warning"
end
# Returns a list of early fraud warnings.
def self.list(filters = {}, opts = {})

View File

@ -13,6 +13,9 @@ module Stripe
include Stripe::APIOperations::Save
OBJECT_NAME = "radar.value_list"
def self.object_name
"radar.value_list"
end
# Creates a new ValueList object, which can then be referenced in rules.
def self.create(params = {}, opts = {})

View File

@ -12,6 +12,9 @@ module Stripe
extend Stripe::APIOperations::List
OBJECT_NAME = "radar.value_list_item"
def self.object_name
"radar.value_list_item"
end
# Creates a new ValueListItem object, which is added to the specified parent value list.
def self.create(params = {}, opts = {})

Some files were not shown because too many files have changed in this diff Show More