stripe-openapi[bot] cbd4d56832
Update generated code (#1631)
* Update generated code for v1929 and 2025-08-27.basil

* Update generated code for v1930 and 2025-08-27.basil

* Update generated code for v1931 and 2025-08-27.basil

* Update generated code for v1932 and 2025-08-27.basil

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com>
2025-08-27 07:31:02 +00:00

131 lines
4.4 KiB
Ruby

# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module TestHelpers
module Terminal
class ReaderService < StripeService
class PresentPaymentMethodParams < Stripe::RequestParams
class Card < Stripe::RequestParams
# Card security code.
attr_accessor :cvc
# Two-digit number representing the card's expiration month.
attr_accessor :exp_month
# Two- or four-digit number representing the card's expiration year.
attr_accessor :exp_year
# The card number, as a string without any separators.
attr_accessor :number
def initialize(cvc: nil, exp_month: nil, exp_year: nil, number: nil)
@cvc = cvc
@exp_month = exp_month
@exp_year = exp_year
@number = number
end
end
class CardPresent < Stripe::RequestParams
# The card number, as a string without any separators.
attr_accessor :number
def initialize(number: nil)
@number = number
end
end
class InteracPresent < Stripe::RequestParams
# Card Number
attr_accessor :number
def initialize(number: nil)
@number = number
end
end
# Simulated on-reader tip amount.
attr_accessor :amount_tip
# Simulated data for the card payment method.
attr_accessor :card
# Simulated data for the card_present payment method.
attr_accessor :card_present
# Specifies which fields in the response should be expanded.
attr_accessor :expand
# Simulated data for the interac_present payment method.
attr_accessor :interac_present
# Simulated payment type.
attr_accessor :type
def initialize(
amount_tip: nil,
card: nil,
card_present: nil,
expand: nil,
interac_present: nil,
type: nil
)
@amount_tip = amount_tip
@card = card
@card_present = card_present
@expand = expand
@interac_present = interac_present
@type = type
end
end
class SucceedInputCollectionParams < Stripe::RequestParams
# Specifies which fields in the response should be expanded.
attr_accessor :expand
# This parameter defines the skip behavior for input collection.
attr_accessor :skip_non_required_inputs
def initialize(expand: nil, skip_non_required_inputs: nil)
@expand = expand
@skip_non_required_inputs = skip_non_required_inputs
end
end
class TimeoutInputCollectionParams < Stripe::RequestParams
# Specifies which fields in the response should be expanded.
attr_accessor :expand
def initialize(expand: nil)
@expand = expand
end
end
# Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
def present_payment_method(reader, params = {}, opts = {})
request(
method: :post,
path: format("/v1/test_helpers/terminal/readers/%<reader>s/present_payment_method", { reader: CGI.escape(reader) }),
params: params,
opts: opts,
base_address: :api
)
end
# Use this endpoint to trigger a successful input collection on a simulated reader.
def succeed_input_collection(reader, params = {}, opts = {})
request(
method: :post,
path: format("/v1/test_helpers/terminal/readers/%<reader>s/succeed_input_collection", { reader: CGI.escape(reader) }),
params: params,
opts: opts,
base_address: :api
)
end
# Use this endpoint to complete an input collection with a timeout error on a simulated reader.
def timeout_input_collection(reader, params = {}, opts = {})
request(
method: :post,
path: format("/v1/test_helpers/terminal/readers/%<reader>s/timeout_input_collection", { reader: CGI.escape(reader) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end
end
end