Class: Stripe::Terminal::Reader::TestHelpers
- Inherits:
-
APIResourceTestHelpers
- Object
- APIResourceTestHelpers
- Stripe::Terminal::Reader::TestHelpers
- Defined in:
- lib/stripe/resources/terminal/reader.rb
Constant Summary collapse
- RESOURCE_CLASS =
Reader
Class Method Summary collapse
-
.present_payment_method(reader, params = {}, opts = {}) ⇒ Object
Presents a payment method on a simulated reader.
- .resource_class ⇒ Object
-
.succeed_input_collection(reader, params = {}, opts = {}) ⇒ Object
Use this endpoint to trigger a successful input collection on a simulated reader.
-
.timeout_input_collection(reader, params = {}, opts = {}) ⇒ Object
Use this endpoint to complete an input collection with a timeout error on a simulated reader.
Instance Method Summary collapse
-
#present_payment_method(params = {}, opts = {}) ⇒ Object
Presents a payment method on a simulated reader.
-
#succeed_input_collection(params = {}, opts = {}) ⇒ Object
Use this endpoint to trigger a successful input collection on a simulated reader.
-
#timeout_input_collection(params = {}, opts = {}) ⇒ Object
Use this endpoint to complete an input collection with a timeout error on a simulated reader.
Methods inherited from APIResourceTestHelpers
custom_method, #initialize, resource_url, #resource_url
Methods included from APIOperations::Request
Constructor Details
This class inherits a constructor from Stripe::APIResourceTestHelpers
Class Method Details
.present_payment_method(reader, params = {}, opts = {}) ⇒ Object
Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
740 741 742 743 744 745 746 747 |
# File 'lib/stripe/resources/terminal/reader.rb', line 740 def self.present_payment_method(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%<reader>s/present_payment_method", { reader: CGI.escape(reader) }), params: params, opts: opts ) end |
.resource_class ⇒ Object
735 736 737 |
# File 'lib/stripe/resources/terminal/reader.rb', line 735 def self.resource_class "Reader" end |
.succeed_input_collection(reader, params = {}, opts = {}) ⇒ Object
Use this endpoint to trigger a successful input collection on a simulated reader.
760 761 762 763 764 765 766 767 |
# File 'lib/stripe/resources/terminal/reader.rb', line 760 def self.succeed_input_collection(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%<reader>s/succeed_input_collection", { reader: CGI.escape(reader) }), params: params, opts: opts ) end |
.timeout_input_collection(reader, params = {}, opts = {}) ⇒ Object
Use this endpoint to complete an input collection with a timeout error on a simulated reader.
780 781 782 783 784 785 786 787 |
# File 'lib/stripe/resources/terminal/reader.rb', line 780 def self.timeout_input_collection(reader, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%<reader>s/timeout_input_collection", { reader: CGI.escape(reader) }), params: params, opts: opts ) end |
Instance Method Details
#present_payment_method(params = {}, opts = {}) ⇒ Object
Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
750 751 752 753 754 755 756 757 |
# File 'lib/stripe/resources/terminal/reader.rb', line 750 def present_payment_method(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%<reader>s/present_payment_method", { reader: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end |
#succeed_input_collection(params = {}, opts = {}) ⇒ Object
Use this endpoint to trigger a successful input collection on a simulated reader.
770 771 772 773 774 775 776 777 |
# File 'lib/stripe/resources/terminal/reader.rb', line 770 def succeed_input_collection(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%<reader>s/succeed_input_collection", { reader: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end |
#timeout_input_collection(params = {}, opts = {}) ⇒ Object
Use this endpoint to complete an input collection with a timeout error on a simulated reader.
790 791 792 793 794 795 796 797 |
# File 'lib/stripe/resources/terminal/reader.rb', line 790 def timeout_input_collection(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/terminal/readers/%<reader>s/timeout_input_collection", { reader: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end |