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.
1037 1038 1039 1040 1041 1042 1043 1044 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1037 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
1032 1033 1034 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1032 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.
1057 1058 1059 1060 1061 1062 1063 1064 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1057 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.
1077 1078 1079 1080 1081 1082 1083 1084 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1077 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.
1047 1048 1049 1050 1051 1052 1053 1054 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1047 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.
1067 1068 1069 1070 1071 1072 1073 1074 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1067 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.
1087 1088 1089 1090 1091 1092 1093 1094 |
# File 'lib/stripe/resources/terminal/reader.rb', line 1087 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 |