mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-06 00:00:30 -04:00
Compare commits
5 Commits
af6fb06cd6
...
a40fda3849
Author | SHA1 | Date | |
---|---|---|---|
|
a40fda3849 | ||
|
5a4d6fc714 | ||
|
c408baf50f | ||
|
6b1127660c | ||
|
5284192a6e |
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,6 @@ module Stripe
|
|||||||
# business objects
|
# business objects
|
||||||
Account::OBJECT_NAME => Account,
|
Account::OBJECT_NAME => Account,
|
||||||
AccountLink::OBJECT_NAME => AccountLink,
|
AccountLink::OBJECT_NAME => AccountLink,
|
||||||
AlipayAccount::OBJECT_NAME => AlipayAccount,
|
|
||||||
ApplePayDomain::OBJECT_NAME => ApplePayDomain,
|
ApplePayDomain::OBJECT_NAME => ApplePayDomain,
|
||||||
ApplicationFee::OBJECT_NAME => ApplicationFee,
|
ApplicationFee::OBJECT_NAME => ApplicationFee,
|
||||||
ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
|
ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
|
||||||
@ -24,8 +23,6 @@ module Stripe
|
|||||||
BankAccount::OBJECT_NAME => BankAccount,
|
BankAccount::OBJECT_NAME => BankAccount,
|
||||||
BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
|
BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
|
||||||
BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
|
BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
|
||||||
BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
|
|
||||||
BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
|
|
||||||
Capability::OBJECT_NAME => Capability,
|
Capability::OBJECT_NAME => Capability,
|
||||||
Card::OBJECT_NAME => Card,
|
Card::OBJECT_NAME => Card,
|
||||||
CashBalance::OBJECT_NAME => CashBalance,
|
CashBalance::OBJECT_NAME => CashBalance,
|
||||||
@ -58,7 +55,6 @@ module Stripe
|
|||||||
InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
|
InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
|
||||||
Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
|
Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
|
||||||
Issuing::Card::OBJECT_NAME => Issuing::Card,
|
Issuing::Card::OBJECT_NAME => Issuing::Card,
|
||||||
Issuing::CardDetails::OBJECT_NAME => Issuing::CardDetails,
|
|
||||||
Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
|
Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
|
||||||
Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
|
Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
|
||||||
Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
|
Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
|
||||||
@ -79,8 +75,6 @@ module Stripe
|
|||||||
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
|
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
|
||||||
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
|
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
|
||||||
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
|
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
|
||||||
Recipient::OBJECT_NAME => Recipient,
|
|
||||||
RecipientTransfer::OBJECT_NAME => RecipientTransfer,
|
|
||||||
Refund::OBJECT_NAME => Refund,
|
Refund::OBJECT_NAME => Refund,
|
||||||
Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
|
Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
|
||||||
Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
|
Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
|
||||||
@ -104,7 +98,6 @@ module Stripe
|
|||||||
Terminal::Location::OBJECT_NAME => Terminal::Location,
|
Terminal::Location::OBJECT_NAME => Terminal::Location,
|
||||||
Terminal::Reader::OBJECT_NAME => Terminal::Reader,
|
Terminal::Reader::OBJECT_NAME => Terminal::Reader,
|
||||||
TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
|
TestHelpers::TestClock::OBJECT_NAME => TestHelpers::TestClock,
|
||||||
ThreeDSecure::OBJECT_NAME => ThreeDSecure,
|
|
||||||
Token::OBJECT_NAME => Token,
|
Token::OBJECT_NAME => Token,
|
||||||
Topup::OBJECT_NAME => Topup,
|
Topup::OBJECT_NAME => Topup,
|
||||||
Transfer::OBJECT_NAME => Transfer,
|
Transfer::OBJECT_NAME => Transfer,
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
require "stripe/resources/account"
|
require "stripe/resources/account"
|
||||||
require "stripe/resources/account_link"
|
require "stripe/resources/account_link"
|
||||||
require "stripe/resources/alipay_account"
|
|
||||||
require "stripe/resources/apple_pay_domain"
|
require "stripe/resources/apple_pay_domain"
|
||||||
require "stripe/resources/application_fee"
|
require "stripe/resources/application_fee"
|
||||||
require "stripe/resources/application_fee_refund"
|
require "stripe/resources/application_fee_refund"
|
||||||
@ -13,8 +12,6 @@ require "stripe/resources/balance_transaction"
|
|||||||
require "stripe/resources/bank_account"
|
require "stripe/resources/bank_account"
|
||||||
require "stripe/resources/billing_portal/configuration"
|
require "stripe/resources/billing_portal/configuration"
|
||||||
require "stripe/resources/billing_portal/session"
|
require "stripe/resources/billing_portal/session"
|
||||||
require "stripe/resources/bitcoin_receiver"
|
|
||||||
require "stripe/resources/bitcoin_transaction"
|
|
||||||
require "stripe/resources/capability"
|
require "stripe/resources/capability"
|
||||||
require "stripe/resources/card"
|
require "stripe/resources/card"
|
||||||
require "stripe/resources/cash_balance"
|
require "stripe/resources/cash_balance"
|
||||||
@ -45,7 +42,6 @@ require "stripe/resources/invoice_item"
|
|||||||
require "stripe/resources/invoice_line_item"
|
require "stripe/resources/invoice_line_item"
|
||||||
require "stripe/resources/issuing/authorization"
|
require "stripe/resources/issuing/authorization"
|
||||||
require "stripe/resources/issuing/card"
|
require "stripe/resources/issuing/card"
|
||||||
require "stripe/resources/issuing/card_details"
|
|
||||||
require "stripe/resources/issuing/cardholder"
|
require "stripe/resources/issuing/cardholder"
|
||||||
require "stripe/resources/issuing/dispute"
|
require "stripe/resources/issuing/dispute"
|
||||||
require "stripe/resources/issuing/transaction"
|
require "stripe/resources/issuing/transaction"
|
||||||
@ -66,8 +62,6 @@ require "stripe/resources/quote"
|
|||||||
require "stripe/resources/radar/early_fraud_warning"
|
require "stripe/resources/radar/early_fraud_warning"
|
||||||
require "stripe/resources/radar/value_list"
|
require "stripe/resources/radar/value_list"
|
||||||
require "stripe/resources/radar/value_list_item"
|
require "stripe/resources/radar/value_list_item"
|
||||||
require "stripe/resources/recipient"
|
|
||||||
require "stripe/resources/recipient_transfer"
|
|
||||||
require "stripe/resources/refund"
|
require "stripe/resources/refund"
|
||||||
require "stripe/resources/reporting/report_run"
|
require "stripe/resources/reporting/report_run"
|
||||||
require "stripe/resources/reporting/report_type"
|
require "stripe/resources/reporting/report_type"
|
||||||
@ -91,7 +85,6 @@ require "stripe/resources/terminal/connection_token"
|
|||||||
require "stripe/resources/terminal/location"
|
require "stripe/resources/terminal/location"
|
||||||
require "stripe/resources/terminal/reader"
|
require "stripe/resources/terminal/reader"
|
||||||
require "stripe/resources/test_helpers/test_clock"
|
require "stripe/resources/test_helpers/test_clock"
|
||||||
require "stripe/resources/three_d_secure"
|
|
||||||
require "stripe/resources/token"
|
require "stripe/resources/token"
|
||||||
require "stripe/resources/topup"
|
require "stripe/resources/topup"
|
||||||
require "stripe/resources/transfer"
|
require "stripe/resources/transfer"
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
# File generated from our OpenAPI spec
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
# Directly creating or retrieving BitcoinReceivers is deprecated. Please use
|
|
||||||
# the Sources API instead: https://stripe.com/docs/sources/bitcoin
|
|
||||||
class BitcoinReceiver < APIResource
|
|
||||||
extend Stripe::APIOperations::List
|
|
||||||
|
|
||||||
OBJECT_NAME = "bitcoin_receiver"
|
|
||||||
|
|
||||||
def self.resource_url
|
|
||||||
"/v1/bitcoin/receivers"
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_url
|
|
||||||
if respond_to?(:customer) && !customer.nil? && customer != ""
|
|
||||||
"#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
|
|
||||||
else
|
|
||||||
"#{self.class.resource_url}/#{CGI.escape(id)}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,16 +0,0 @@
|
|||||||
# File generated from our OpenAPI spec
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
# Directly retrieving BitcoinTransactions is deprecated. Please use
|
|
||||||
# the Sources API instead: https://stripe.com/docs/sources/bitcoin
|
|
||||||
class BitcoinTransaction < APIResource
|
|
||||||
extend Stripe::APIOperations::List
|
|
||||||
|
|
||||||
OBJECT_NAME = "bitcoin_transaction"
|
|
||||||
|
|
||||||
def self.resource_url
|
|
||||||
"/v1/bitcoin/transactions"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -10,9 +10,7 @@ module Stripe
|
|||||||
OBJECT_NAME = "card"
|
OBJECT_NAME = "card"
|
||||||
|
|
||||||
def resource_url
|
def resource_url
|
||||||
if respond_to?(:recipient) && !recipient.nil? && !recipient.empty?
|
if respond_to?(:customer) && !customer.nil? && !customer.empty?
|
||||||
"#{Recipient.resource_url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
|
|
||||||
elsif respond_to?(:customer) && !customer.nil? && !customer.empty?
|
|
||||||
"#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
|
"#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
|
||||||
elsif respond_to?(:account) && !account.nil? && !account.empty?
|
elsif respond_to?(:account) && !account.nil? && !account.empty?
|
||||||
"#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
|
"#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
|
||||||
|
@ -6,12 +6,9 @@ module Stripe
|
|||||||
class Session < APIResource
|
class Session < APIResource
|
||||||
extend Stripe::APIOperations::Create
|
extend Stripe::APIOperations::Create
|
||||||
extend Stripe::APIOperations::List
|
extend Stripe::APIOperations::List
|
||||||
extend Stripe::APIOperations::NestedResource
|
|
||||||
|
|
||||||
OBJECT_NAME = "checkout.session"
|
OBJECT_NAME = "checkout.session"
|
||||||
|
|
||||||
nested_resource_class_methods :line_item, operations: %i[list]
|
|
||||||
|
|
||||||
def expire(params = {}, opts = {})
|
def expire(params = {}, opts = {})
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :post,
|
method: :post,
|
||||||
@ -21,6 +18,15 @@ module Stripe
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def list_line_items(params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :get,
|
||||||
|
path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(self["id"]) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def self.expire(session, params = {}, opts = {})
|
def self.expire(session, params = {}, opts = {})
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :post,
|
method: :post,
|
||||||
@ -29,6 +35,15 @@ module Stripe
|
|||||||
opts: opts
|
opts: opts
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.list_line_items(session, params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :get,
|
||||||
|
path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(session) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -26,6 +26,15 @@ module Stripe
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete_discount(params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :delete,
|
||||||
|
path: format("/v1/customers/%<customer>s/discount", { customer: CGI.escape(self["id"]) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def list_payment_methods(params = {}, opts = {})
|
def list_payment_methods(params = {}, opts = {})
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :get,
|
method: :get,
|
||||||
@ -53,6 +62,15 @@ module Stripe
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.delete_discount(customer, params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :delete,
|
||||||
|
path: format("/v1/customers/%<customer>s/discount", { customer: CGI.escape(customer) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def self.list_payment_methods(customer, params = {}, opts = {})
|
def self.list_payment_methods(customer, params = {}, opts = {})
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :get,
|
method: :get,
|
||||||
@ -85,20 +103,6 @@ module Stripe
|
|||||||
class << self
|
class << self
|
||||||
alias detach_source delete_source
|
alias detach_source delete_source
|
||||||
end
|
end
|
||||||
custom_method :delete_discount, http_verb: :delete, http_path: "discount"
|
|
||||||
|
|
||||||
# Deletes a discount associated with the customer.
|
|
||||||
#
|
|
||||||
# Returns the deleted discount. The customer object is not updated,
|
|
||||||
# so you must call `refresh` on it to get a new version with the
|
|
||||||
# discount removed.
|
|
||||||
def delete_discount
|
|
||||||
request_stripe_object(
|
|
||||||
method: :delete,
|
|
||||||
path: resource_url + "/discount",
|
|
||||||
params: {}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.search(params = {}, opts = {})
|
def self.search(params = {}, opts = {})
|
||||||
_search("/v1/customers/search", params, opts)
|
_search("/v1/customers/search", params, opts)
|
||||||
@ -108,36 +112,16 @@ module Stripe
|
|||||||
search(params, opts).auto_paging_each(&blk)
|
search(params, opts).auto_paging_each(&blk)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.retrieve_cash_balance(
|
def self.retrieve_cash_balance(customer, params = {}, opts = {})
|
||||||
customer,
|
|
||||||
opts_or_unused_nested_id = nil,
|
|
||||||
opts = {}
|
|
||||||
)
|
|
||||||
# Support two call patterns for backwards compatibility.
|
|
||||||
# 1. Legacy: (nil unused nested_id, opts)
|
|
||||||
# 2. Fixed pattern: (opts)
|
|
||||||
if !opts_or_unused_nested_id.nil? && opts_or_unused_nested_id.class == Hash && opts.empty?
|
|
||||||
opts = opts_or_unused_nested_id
|
|
||||||
end
|
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :get,
|
method: :get,
|
||||||
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
||||||
params: {},
|
params: params,
|
||||||
opts: opts
|
opts: opts
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.update_cash_balance(
|
def self.update_cash_balance(customer, params = {}, opts = {})
|
||||||
customer,
|
|
||||||
unused_nested_id = nil,
|
|
||||||
params = {},
|
|
||||||
opts = {}
|
|
||||||
)
|
|
||||||
# Do not allow passing in a hash as the second argument, as we require a nil for compatibility reasons. We cannot differentiate from a legacy pattern (nil, params) and a modern pattern (nil for params, opts).
|
|
||||||
if !unused_nested_id.nil? && unused_nested_id.class == Hash
|
|
||||||
raise ArgumentError, "update_cash_balance requires the second argument always be nil for legacy reasons."
|
|
||||||
end
|
|
||||||
|
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :post,
|
method: :post,
|
||||||
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
||||||
|
@ -10,24 +10,6 @@ module Stripe
|
|||||||
|
|
||||||
OBJECT_NAME = "issuing.card"
|
OBJECT_NAME = "issuing.card"
|
||||||
|
|
||||||
def details(params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :get,
|
|
||||||
path: format("/v1/issuing/cards/%<card>s/details", { card: CGI.escape(self["id"]) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.details(card, params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :get,
|
|
||||||
path: format("/v1/issuing/cards/%<card>s/details", { card: CGI.escape(card) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_helpers
|
def test_helpers
|
||||||
TestHelpers.new(self)
|
TestHelpers.new(self)
|
||||||
end
|
end
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
# File generated from our OpenAPI spec
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
module Issuing
|
|
||||||
class CardDetails < StripeObject
|
|
||||||
OBJECT_NAME = "issuing.card_details"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,14 +0,0 @@
|
|||||||
# File generated from our OpenAPI spec
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
# Recipients objects are deprecated. Please use Stripe Connect instead.
|
|
||||||
class Recipient < APIResource
|
|
||||||
extend Stripe::APIOperations::Create
|
|
||||||
include Stripe::APIOperations::Delete
|
|
||||||
extend Stripe::APIOperations::List
|
|
||||||
include Stripe::APIOperations::Save
|
|
||||||
|
|
||||||
OBJECT_NAME = "recipient"
|
|
||||||
end
|
|
||||||
end
|
|
@ -4,7 +4,6 @@
|
|||||||
module Stripe
|
module Stripe
|
||||||
module Reporting
|
module Reporting
|
||||||
class ReportType < APIResource
|
class ReportType < APIResource
|
||||||
extend Stripe::APIOperations::Create
|
|
||||||
extend Stripe::APIOperations::List
|
extend Stripe::APIOperations::List
|
||||||
|
|
||||||
OBJECT_NAME = "reporting.report_type"
|
OBJECT_NAME = "reporting.report_type"
|
||||||
|
@ -4,13 +4,21 @@
|
|||||||
module Stripe
|
module Stripe
|
||||||
class Subscription < APIResource
|
class Subscription < APIResource
|
||||||
extend Stripe::APIOperations::Create
|
extend Stripe::APIOperations::Create
|
||||||
include Stripe::APIOperations::Delete
|
|
||||||
extend Stripe::APIOperations::List
|
extend Stripe::APIOperations::List
|
||||||
extend Stripe::APIOperations::Search
|
extend Stripe::APIOperations::Search
|
||||||
include Stripe::APIOperations::Save
|
include Stripe::APIOperations::Save
|
||||||
|
|
||||||
OBJECT_NAME = "subscription"
|
OBJECT_NAME = "subscription"
|
||||||
|
|
||||||
|
def cancel(params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :delete,
|
||||||
|
path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(self["id"]) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def delete_discount(params = {}, opts = {})
|
def delete_discount(params = {}, opts = {})
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :delete,
|
method: :delete,
|
||||||
@ -20,6 +28,15 @@ module Stripe
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.cancel(subscription_exposed_id, params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :delete,
|
||||||
|
path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(subscription_exposed_id) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def self.delete_discount(subscription_exposed_id, params = {}, opts = {})
|
def self.delete_discount(subscription_exposed_id, params = {}, opts = {})
|
||||||
request_stripe_object(
|
request_stripe_object(
|
||||||
method: :delete,
|
method: :delete,
|
||||||
@ -30,6 +47,31 @@ module Stripe
|
|||||||
end
|
end
|
||||||
|
|
||||||
save_nested_resource :source
|
save_nested_resource :source
|
||||||
|
def delete(params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :delete,
|
||||||
|
path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(self["id"]) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.delete(subscription_exposed_id, params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :delete,
|
||||||
|
path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(subscription_exposed_id) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
extend Gem::Deprecate
|
||||||
|
deprecate :delete, "Stripe::Subscription.cancel", 2022, 7
|
||||||
|
|
||||||
|
class << self
|
||||||
|
extend Gem::Deprecate
|
||||||
|
deprecate :delete, "Stripe::Subscription#cancel", 2022, 7
|
||||||
|
end
|
||||||
|
|
||||||
def self.search(params = {}, opts = {})
|
def self.search(params = {}, opts = {})
|
||||||
_search("/v1/subscriptions/search", params, opts)
|
_search("/v1/subscriptions/search", params, opts)
|
||||||
|
@ -15,16 +15,5 @@ module Stripe
|
|||||||
nested_resource_class_methods :usage_record_summary,
|
nested_resource_class_methods :usage_record_summary,
|
||||||
operations: %i[list],
|
operations: %i[list],
|
||||||
resource_plural: "usage_record_summaries"
|
resource_plural: "usage_record_summaries"
|
||||||
|
|
||||||
def usage_record_summaries(params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :get,
|
|
||||||
path: resource_url + "/usage_record_summaries",
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
extend Gem::Deprecate
|
|
||||||
deprecate :usage_record_summaries, :"SubscriptionItem.list_usage_record_summaries", 2020, 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
# File generated from our OpenAPI spec
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
class ThreeDSecure < APIResource
|
|
||||||
extend Stripe::APIOperations::Create
|
|
||||||
|
|
||||||
OBJECT_NAME = "three_d_secure"
|
|
||||||
|
|
||||||
def self.resource_url
|
|
||||||
"/v1/3d_secure"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -12,23 +12,5 @@ module Stripe
|
|||||||
|
|
||||||
nested_resource_class_methods :reversal,
|
nested_resource_class_methods :reversal,
|
||||||
operations: %i[create retrieve update list]
|
operations: %i[create retrieve update list]
|
||||||
|
|
||||||
def cancel(params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :post,
|
|
||||||
path: format("/v1/transfers/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.cancel(id, params = {}, opts = {})
|
|
||||||
request_stripe_object(
|
|
||||||
method: :post,
|
|
||||||
path: format("/v1/transfers/%<id>s/cancel", { id: CGI.escape(id) }),
|
|
||||||
params: params,
|
|
||||||
opts: opts
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require ::File.expand_path("../test_helper", __dir__)
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
class AlipayAccountTest < Test::Unit::TestCase
|
|
||||||
context "#resource_url" do
|
|
||||||
should "return a resource URL" do
|
|
||||||
alipay_account = Stripe::AlipayAccount.construct_from(
|
|
||||||
id: "aliacc_123",
|
|
||||||
customer: "cus_123"
|
|
||||||
)
|
|
||||||
assert_equal "/v1/customers/cus_123/sources/aliacc_123",
|
|
||||||
alipay_account.resource_url
|
|
||||||
end
|
|
||||||
|
|
||||||
should "raise without a customer" do
|
|
||||||
alipay_account = Stripe::AlipayAccount.construct_from(id: "aliacc_123")
|
|
||||||
assert_raises NotImplementedError do
|
|
||||||
alipay_account.resource_url
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
should "raise on #retrieve" do
|
|
||||||
assert_raises NotImplementedError do
|
|
||||||
Stripe::AlipayAccount.retrieve("aliacc_123")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
should "raise on #update" do
|
|
||||||
assert_raises NotImplementedError do
|
|
||||||
Stripe::AlipayAccount.update("aliacc_123", {})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -230,44 +230,35 @@ module Stripe
|
|||||||
# compatibility for existing users.
|
# compatibility for existing users.
|
||||||
|
|
||||||
context "#retrieve_cash_balance" do
|
context "#retrieve_cash_balance" do
|
||||||
should "legacy call pattern - retrieve_cash_balance(customer_id, nil)" do
|
should "retrieve with just ID" do
|
||||||
Stripe::Customer.retrieve_cash_balance("cus_123", nil)
|
Stripe::Customer.retrieve_cash_balance("cus_123")
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance"
|
assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance"
|
||||||
end
|
end
|
||||||
|
|
||||||
should "legacy call pattern - retrieve_cash_balance(customer_id, nil, opts)" do
|
should "retrieve with custom opts" do
|
||||||
# Assert that we're actually making a change by swapping out the API base.
|
# Assert that we're actually making a change by swapping out the API base.
|
||||||
assert Stripe.api_base != Stripe.connect_base
|
assert Stripe.api_base != Stripe.connect_base
|
||||||
|
|
||||||
Stripe::Customer.retrieve_cash_balance("cus_123", nil, { api_base: Stripe.connect_base })
|
Stripe::Customer.retrieve_cash_balance("cus_123", {}, { api_base: Stripe.connect_base })
|
||||||
assert_requested :get, "#{Stripe.connect_base}/v1/customers/cus_123/cash_balance"
|
|
||||||
end
|
|
||||||
|
|
||||||
should "modern call pattern - retrieve_cash_balance(customer_id, opts)" do
|
|
||||||
# Assert that we're actually making a change by swapping out the API base.
|
|
||||||
assert Stripe.api_base != Stripe.connect_base
|
|
||||||
|
|
||||||
Stripe::Customer.retrieve_cash_balance("cus_123", { api_base: Stripe.connect_base })
|
|
||||||
assert_requested :get, "#{Stripe.connect_base}/v1/customers/cus_123/cash_balance"
|
assert_requested :get, "#{Stripe.connect_base}/v1/customers/cus_123/cash_balance"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "#update_cash_balance" do
|
context "#update_cash_balance" do
|
||||||
should "legacy call pattern - update_cash_balance(customer, nil, params)" do
|
should "update with ID, params" do
|
||||||
Stripe::Customer.update_cash_balance("cus_123", nil, { settings: { reconciliation_mode: "manual" } })
|
Stripe::Customer.update_cash_balance("cus_123", { settings: { reconciliation_mode: "manual" } })
|
||||||
|
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance" do |req|
|
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance" do |req|
|
||||||
req.body == "settings[reconciliation_mode]=manual"
|
req.body == "settings[reconciliation_mode]=manual"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
should "legacy call pattern - update_cash_balance(customer, nil, params, opts)" do
|
should "update with ID, params and opts" do
|
||||||
# Assert that we're actually making a change by swapping out the API base.
|
# Assert that we're actually making a change by swapping out the API base.
|
||||||
assert Stripe.api_base != Stripe.connect_base
|
assert Stripe.api_base != Stripe.connect_base
|
||||||
|
|
||||||
Stripe::Customer.update_cash_balance(
|
Stripe::Customer.update_cash_balance(
|
||||||
"cus_123",
|
"cus_123",
|
||||||
nil,
|
|
||||||
{ settings: { reconciliation_mode: "manual" } },
|
{ settings: { reconciliation_mode: "manual" } },
|
||||||
{ api_base: Stripe.connect_base }
|
{ api_base: Stripe.connect_base }
|
||||||
)
|
)
|
||||||
@ -277,24 +268,11 @@ module Stripe
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
should "modern call pattern - update_cash_balance(customer)" do
|
should "update with just ID" do
|
||||||
Stripe::Customer.update_cash_balance("cus_123")
|
Stripe::Customer.update_cash_balance("cus_123")
|
||||||
|
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance"
|
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance"
|
||||||
end
|
end
|
||||||
|
|
||||||
should "modern call pattern - fail if passing in hash to second argument" do
|
|
||||||
# We catch this on purpose to avoid mis-using the call as is.
|
|
||||||
# Unfortunately we can't automatically shift over arguments (eg.
|
|
||||||
# update_cash_balance(customer_id, params, opts) ->
|
|
||||||
# update_cash_balance(customer_id, nil, params, opts)) since we have
|
|
||||||
# the problematic case of update_cash_balance(customer_id, nil, hash)
|
|
||||||
# where we can't differentiate params and opts for the second hash.
|
|
||||||
e = assert_raises(ArgumentError) do
|
|
||||||
Stripe::Customer.update_cash_balance("cus_123", { settings: { reconciliation_mode: "manual" } })
|
|
||||||
end
|
|
||||||
assert_match("update_cash_balance requires the second argument always be nil", e.message)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -224,7 +224,6 @@ module Stripe
|
|||||||
should "support requests with args: customer, settings" do
|
should "support requests with args: customer, settings" do
|
||||||
Stripe::Customer.update_cash_balance(
|
Stripe::Customer.update_cash_balance(
|
||||||
"cus_123",
|
"cus_123",
|
||||||
nil,
|
|
||||||
{ settings: { reconciliation_mode: "manual" } }
|
{ settings: { reconciliation_mode: "manual" } }
|
||||||
)
|
)
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance"
|
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance"
|
||||||
@ -329,6 +328,12 @@ module Stripe
|
|||||||
assert_requested :get, "#{Stripe.api_base}/v1/checkout/sessions?limit=3"
|
assert_requested :get, "#{Stripe.api_base}/v1/checkout/sessions?limit=3"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
context "Checkout.Session.list_line_items" do
|
||||||
|
should "support requests with args: session" do
|
||||||
|
Stripe::Checkout::Session.list_line_items("sess_xyz")
|
||||||
|
assert_requested :get, "#{Stripe.api_base}/v1/checkout/sessions/sess_xyz/line_items?"
|
||||||
|
end
|
||||||
|
end
|
||||||
context "Checkout.Session.retrieve" do
|
context "Checkout.Session.retrieve" do
|
||||||
should "support requests with args: id" do
|
should "support requests with args: id" do
|
||||||
Stripe::Checkout::Session.retrieve("cs_test_xxxxxxxxxxxxx")
|
Stripe::Checkout::Session.retrieve("cs_test_xxxxxxxxxxxxx")
|
||||||
@ -1101,6 +1106,12 @@ module Stripe
|
|||||||
assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/reopen?"
|
assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/reopen?"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
context "Order.retrieve" do
|
||||||
|
should "support requests with args: order" do
|
||||||
|
Stripe::Order.retrieve("order_xyz")
|
||||||
|
assert_requested :get, "#{Stripe.api_base}/v1/orders/order_xyz?"
|
||||||
|
end
|
||||||
|
end
|
||||||
context "Order.submit" do
|
context "Order.submit" do
|
||||||
should "support requests with args: order, expected_total" do
|
should "support requests with args: order, expected_total" do
|
||||||
Stripe::Order.submit("order_xyz", { expected_total: 100 })
|
Stripe::Order.submit("order_xyz", { expected_total: 100 })
|
||||||
@ -1108,13 +1119,12 @@ module Stripe
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
context "Order.update" do
|
context "Order.update" do
|
||||||
should "support requests with args: order" do
|
should "support requests with args: order, metadata, ip_address" do
|
||||||
Stripe::Order.update("order_xyz")
|
Stripe::Order.update(
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz?"
|
"order_xyz",
|
||||||
end
|
{ metadata: { reference_number: "123" }, ip_address: "0.0.0.0" }
|
||||||
should "support requests with args: order2" do
|
)
|
||||||
Stripe::Order.update("order_xyz")
|
assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz"
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz?"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
context "PaymentIntent.apply_customer_balance" do
|
context "PaymentIntent.apply_customer_balance" do
|
||||||
|
@ -40,35 +40,6 @@ module Stripe
|
|||||||
assert_requested :post, "#{Stripe.api_base}/v1/issuing/cards/ic_123"
|
assert_requested :post, "#{Stripe.api_base}/v1/issuing/cards/ic_123"
|
||||||
assert card.is_a?(Stripe::Issuing::Card)
|
assert card.is_a?(Stripe::Issuing::Card)
|
||||||
end
|
end
|
||||||
|
|
||||||
context "#details" do
|
|
||||||
should "retrieve a card's details" do
|
|
||||||
# The /details endpoint is deprecated and not in the spec so we mock
|
|
||||||
stub_request(:get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details")
|
|
||||||
.to_return(body: JSON.generate(object: "issuing.card_details"))
|
|
||||||
|
|
||||||
card_details = Stripe::Issuing::Card.details("ic_123")
|
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details"
|
|
||||||
assert card_details.is_a?(Stripe::Issuing::CardDetails)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context ".details" do
|
|
||||||
should "retrieve a card's details" do
|
|
||||||
# The /details endpoint is deprecated and not in the spec so we mock
|
|
||||||
stub_request(:get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details")
|
|
||||||
.to_return(body: JSON.generate(object: "issuing.card_details"))
|
|
||||||
|
|
||||||
card = Stripe::Issuing::Card.construct_from(
|
|
||||||
id: "ic_123",
|
|
||||||
object: "issuing.card_details"
|
|
||||||
)
|
|
||||||
card_details = card.details
|
|
||||||
|
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details"
|
|
||||||
assert card_details.is_a?(Stripe::Issuing::CardDetails)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require ::File.expand_path("../test_helper", __dir__)
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
class RecipientTest < Test::Unit::TestCase
|
|
||||||
should "be listable" do
|
|
||||||
recipients = Stripe::Recipient.list
|
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/recipients"
|
|
||||||
assert recipients.data.is_a?(Array)
|
|
||||||
assert recipients.data[0].is_a?(Stripe::Recipient)
|
|
||||||
end
|
|
||||||
|
|
||||||
should "be retrievable" do
|
|
||||||
recipient = Stripe::Recipient.retrieve("rp_123")
|
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/recipients/rp_123"
|
|
||||||
assert recipient.is_a?(Stripe::Recipient)
|
|
||||||
end
|
|
||||||
|
|
||||||
should "be creatable" do
|
|
||||||
recipient = Stripe::Recipient.create(
|
|
||||||
name: "Noah Jackson",
|
|
||||||
type: "individual"
|
|
||||||
)
|
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/recipients"
|
|
||||||
assert recipient.is_a?(Stripe::Recipient)
|
|
||||||
end
|
|
||||||
|
|
||||||
should "be saveable" do
|
|
||||||
recipient = Stripe::Recipient.retrieve("rp_123")
|
|
||||||
recipient.metadata["key"] = "value"
|
|
||||||
recipient.save
|
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/recipients/#{recipient.id}"
|
|
||||||
end
|
|
||||||
|
|
||||||
should "be updateable" do
|
|
||||||
recipient = Stripe::Recipient.update("rp_123", metadata: { foo: "bar" })
|
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/recipients/rp_123"
|
|
||||||
assert recipient.is_a?(Stripe::Recipient)
|
|
||||||
end
|
|
||||||
|
|
||||||
should "be deletable" do
|
|
||||||
end
|
|
||||||
|
|
||||||
context "#delete" do
|
|
||||||
should "be deletable" do
|
|
||||||
recipient = Stripe::Recipient.retrieve("rp_123")
|
|
||||||
recipient = recipient.delete
|
|
||||||
assert_requested :delete, "#{Stripe.api_base}/v1/recipients/#{recipient.id}"
|
|
||||||
assert recipient.is_a?(Stripe::Recipient)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context ".delete" do
|
|
||||||
should "be deletable" do
|
|
||||||
recipient = Stripe::Recipient.delete("rp_123")
|
|
||||||
assert_requested :delete, "#{Stripe.api_base}/v1/recipients/rp_123"
|
|
||||||
assert recipient.is_a?(Stripe::Recipient)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -44,7 +44,7 @@ module Stripe
|
|||||||
context "#delete" do
|
context "#delete" do
|
||||||
should "be deletable" do
|
should "be deletable" do
|
||||||
subscription = Stripe::Subscription.retrieve("sub_123")
|
subscription = Stripe::Subscription.retrieve("sub_123")
|
||||||
subscription = subscription.delete
|
subscription = subscription.cancel
|
||||||
assert_requested :delete,
|
assert_requested :delete,
|
||||||
"#{Stripe.api_base}/v1/subscriptions/#{subscription.id}"
|
"#{Stripe.api_base}/v1/subscriptions/#{subscription.id}"
|
||||||
assert subscription.is_a?(Stripe::Subscription)
|
assert subscription.is_a?(Stripe::Subscription)
|
||||||
@ -53,7 +53,7 @@ module Stripe
|
|||||||
|
|
||||||
context ".delete" do
|
context ".delete" do
|
||||||
should "be deletable" do
|
should "be deletable" do
|
||||||
subscription = Stripe::Subscription.delete("sub_123")
|
subscription = Stripe::Subscription.cancel("sub_123")
|
||||||
assert_requested :delete,
|
assert_requested :delete,
|
||||||
"#{Stripe.api_base}/v1/subscriptions/sub_123"
|
"#{Stripe.api_base}/v1/subscriptions/sub_123"
|
||||||
assert subscription.is_a?(Stripe::Subscription)
|
assert subscription.is_a?(Stripe::Subscription)
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require ::File.expand_path("../test_helper", __dir__)
|
|
||||||
|
|
||||||
module Stripe
|
|
||||||
class ThreeDSecureTest < Test::Unit::TestCase
|
|
||||||
should "be retrievable" do
|
|
||||||
secure = Stripe::ThreeDSecure.retrieve("tdsrc_123")
|
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/3d_secure/tdsrc_123"
|
|
||||||
assert secure.is_a?(Stripe::ThreeDSecure)
|
|
||||||
end
|
|
||||||
|
|
||||||
should "be creatable" do
|
|
||||||
_ = Stripe::ThreeDSecure.create(
|
|
||||||
card: "tok_123",
|
|
||||||
amount: 1500,
|
|
||||||
currency: "usd",
|
|
||||||
return_url: "https://example.org/3d-secure-result"
|
|
||||||
)
|
|
||||||
assert_requested :post, "#{Stripe.api_base}/v1/3d_secure"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -4,23 +4,16 @@ require ::File.expand_path("../test_helper", __dir__)
|
|||||||
|
|
||||||
module Stripe
|
module Stripe
|
||||||
class UsageRecordSummaryTest < Test::Unit::TestCase
|
class UsageRecordSummaryTest < Test::Unit::TestCase
|
||||||
setup do
|
|
||||||
@sub_item = Stripe::SubscriptionItem.retrieve("si_123")
|
|
||||||
end
|
|
||||||
|
|
||||||
should "be listable" do
|
should "be listable" do
|
||||||
old_stderr = $stderr
|
old_stderr = $stderr
|
||||||
$stderr = StringIO.new
|
$stderr = StringIO.new
|
||||||
|
|
||||||
begin
|
begin
|
||||||
transactions = @sub_item.usage_record_summaries
|
transactions = Stripe::SubscriptionItem.list_usage_record_summaries("si_123")
|
||||||
|
|
||||||
assert_requested :get, "#{Stripe.api_base}/v1/subscription_items/#{@sub_item.id}/usage_record_summaries"
|
assert_requested :get, "#{Stripe.api_base}/v1/subscription_items/si_123/usage_record_summaries"
|
||||||
assert transactions.data.is_a?(Array)
|
assert transactions.data.is_a?(Array)
|
||||||
assert transactions.first.is_a?(Stripe::UsageRecordSummary)
|
assert transactions.first.is_a?(Stripe::UsageRecordSummary)
|
||||||
|
|
||||||
assert_include $stderr.string,
|
|
||||||
"use SubscriptionItem.list_usage_record_summaries instead"
|
|
||||||
ensure
|
ensure
|
||||||
$stderr = old_stderr
|
$stderr = old_stderr
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user