Update generated code for v1329

This commit is contained in:
Stripe OpenAPI 2024-11-04 23:42:37 +00:00
parent 37eeea65aa
commit 70dae52d5c
9 changed files with 258 additions and 2 deletions

View File

@ -1 +1 @@
v1321
v1329

View File

@ -97,11 +97,13 @@ module Stripe
Mandate.object_name => Mandate,
Margin.object_name => Margin,
Order.object_name => Order,
PaymentAttemptRecord.object_name => PaymentAttemptRecord,
PaymentIntent.object_name => PaymentIntent,
PaymentLink.object_name => PaymentLink,
PaymentMethod.object_name => PaymentMethod,
PaymentMethodConfiguration.object_name => PaymentMethodConfiguration,
PaymentMethodDomain.object_name => PaymentMethodDomain,
PaymentRecord.object_name => PaymentRecord,
Payout.object_name => Payout,
Person.object_name => Person,
Plan.object_name => Plan,

View File

@ -85,11 +85,13 @@ require "stripe/resources/login_link"
require "stripe/resources/mandate"
require "stripe/resources/margin"
require "stripe/resources/order"
require "stripe/resources/payment_attempt_record"
require "stripe/resources/payment_intent"
require "stripe/resources/payment_link"
require "stripe/resources/payment_method"
require "stripe/resources/payment_method_configuration"
require "stripe/resources/payment_method_domain"
require "stripe/resources/payment_record"
require "stripe/resources/payout"
require "stripe/resources/person"
require "stripe/resources/plan"

View File

@ -0,0 +1,27 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# A Payment Attempt Record represents an individual attempt at making a payment, on or off Stripe.
# Each payment attempt tries to collect a fixed amount of money from a fixed customer and payment
# method. Payment Attempt Records are attached to Payment Records. Only one attempt per Payment Record
# can have guaranteed funds.
class PaymentAttemptRecord < APIResource
extend Stripe::APIOperations::List
OBJECT_NAME = "payment_attempt_record"
def self.object_name
"payment_attempt_record"
end
# List all the Payment Attempt Records attached to the specified Payment Record.
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/payment_attempt_records",
params: filters,
opts: opts
)
end
end
end

View File

