Skip to content

Commit

Permalink
Merge pull request #1480 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Nov 7, 2024
2 parents 4217591 + e30dd59 commit 44e28a3
Show file tree
Hide file tree
Showing 18 changed files with 345 additions and 15 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
* [#1477](https://github.com/stripe/stripe-ruby/pull/1477) Update generated code for beta
* Add support for `trigger_action` method on resource `PaymentIntent`

## 13.1.1 - 2024-11-06
* [#1483](https://github.com/stripe/stripe-ruby/pull/1483) Fix APIResource#retrieve not sending `stripe_version`
* [#1478](https://github.com/stripe/stripe-ruby/pull/1478) Update changelog with a note on 2024-10-28.acacia API version

## 13.1.0 - 2024-10-29
* [#1472](https://github.com/stripe/stripe-ruby/pull/1472) Update generated code
* [#1472](https://github.com/stripe/stripe-ruby/pull/1472) This release changes the pinned API version to `2024-10-28.acacia`.
* Add support for `submit_card` test helper method on resource `Issuing.Card`
* Add support for new resource `V2.EventDestinations`
* Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1319
v1333
3 changes: 3 additions & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def self.object_names_to_classes
Issuing::CreditUnderwritingRecord.object_name => Issuing::CreditUnderwritingRecord,
Issuing::Dispute.object_name => Issuing::Dispute,
Issuing::DisputeSettlementDetail.object_name => Issuing::DisputeSettlementDetail,
Issuing::FraudLiabilityDebit.object_name => Issuing::FraudLiabilityDebit,
Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
Issuing::Token.object_name => Issuing::Token,
Expand All @@ -96,11 +97,13 @@ def self.object_names_to_classes
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,
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/request_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def self.combine_opts(object_opts, req_opts)
idempotency_key: req_opts[:idempotency_key],
stripe_account: req_opts[:stripe_account] || object_opts[:stripe_account],
stripe_context: req_opts[:stripe_context] || object_opts[:stripe_context],
stripe_version: req_opts[:stripe_version] || object_opts[:api_version],
stripe_version: req_opts[:stripe_version] || object_opts[:stripe_version],
}

# Remove nil values from headers
Expand Down
3 changes: 3 additions & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
require "stripe/resources/issuing/credit_underwriting_record"
require "stripe/resources/issuing/dispute"
require "stripe/resources/issuing/dispute_settlement_detail"
require "stripe/resources/issuing/fraud_liability_debit"
require "stripe/resources/issuing/personalization_design"
require "stripe/resources/issuing/physical_bundle"
require "stripe/resources/issuing/token"
Expand All @@ -84,11 +85,13 @@
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"
Expand Down
11 changes: 5 additions & 6 deletions lib/stripe/resources/billing/credit_grant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module Billing
# A credit grant is an API resource that documents the allocation of some billing credits to a customer.
#
# Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
# end
class CreditGrant < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
Expand All @@ -27,7 +26,7 @@ def self.create(params = {}, opts = {})
)
end

# Expires a credit grant
# Expires a credit grant.
def expire(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -37,7 +36,7 @@ def expire(params = {}, opts = {})
)
end

# Expires a credit grant
# Expires a credit grant.
def self.expire(id, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -47,7 +46,7 @@ def self.expire(id, params = {}, opts = {})
)
end

# Retrieve a list of credit grants
# Retrieve a list of credit grants.
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
Expand All @@ -67,7 +66,7 @@ def self.update(id, params = {}, opts = {})
)
end

# Voids a credit grant
# Voids a credit grant.
def void_grant(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -77,7 +76,7 @@ def void_grant(params = {}, opts = {})
)
end

# Voids a credit grant
# Voids a credit grant.
def self.void_grant(id, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/issuing/card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Stripe
module Issuing
# You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders.
# You can [create physical or virtual cards](https://stripe.com/docs/issuing) that are issued to cardholders.
class Card < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
Expand Down
26 changes: 26 additions & 0 deletions lib/stripe/resources/issuing/fraud_liability_debit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Issuing
# A fraud liability debit occurs when Stripe debits a platform's account for fraud losses on Issuing transactions.
class FraudLiabilityDebit < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "issuing.fraud_liability_debit"
def self.object_name
"issuing.fraud_liability_debit"
end

# Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/issuing/fraud_liability_debits",
params: filters,
opts: opts
)
end
end
end
end
27 changes: 27 additions & 0 deletions lib/stripe/resources/payment_attempt_record.rb
Original file line number Diff line number Diff line change
@@ -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
115 changes: 115 additions & 0 deletions lib/stripe/resources/payment_record.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions lib/stripe/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
require "stripe/services/issuing/credit_underwriting_record_service"
require "stripe/services/issuing/dispute_service"
require "stripe/services/issuing/dispute_settlement_detail_service"
require "stripe/services/issuing/fraud_liability_debit_service"
require "stripe/services/issuing/personalization_design_service"
require "stripe/services/issuing/physical_bundle_service"
require "stripe/services/issuing/token_service"
Expand All @@ -100,12 +101,14 @@
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"
Expand Down
6 changes: 3 additions & 3 deletions lib/stripe/services/billing/credit_grant_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create(params = {}, opts = {})
)
end

# Expires a credit grant
# Expires a credit grant.
def expire(id, params = {}, opts = {})
request(
method: :post,
Expand All @@ -26,7 +26,7 @@ def expire(id, params = {}, opts = {})
)
end

# Retrieve a list of credit grants
# Retrieve a list of credit grants.
def list(params = {}, opts = {})
request(
method: :get,
Expand Down Expand Up @@ -59,7 +59,7 @@ def update(id, params = {}, opts = {})
)
end

# Voids a credit grant
# Voids a credit grant.
def void_grant(id, params = {}, opts = {})
request(
method: :post,
Expand Down
30 changes: 30 additions & 0 deletions lib/stripe/services/issuing/fraud_liability_debit_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Issuing
class FraudLiabilityDebitService < StripeService
# Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
def list(params = {}, opts = {})
request(
method: :get,
path: "/v1/issuing/fraud_liability_debits",
params: params,
opts: opts,
base_address: :api
)
end

# Retrieves an Issuing FraudLiabilityDebit object.
def retrieve(fraud_liability_debit, params = {}, opts = {})
request(
method: :get,
path: format("/v1/issuing/fraud_liability_debits/%<fraud_liability_debit>s", { fraud_liability_debit: CGI.escape(fraud_liability_debit) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end
end
Loading

0 comments on commit 44e28a3

Please sign in to comment.