Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1868
v1868
56 changes: 56 additions & 0 deletions lib/stripe/resources/invoice_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module Stripe
# This resource and its endpoints allows you to easily track if a payment is associated with a specific invoice and
# monitor the allocation details of the payments.
class InvoicePayment < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "invoice_payment"
def self.object_name
"invoice_payment"
Expand All @@ -33,6 +35,55 @@ class StatusTransitions < Stripe::StripeObject
# The time that the payment succeeded.
attr_reader :paid_at
end

class ListParams < Stripe::RequestParams
class Payment < Stripe::RequestParams
# Only return invoice payments associated by this payment intent ID.
attr_accessor :payment_intent
# Attribute for param field payment_record
attr_accessor :payment_record
# Only return invoice payments associated by this payment type.
attr_accessor :type

def initialize(payment_intent: nil, payment_record: nil, type: nil)
@payment_intent = payment_intent
@payment_record = payment_record
@type = type
end
end
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
attr_accessor :ending_before
# Specifies which fields in the response should be expanded.
attr_accessor :expand
# The identifier of the invoice whose payments to return.
attr_accessor :invoice
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
attr_accessor :limit
# The payment details of the invoice payments to return.
attr_accessor :payment
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
attr_accessor :starting_after
# The status of the invoice payments to return.
attr_accessor :status

def initialize(
ending_before: nil,
expand: nil,
invoice: nil,
limit: nil,
payment: nil,
starting_after: nil,
status: nil
)
@ending_before = ending_before
@expand = expand
@invoice = invoice
@limit = limit
@payment = payment
@starting_after = starting_after
@status = status
end
end
# Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent’s `amount_received` is not sufficient to pay all of the invoices that it is attached to.
attr_reader :amount_paid
# Amount intended to be paid toward this invoice, in cents (or local equivalent)
Expand All @@ -57,5 +108,10 @@ class StatusTransitions < Stripe::StripeObject
attr_reader :status
# Attribute for field status_transitions
attr_reader :status_transitions

