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.
996 997 998 999 1000 1001 1002 1003 |
# File 'lib/stripe/resources/terminal/reader.rb', line 996 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
991 992 993 |
# File 'lib/stripe/resources/terminal/reader.rb', line 991 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.
1016 1017 1018 1019 1020 1021 1022 1023 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1016 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.
1036 1037 1038 1039 1040 1041 1042 1043 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1036 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.
1006 1007 1008 1009 1010 1011 1012 1013 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1006 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.
1026 1027 1028 1029 1030 1031 1032 1033 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1026 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.
1046 1047 1048 1049 1050 1051 1052 1053 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1046 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 |