Class: Stripe::Terminal::Reader

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Delete, APIOperations::Save
Defined in:
lib/stripe/resources/terminal/reader.rb

Overview

A Reader represents a physical device for accepting payment details.

Related guide: [Connecting to a reader](stripe.com/docs/terminal/payments/connect-reader)

Defined Under Namespace

Classes: Action, CancelActionParams, CollectInputsParams, CreateParams, DeleteParams, ListParams, PresentPaymentMethodParams, ProcessPaymentIntentParams, ProcessSetupIntentParams, RefundPaymentParams, SetReaderDisplayParams, SucceedInputCollectionParams, TestHelpers, TimeoutInputCollectionParams, UpdateParams

Constant Summary collapse

OBJECT_NAME =
"terminal.reader"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

Methods included from APIOperations::Delete

included

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#actionObject (readonly)

The most recent action performed by the reader.



633
634
635
# File 'lib/stripe/resources/terminal/reader.rb', line 633

def action
  @action
end

#deletedObject (readonly)

Always true for a deleted object



657
658
659
# File 'lib/stripe/resources/terminal/reader.rb', line 657

def deleted
  @deleted
end

#device_sw_versionObject (readonly)

The current software version of the reader.



635
636
637
# File 'lib/stripe/resources/terminal/reader.rb', line 635

def device_sw_version
  @device_sw_version
end

#device_typeObject (readonly)

Device type of the reader.



637
638
639
# File 'lib/stripe/resources/terminal/reader.rb', line 637

def device_type
  @device_type
end

#idObject (readonly)

Unique identifier for the object.



639
640
641
# File 'lib/stripe/resources/terminal/reader.rb', line 639

def id
  @id
end

#ip_addressObject (readonly)

The local IP address of the reader.



641
642
643
# File 'lib/stripe/resources/terminal/reader.rb', line 641

def ip_address
  @ip_address
end

#labelObject (readonly)

Custom label given to the reader for easier identification.



643
644
645
# File 'lib/stripe/resources/terminal/reader.rb', line 643

def label
  @label
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



645
646
647
# File 'lib/stripe/resources/terminal/reader.rb', line 645

def livemode
  @livemode
end

#locationObject (readonly)

The location identifier of the reader.



647
648
649
# File 'lib/stripe/resources/terminal/reader.rb', line 647

def location
  @location
end

#metadataObject (readonly)

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



649
650
651
# File 'lib/stripe/resources/terminal/reader.rb', line 649

def 
  @metadata
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



651
652
653
# File 'lib/stripe/resources/terminal/reader.rb', line 651

def object
  @object
end

#serial_numberObject (readonly)

Serial number of the reader.



653
654
655
# File 'lib/stripe/resources/terminal/reader.rb', line 653

def serial_number
  @serial_number
end

#statusObject (readonly)

The networking status of the reader. We do not recommend using this field in flows that may block taking payments.



655
656
657
# File 'lib/stripe/resources/terminal/reader.rb', line 655

def status
  @status
end

Class Method Details

.cancel_action(reader, params = {}, opts = {}) ⇒ Object

Cancels the current reader action.



670
671
672
673
674
675
676
677
# File 'lib/stripe/resources/terminal/reader.rb', line 670

