# File generated from our OpenAPI spec # frozen_string_literal: true module Stripe module Terminal # A Reader represents a physical device for accepting payment details. # # Related guide: [Connecting to a reader](https://stripe.com/docs/terminal/payments/connect-reader) class Reader < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete extend Stripe::APIOperations::List include Stripe::APIOperations::Save OBJECT_NAME = "terminal.reader" def cancel_action(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/cancel_action", { reader: CGI.escape(self["id"]) }), params: params, opts: opts ) end def process_payment_intent(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/process_payment_intent", { reader: CGI.escape(self["id"]) }), params: params, opts: opts ) end def process_setup_intent(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/process_setup_intent", { reader: CGI.escape(self["id"]) }), params: params, opts: opts ) end def refund_payment(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/refund_payment", { reader: CGI.escape(self["id"]) }), params: params, opts: opts ) end def set_reader_display(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/set_reader_display", { reader: CGI.escape(self["id"]) }), params: params, opts: opts ) end def self.cancel_action(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/cancel_action", { reader: CGI.escape(reader) }), params: params, opts: opts ) end def self.process_payment_intent(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/process_payment_intent", { reader: CGI.escape(reader) }), params: params, opts: opts ) end def self.process_setup_intent(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/process_setup_intent", { reader: CGI.escape(reader) }), params: params, opts: opts ) end def self.refund_payment(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/refund_payment", { reader: CGI.escape(reader) }), params: params, opts: opts ) end def self.set_reader_display(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%s/set_reader_display", { reader: CGI.escape(reader) }), params: params, opts: opts ) end def test_helpers TestHelpers.new(self) end class TestHelpers < APIResourceTestHelpers RESOURCE_CLASS = Reader def self.present_payment_method(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%s/present_payment_method", { reader: CGI.escape(reader) }), params: params, opts: opts ) end def present_payment_method(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%s/present_payment_method", { reader: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end end end end end