# When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments.
def self.list(params = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/invoice_payments", params: params, opts: opts)
end
end
end
1 change: 1 addition & 0 deletions lib/stripe/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
require "stripe/services/identity_service"
require "stripe/services/invoice_item_service"
require "stripe/services/invoice_line_item_service"
require "stripe/services/invoice_payment_service"
require "stripe/services/invoice_rendering_template_service"
require "stripe/services/invoice_service"
require "stripe/services/issuing/authorization_service"
Expand Down
86 changes: 86 additions & 0 deletions lib/stripe/services/invoice_payment_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
class InvoicePaymentService < StripeService
class ListParams < Stripe::RequestParams
class Payment < Stripe::RequestParams
# Only return invoice payments associated by this payment intent ID.
attr_accessor :payment_intent
# Attribute for param field payment_record
attr_accessor :payment_record
# Only return invoice payments associated by this payment type.
attr_accessor :type

def initialize(payment_intent: nil, payment_record: nil, type: nil)
@payment_intent = payment_intent
@payment_record = payment_record
@type = type
end
end
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
attr_accessor :ending_before
# Specifies which fields in the response should be expanded.
attr_accessor :expand
# The identifier of the invoice whose payments to return.
attr_accessor :invoice
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
attr_accessor :limit
# The payment details of the invoice payments to return.
attr_accessor :payment
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
attr_accessor :starting_after
# The status of the invoice payments to return.
attr_accessor :status

def initialize(
ending_before: nil,
expand: nil,
invoice: nil,
limit: nil,
payment: nil,
starting_after: nil,
status: nil
)
@ending_before = ending_before
@expand = expand
@invoice = invoice
@limit = limit
@payment = payment
@starting_after = starting_after
@status = status
end
end

class RetrieveParams < Stripe::RequestParams
# Specifies which fields in the response should be expanded.
attr_accessor :expand

def initialize(expand: nil)
@expand = expand
end
end

# When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments.
def list(params = {}, opts = {})
request(
method: :get,
path: "/v1/invoice_payments",
params: params,
opts: opts,
base_address: :api
)
end

# Retrieves the invoice payment with the given ID.
def retrieve(invoice_payment, params = {}, opts = {})
request(
method: :get,
path: format("/v1/invoice_payments/%<invoice_payment>s", { invoice_payment: CGI.escape(invoice_payment) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end
3 changes: 2 additions & 1 deletion lib/stripe/services/v1_services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Stripe
class V1Services < StripeService
# v1 accessors: The beginning of the section generated from our OpenAPI spec
attr_reader :accounts
attr_reader :account_links, :account_notices, :account_sessions, :apple_pay_domains, :application_fees, :apps, :balance, :balance_settings, :balance_transactions, :billing, :billing_portal, :capital, :charges, :checkout, :climate, :confirmation_tokens, :test_helpers, :country_specs, :coupons, :credit_notes, :customers, :customer_sessions, :disputes, :entitlements, :ephemeral_keys, :events, :exchange_rates, :files, :file_links, :financial_connections, :forwarding, :fx_quotes, :identity, :invoices, :invoice_rendering_templates, :invoice_items, :issuing, :mandates, :margins, :orders, :payment_attempt_records, :payment_intents, :payment_links, :payment_methods, :payment_method_configurations, :payment_method_domains, :payment_records, :payouts, :plans, :prices, :privacy, :products, :promotion_codes, :quotes, :radar, :refunds, :reporting, :reviews, :sigma, :setup_attempts, :setup_intents, :shipping_rates, :sources, :subscriptions, :subscription_items, :subscription_schedules, :tax, :tax_codes, :tax_ids, :tax_rates, :terminal, :tokens, :topups, :transfers, :treasury, :webhook_endpoints, :external_accounts
attr_reader :account_links, :account_notices, :account_sessions, :apple_pay_domains, :application_fees, :apps, :balance, :balance_settings, :balance_transactions, :billing, :billing_portal, :capital, :charges, :checkout, :climate, :confirmation_tokens, :test_helpers, :country_specs, :coupons, :credit_notes, :customers, :customer_sessions, :disputes, :entitlements, :ephemeral_keys, :events, :exchange_rates, :files, :file_links, :financial_connections, :forwarding, :fx_quotes, :identity, :invoices, :invoice_payments, :invoice_rendering_templates, :invoice_items, :issuing, :mandates, :margins, :orders, :payment_attempt_records, :payment_intents, :payment_links, :payment_methods, :payment_method_configurations, :payment_method_domains, :payment_records, :payouts, :plans, :prices, :privacy, :products, :promotion_codes, :quotes, :radar, :refunds, :reporting, :reviews, :sigma, :setup_attempts, :setup_intents, :shipping_rates, :sources, :subscriptions, :subscription_items, :subscription_schedules, :tax, :tax_codes, :tax_ids, :tax_rates, :terminal, :tokens, :topups, :transfers, :treasury, :webhook_endpoints, :external_accounts
# v1 accessors: The end of the section generated from our OpenAPI spec

# OAuthService is manually maintained, as it has special behaviors
Expand Down Expand Up @@ -48,6 +48,7 @@ def initialize(requestor)
@fx_quotes = Stripe::FxQuoteService.new(@requestor)
@identity = Stripe::IdentityService.new(@requestor)
@invoices = Stripe::InvoiceService.new(@requestor)
@invoice_payments = Stripe::InvoicePaymentService.new(@requestor)
@invoice_rendering_templates = Stripe::InvoiceRenderingTemplateService.new(@requestor)
@invoice_items = Stripe::InvoiceItemService.new(@requestor)
@issuing = Stripe::IssuingService.new(@requestor)
Expand Down
131 changes: 130 additions & 1 deletion rbi/stripe.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -33808,6 +33808,61 @@ module Stripe
# Attribute for field status_transitions
sig { returns(StatusTransitions) }
attr_reader :status_transitions
class ListParams < Stripe::RequestParams
class Payment < Stripe::RequestParams
# Only return invoice payments associated by this payment intent ID.
sig { returns(T.nilable(String)) }
attr_accessor :payment_intent
# Attribute for param field payment_record
sig { returns(T.nilable(String)) }
attr_accessor :payment_record
# Only return invoice payments associated by this payment type.
sig { returns(String) }
attr_accessor :type
sig {
params(payment_intent: T.nilable(String), payment_record: T.nilable(String), type: String).void
}
def initialize(payment_intent: nil, payment_record: nil, type: nil); end
end
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
sig { returns(T.nilable(String)) }
attr_accessor :ending_before
# Specifies which fields in the response should be expanded.
sig { returns(T.nilable(T::Array[String])) }
attr_accessor :expand
# The identifier of the invoice whose payments to return.
sig { returns(T.nilable(String)) }
attr_accessor :invoice
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
sig { returns(T.nilable(Integer)) }
attr_accessor :limit
# The payment details of the invoice payments to return.
sig { returns(T.nilable(::Stripe::InvoicePayment::ListParams::Payment)) }
attr_accessor :payment
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
sig { returns(T.nilable(String)) }
attr_accessor :starting_after
# The status of the invoice payments to return.
sig { returns(T.nilable(String)) }
attr_accessor :status
sig {
params(ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), invoice: T.nilable(String), limit: T.nilable(Integer), payment: T.nilable(::Stripe::InvoicePayment::ListParams::Payment), starting_after: T.nilable(String), status: T.nilable(String)).void
}
def initialize(
ending_before: nil,
expand: nil,
invoice: nil,
limit: nil,
payment: nil,
starting_after: nil,
status: nil
); end
end
# When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments.
sig {
params(params: T.any(::Stripe::InvoicePayment::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
}
def self.list(params = {}, opts = {}); end
end
end
# typed: true
Expand Down Expand Up @@ -113216,6 +113271,7 @@ module Stripe
attr_reader :fx_quotes
attr_reader :identity
attr_reader :invoices
attr_reader :invoice_payments
attr_reader :invoice_rendering_templates
attr_reader :invoice_items
attr_reader :issuing
Expand Down Expand Up @@ -140413,6 +140469,79 @@ module Stripe
end
end
# typed: true
module Stripe
class InvoicePaymentService < StripeService
class ListParams < Stripe::RequestParams
class Payment < Stripe::RequestParams
# Only return invoice payments associated by this payment intent ID.
sig { returns(T.nilable(String)) }
attr_accessor :payment_intent
# Attribute for param field payment_record
sig { returns(T.nilable(String)) }
attr_accessor :payment_record
# Only return invoice payments associated by this payment type.
sig { returns(String) }
attr_accessor :type
sig {
params(payment_intent: T.nilable(String), payment_record: T.nilable(String), type: String).void
}
def initialize(payment_intent: nil, payment_record: nil, type: nil); end
end
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
sig { returns(T.nilable(String)) }
attr_accessor :ending_before
# Specifies which fields in the response should be expanded.
sig { returns(T.nilable(T::Array[String])) }
attr_accessor :expand
# The identifier of the invoice whose payments to return.
sig { returns(T.nilable(String)) }
attr_accessor :invoice
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
sig { returns(T.nilable(Integer)) }
attr_accessor :limit
# The payment details of the invoice payments to return.
sig { returns(T.nilable(::Stripe::InvoicePaymentService::ListParams::Payment)) }
attr_accessor :payment
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
sig { returns(T.nilable(String)) }
attr_accessor :starting_after
# The status of the invoice payments to return.
sig { returns(T.nilable(String)) }
attr_accessor :status
sig {
params(ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), invoice: T.nilable(String), limit: T.nilable(Integer), payment: T.nilable(::Stripe::InvoicePaymentService::ListParams::Payment), starting_after: T.nilable(String), status: T.nilable(String)).void
}
def initialize(
ending_before: nil,
expand: nil,
invoice: nil,
limit: nil,
payment: nil,
starting_after: nil,
status: nil
); end
end
class RetrieveParams < Stripe::RequestParams
# Specifies which fields in the response should be expanded.
sig { returns(T.nilable(T::Array[String])) }
attr_accessor :expand
sig { params(expand: T.nilable(T::Array[String])).void }
def initialize(expand: nil); end
end
# When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments.
sig {
params(params: T.any(::Stripe::InvoicePaymentService::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
}
def list(params = {}, opts = {}); end

# Retrieves the invoice payment with the given ID.
sig {
params(invoice_payment: String, params: T.any(::Stripe::InvoicePaymentService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::InvoicePayment)
}
def retrieve(invoice_payment, params = {}, opts = {}); end
end
end
# typed: true
module Stripe
class InvoiceRenderingTemplateService < StripeService
class ListParams < Stripe::RequestParams
Expand Down Expand Up @@ -199013,4 +199142,4 @@ module Stripe
end
end
end
end
end
Loading