Class: Stripe::Terminal::Reader::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/terminal/reader.rb

Constant Summary collapse

RESOURCE_CLASS =
Reader

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResourceTestHelpers

custom_method, #initialize, resource_url, #resource_url

Methods included from APIOperations::Request

included

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.



125
126
127
128
129
130
131
132
# File 'lib/stripe/resources/terminal/reader.rb', line 125

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

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.



135
136
137
138
139
140
141
142
# File 'lib/stripe/resources/terminal/reader.rb', line 135

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