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.
974 975 976 977 978 979 980 981 |
# File 'lib/stripe/resources/terminal/reader.rb', line 974 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
969 970 971 |
# File 'lib/stripe/resources/terminal/reader.rb', line 969 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.
994 995 996 997 998 999 1000 1001 |
# File 'lib/stripe/resources/terminal/reader.rb', line 994 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.
1014 1015 1016 1017 1018 1019 1020 1021 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1014 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.
984 985 986 987 988 989 990 991 |
# File 'lib/stripe/resources/terminal/reader.rb', line 984 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.
1004 1005 1006 1007 1008 1009 1010 1011 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1004 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.
1024 1025 1026 1027 1028 1029 1030 1031 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1024 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 |