Class: Stripe::Terminal::Reader
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Terminal::Reader
- 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](docs.stripe.com/terminal/payments/connect-reader)
Defined Under Namespace
Classes: Action, TestHelpers
Constant Summary collapse
- OBJECT_NAME =
"terminal.reader"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
The most recent action performed by the reader.
-
#deleted ⇒ Object
readonly
Always true for a deleted object.
-
#device_sw_version ⇒ Object
readonly
The current software version of the reader.
-
#device_type ⇒ Object
readonly
Device type of the reader.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#ip_address ⇒ Object
readonly
The local IP address of the reader.
-
#label ⇒ Object
readonly
Custom label given to the reader for easier identification.
-
#last_seen_at ⇒ Object
readonly
The last time this reader reported to Stripe backend.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#location ⇒ Object
readonly
The location identifier of the reader.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#serial_number ⇒ Object
readonly
Serial number of the reader.
-
#status ⇒ Object
readonly
The networking status of the reader.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.cancel_action(reader, params = {}, opts = {}) ⇒ Object
Cancels the current reader action.
-
.collect_inputs(reader, params = {}, opts = {}) ⇒ Object
Initiates an [input collection flow](docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
-
.collect_payment_method(reader, params = {}, opts = {}) ⇒ Object
Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
-
.confirm_payment_intent(reader, params = {}, opts = {}) ⇒ Object
Finalizes a payment on a Reader.
-
.create(params = {}, opts = {}) ⇒ Object
Creates a new Reader object.
-
.delete(reader, params = {}, opts = {}) ⇒ Object
Deletes a Reader object.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Reader objects.
- .object_name ⇒ Object
-
.process_payment_intent(reader, params = {}, opts = {}) ⇒ Object
Initiates a payment flow on a Reader.
-
.process_setup_intent(reader, params = {}, opts = {}) ⇒ Object
Initiates a SetupIntent flow on a Reader.
-
.refund_payment(reader, params = {}, opts = {}) ⇒ Object
Initiates an in-person refund on a Reader.
-
.set_reader_display(reader, params = {}, opts = {}) ⇒ Object
Sets the reader display to show [cart details](docs.stripe.com/docs/terminal/features/display).
-
.update(reader, params = {}, opts = {}) ⇒ Object
Updates a Reader object by setting the values of the parameters passed.
Instance Method Summary collapse
-
#cancel_action(params = {}, opts = {}) ⇒ Object
Cancels the current reader action.
-
#collect_inputs(params = {}, opts = {}) ⇒ Object
Initiates an [input collection flow](docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
-
#collect_payment_method(params = {}, opts = {}) ⇒ Object
Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
-
#confirm_payment_intent(params = {}, opts = {}) ⇒ Object
Finalizes a payment on a Reader.
-
#delete(params = {}, opts = {}) ⇒ Object
Deletes a Reader object.
-
#process_payment_intent(params = {}, opts = {}) ⇒ Object
Initiates a payment flow on a Reader.
-
#process_setup_intent(params = {}, opts = {}) ⇒ Object
Initiates a SetupIntent flow on a Reader.
-
#refund_payment(params = {}, opts = {}) ⇒ Object
Initiates an in-person refund on a Reader.
-
#set_reader_display(params = {}, opts = {}) ⇒ Object
Sets the reader display to show [cart details](docs.stripe.com/docs/terminal/features/display).
- #test_helpers ⇒ Object
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods included from APIOperations::Delete
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
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, 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
#action ⇒ Object (readonly)
The most recent action performed by the reader.
491 492 493 |
# File 'lib/stripe/resources/terminal/reader.rb', line 491 def action @action end |
#deleted ⇒ Object (readonly)
Always true for a deleted object
517 518 519 |
# File 'lib/stripe/resources/terminal/reader.rb', line 517 def deleted @deleted end |
#device_sw_version ⇒ Object (readonly)
The current software version of the reader.
493 494 495 |
# File 'lib/stripe/resources/terminal/reader.rb', line 493 def device_sw_version @device_sw_version end |
#device_type ⇒ Object (readonly)
Device type of the reader.
495 496 497 |
# File 'lib/stripe/resources/terminal/reader.rb', line 495 def device_type @device_type end |
#id ⇒ Object (readonly)
Unique identifier for the object.
497 498 499 |
# File 'lib/stripe/resources/terminal/reader.rb', line 497 def id @id end |
#ip_address ⇒ Object (readonly)
The local IP address of the reader.
499 500 501 |
# File 'lib/stripe/resources/terminal/reader.rb', line 499 def ip_address @ip_address end |
#label ⇒ Object (readonly)
Custom label given to the reader for easier identification.
501 502 503 |
# File 'lib/stripe/resources/terminal/reader.rb', line 501 def label @label end |
#last_seen_at ⇒ Object (readonly)
The last time this reader reported to Stripe backend. Timestamp is measured in milliseconds since the Unix epoch. Unlike most other Stripe timestamp fields which use seconds, this field uses milliseconds.
503 504 505 |
# File 'lib/stripe/resources/terminal/reader.rb', line 503 def last_seen_at @last_seen_at end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
505 506 507 |
# File 'lib/stripe/resources/terminal/reader.rb', line 505 def livemode @livemode end |
#location ⇒ Object (readonly)
The location identifier of the reader.
507 508 509 |
# File 'lib/stripe/resources/terminal/reader.rb', line 507 def location @location end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
509 510 511 |
# File 'lib/stripe/resources/terminal/reader.rb', line 509 def end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
511 512 513 |
# File 'lib/stripe/resources/terminal/reader.rb', line 511 def object @object end |
#serial_number ⇒ Object (readonly)
Serial number of the reader.
513 514 515 |
# File 'lib/stripe/resources/terminal/reader.rb', line 513 def serial_number @serial_number end |
#status ⇒ Object (readonly)
The networking status of the reader. We do not recommend using this field in flows that may block taking payments.
515 516 517 |
# File 'lib/stripe/resources/terminal/reader.rb', line 515 def status @status end |
Class Method Details
.cancel_action(reader, params = {}, opts = {}) ⇒ Object
Cancels the current reader action. See [Programmatic Cancellation](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
530 531 532 533 534 535 536 537 |
# File 'lib/stripe/resources/terminal/reader.rb', line 530 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](docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
550 551 552 553 554 555 556 557 |
# File 'lib/stripe/resources/terminal/reader.rb', line 550 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 |
.collect_payment_method(reader, params = {}, opts = {}) ⇒ Object
Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
570 571 572 573 574 575 576 577 |
# File 'lib/stripe/resources/terminal/reader.rb', line 570 def self.collect_payment_method(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }), params: params, opts: opts ) end |
.confirm_payment_intent(reader, params = {}, opts = {}) ⇒ Object
Finalizes a payment on a Reader. See [Confirming a Payment](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
590 591 592 593 594 595 596 597 |
# File 'lib/stripe/resources/terminal/reader.rb', line 590 def self.confirm_payment_intent(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
Creates a new Reader object.
600 601 602 603 604 605 606 607 |
# File 'lib/stripe/resources/terminal/reader.rb', line 600 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.
610 611 612 613 614 615 616 617 |
# File 'lib/stripe/resources/terminal/reader.rb', line 610 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 |
.field_remappings ⇒ Object
804 805 806 |
# File 'lib/stripe/resources/terminal/reader.rb', line 804 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
800 801 802 |
# File 'lib/stripe/resources/terminal/reader.rb', line 800 def self.inner_class_types @inner_class_types = { action: Action } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Reader objects.
630 631 632 633 634 635 636 637 |
# File 'lib/stripe/resources/terminal/reader.rb', line 630 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/terminal/readers", params: params, opts: opts ) end |
.object_name ⇒ Object
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. See [process the payment](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
650 651 652 653 654 655 656 657 |
# File 'lib/stripe/resources/terminal/reader.rb', line 650 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 SetupIntent flow on a Reader. See [Save directly without charging](docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
670 671 672 673 674 675 676 677 |
# File 'lib/stripe/resources/terminal/reader.rb', line 670 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 an in-person refund on a Reader. See [Refund an Interac Payment](docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
690 691 692 693 694 695 696 697 |
# File 'lib/stripe/resources/terminal/reader.rb', line 690 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 the reader display to show [cart details](docs.stripe.com/docs/terminal/features/display).
710 711 712 713 714 715 716 717 |
# File 'lib/stripe/resources/terminal/reader.rb', line 710 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.
720 721 722 723 724 725 726 727 |
# File 'lib/stripe/resources/terminal/reader.rb', line 720 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. See [Programmatic Cancellation](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
520 521 522 523 524 525 526 527 |
# File 'lib/stripe/resources/terminal/reader.rb', line 520 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](docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
540 541 542 543 544 545 546 547 |
# File 'lib/stripe/resources/terminal/reader.rb', line 540 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 |
#collect_payment_method(params = {}, opts = {}) ⇒ Object
Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details.
560 561 562 563 564 565 566 567 |
# File 'lib/stripe/resources/terminal/reader.rb', line 560 def collect_payment_method(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#confirm_payment_intent(params = {}, opts = {}) ⇒ Object
Finalizes a payment on a Reader. See [Confirming a Payment](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details.
580 581 582 583 584 585 586 587 |
# File 'lib/stripe/resources/terminal/reader.rb', line 580 def confirm_payment_intent(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#delete(params = {}, opts = {}) ⇒ Object
Deletes a Reader object.
620 621 622 623 624 625 626 627 |
# File 'lib/stripe/resources/terminal/reader.rb', line 620 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. See [process the payment](docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details.
640 641 642 643 644 645 646 647 |
# File 'lib/stripe/resources/terminal/reader.rb', line 640 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 SetupIntent flow on a Reader. See [Save directly without charging](docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details.
660 661 662 663 664 665 666 667 |
# File 'lib/stripe/resources/terminal/reader.rb', line 660 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 an in-person refund on a Reader. See [Refund an Interac Payment](docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details.
680 681 682 683 684 685 686 687 |
# File 'lib/stripe/resources/terminal/reader.rb', line 680 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 the reader display to show [cart details](docs.stripe.com/docs/terminal/features/display).
700 701 702 703 704 705 706 707 |
# File 'lib/stripe/resources/terminal/reader.rb', line 700 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_helpers ⇒ Object
729 730 731 |
# File 'lib/stripe/resources/terminal/reader.rb', line 729 def test_helpers TestHelpers.new(self) end |