@ -0,0 +1,115 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# A Payment Record is a resource that allows you to represent payments that occur on- or off-Stripe.
# For example, you can create a Payment Record to model a payment made on a different payment processor,
# in order to mark an Invoice as paid and a Subscription as active. Payment Records consist of one or
# more Payment Attempt Records, which represent individual attempts made on a payment network.
class PaymentRecord < APIResource
OBJECT_NAME = "payment_record"
def self.object_name
"payment_record"
end
# Report a new Payment Record. You may report a Payment Record as it is
# initialized and later report updates through the other report_* methods, or report Payment
# Records in a terminal state directly, through this method.
def self.report_payment(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/payment_records/report_payment",
params: params,
opts: opts
)
end
# Report a new payment attempt on the specified Payment Record. A new payment
# attempt can only be specified if all other payment attempts are canceled or failed.
def report_payment_attempt(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Report a new payment attempt on the specified Payment Record. A new payment
# attempt can only be specified if all other payment attempts are canceled or failed.
def self.report_payment_attempt(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Report that the most recent payment attempt on the specified Payment Record
# was canceled.
def report_payment_attempt_canceled(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Report that the most recent payment attempt on the specified Payment Record
# was canceled.
def self.report_payment_attempt_canceled(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Report that the most recent payment attempt on the specified Payment Record
# failed or errored.
def report_payment_attempt_failed(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Report that the most recent payment attempt on the specified Payment Record
# failed or errored.
def self.report_payment_attempt_failed(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Report that the most recent payment attempt on the specified Payment Record
# was guaranteed.
def report_payment_attempt_guaranteed(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Report that the most recent payment attempt on the specified Payment Record
# was guaranteed.
def self.report_payment_attempt_guaranteed(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
end
end

View File

@ -101,12 +101,14 @@ require "stripe/services/mandate_service"
require "stripe/services/margin_service"
require "stripe/services/order_line_item_service"
require "stripe/services/order_service"
require "stripe/services/payment_attempt_record_service"
require "stripe/services/payment_intent_service"
require "stripe/services/payment_link_line_item_service"
require "stripe/services/payment_link_service"
require "stripe/services/payment_method_configuration_service"
require "stripe/services/payment_method_domain_service"
require "stripe/services/payment_method_service"
require "stripe/services/payment_record_service"
require "stripe/services/payout_service"
require "stripe/services/plan_service"
require "stripe/services/price_service"

View File

@ -0,0 +1,28 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
class PaymentAttemptRecordService < StripeService
# List all the Payment Attempt Records attached to the specified Payment Record.
def list(params = {}, opts = {})
request(
method: :get,
path: "/v1/payment_attempt_records",
params: params,
opts: opts,
base_address: :api
)
end
# Retrieves a Payment Attempt Record with the given ID
def retrieve(id, params = {}, opts = {})
request(
method: :get,
path: format("/v1/payment_attempt_records/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end

View File

@ -0,0 +1,78 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
class PaymentRecordService < StripeService
# Report a new Payment Record. You may report a Payment Record as it is
# initialized and later report updates through the other report_* methods, or report Payment
# Records in a terminal state directly, through this method.
def report_payment(params = {}, opts = {})
request(
method: :post,
path: "/v1/payment_records/report_payment",
params: params,
opts: opts,
base_address: :api
)
end
# Report a new payment attempt on the specified Payment Record. A new payment
# attempt can only be specified if all other payment attempts are canceled or failed.
def report_payment_attempt(id, params = {}, opts = {})
request(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
# Report that the most recent payment attempt on the specified Payment Record
# was canceled.
def report_payment_attempt_canceled(id, params = {}, opts = {})
request(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
# Report that the most recent payment attempt on the specified Payment Record
# failed or errored.
def report_payment_attempt_failed(id, params = {}, opts = {})
request(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
# Report that the most recent payment attempt on the specified Payment Record
# was guaranteed.
def report_payment_attempt_guaranteed(id, params = {}, opts = {})
request(
method: :post,
path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
# Retrieves a Payment Record with the given ID
def retrieve(id, params = {}, opts = {})
request(
method: :get,
path: format("/v1/payment_records/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end

View File

@ -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_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, :gift_cards, :identity, :invoices, :invoice_rendering_templates, :invoice_items, :issuing, :mandates, :margins, :orders, :payment_intents, :payment_links, :payment_methods, :payment_method_configurations, :payment_method_domains, :payouts, :plans, :prices, :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
attr_reader :account_links, :account_notices, :account_sessions, :apple_pay_domains, :application_fees, :apps, :balance, :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, :gift_cards, :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, :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
# v1 accessors: The end of the section generated from our OpenAPI spec
# OAuthService is manually maintained, as it has special behaviors
@ -53,11 +53,13 @@ module Stripe
@mandates = Stripe::MandateService.new(@requestor)
@margins = Stripe::MarginService.new(@requestor)
@orders = Stripe::OrderService.new(@requestor)
@payment_attempt_records = Stripe::PaymentAttemptRecordService.new(@requestor)
@payment_intents = Stripe::PaymentIntentService.new(@requestor)
@payment_links = Stripe::PaymentLinkService.new(@requestor)
@payment_methods = Stripe::PaymentMethodService.new(@requestor)
@payment_method_configurations = Stripe::PaymentMethodConfigurationService.new(@requestor)
@payment_method_domains = Stripe::PaymentMethodDomainService.new(@requestor)
@payment_records = Stripe::PaymentRecordService.new(@requestor)
@payouts = Stripe::PayoutService.new(@requestor)
@plans = Stripe::PlanService.new(@requestor)
@prices = Stripe::PriceService.new(@requestor)