def self.cancel_action(reader, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/cancel_action", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

.collect_inputs(reader, params = {}, opts = {}) ⇒ Object

Initiates an input collection flow on a Reader.



690
691
692
693
694
695
696
697
# File 'lib/stripe/resources/terminal/reader.rb', line 690

def self.collect_inputs(reader, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

.create(params = {}, opts = {}) ⇒ Object

Creates a new Reader object.



700
701
702
703
704
705
706
707
# File 'lib/stripe/resources/terminal/reader.rb', line 700

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/terminal/readers",
    params: params,
    opts: opts
  )
end

.delete(reader, params = {}, opts = {}) ⇒ Object

Deletes a Reader object.



710
711
712
713
714
715
716
717
# File 'lib/stripe/resources/terminal/reader.rb', line 710

def self.delete(reader, params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

.list(params = {}, opts = {}) ⇒ Object

Returns a list of Reader objects.



730
731
732
733
734
735
736
737
# File 'lib/stripe/resources/terminal/reader.rb', line 730

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/terminal/readers",
    params: params,
    opts: opts
  )
end

.object_nameObject



16
17
18
# File 'lib/stripe/resources/terminal/reader.rb', line 16

def self.object_name
  "terminal.reader"
end

.process_payment_intent(reader, params = {}, opts = {}) ⇒ Object

Initiates a payment flow on a Reader.



750
751
752
753
754
755
756
757
# File 'lib/stripe/resources/terminal/reader.rb', line 750

def self.process_payment_intent(reader, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/process_payment_intent", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

.process_setup_intent(reader, params = {}, opts = {}) ⇒ Object

Initiates a setup intent flow on a Reader.



770
771
772
773
774
775
776
777
# File 'lib/stripe/resources/terminal/reader.rb', line 770

def self.process_setup_intent(reader, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/process_setup_intent", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

.refund_payment(reader, params = {}, opts = {}) ⇒ Object

Initiates a refund on a Reader



790
791
792
793
794
795
796
797
# File 'lib/stripe/resources/terminal/reader.rb', line 790

def self.refund_payment(reader, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

.set_reader_display(reader, params = {}, opts = {}) ⇒ Object

Sets reader display to show cart details.



810
811
812
813
814
815
816
817
# File 'lib/stripe/resources/terminal/reader.rb', line 810

def self.set_reader_display(reader, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/set_reader_display", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

.update(reader, params = {}, opts = {}) ⇒ Object

Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.



820
821
822
823
824
825
826
827
# File 'lib/stripe/resources/terminal/reader.rb', line 820

def self.update(reader, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(reader) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#cancel_action(params = {}, opts = {}) ⇒ Object

Cancels the current reader action.



660
661
662
663
664
665
666
667
# File 'lib/stripe/resources/terminal/reader.rb', line 660

def cancel_action(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/cancel_action", { reader: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#collect_inputs(params = {}, opts = {}) ⇒ Object

Initiates an input collection flow on a Reader.



680
681
682
683
684
685
686
687
# File 'lib/stripe/resources/terminal/reader.rb', line 680

def collect_inputs(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#delete(params = {}, opts = {}) ⇒ Object

Deletes a Reader object.



720
721
722
723
724
725
726
727
# File 'lib/stripe/resources/terminal/reader.rb', line 720

def delete(params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#process_payment_intent(params = {}, opts = {}) ⇒ Object

Initiates a payment flow on a Reader.



740
741
742
743
744
745
746
747
# File 'lib/stripe/resources/terminal/reader.rb', line 740

def process_payment_intent(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/process_payment_intent", { reader: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#process_setup_intent(params = {}, opts = {}) ⇒ Object

Initiates a setup intent flow on a Reader.



760
761
762
763
764
765
766
767
# File 'lib/stripe/resources/terminal/reader.rb', line 760

def process_setup_intent(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/process_setup_intent", { reader: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#refund_payment(params = {}, opts = {}) ⇒ Object

Initiates a refund on a Reader



780
781
782
783
784
785
786
787
# File 'lib/stripe/resources/terminal/reader.rb', line 780

def refund_payment(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#set_reader_display(params = {}, opts = {}) ⇒ Object

Sets reader display to show cart details.



800
801
802
803
804
805
806
807
# File 'lib/stripe/resources/terminal/reader.rb', line 800

def set_reader_display(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/terminal/readers/%<reader>s/set_reader_display", { reader: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#test_helpersObject



829
830
831
# File 'lib/stripe/resources/terminal/reader.rb', line 829

def test_helpers
  TestHelpers.new(self)
end