Class: Killbill::PaymentTest::PaymentTestClient

Inherits:
KillBillClient::Model::Resource
  • Object
show all
Defined in:
lib/payment_test/client.rb

Constant Summary collapse

KILLBILL_PAYMENT_TEST_PREFIX =
'/plugins/killbill-payment-test'

Class Method Summary collapse

Class Method Details

.reset(methods, options = {}) ⇒ Object



41
42
43
# File 'lib/payment_test/client.rb', line 41

def reset(methods, options = {})
  configure('ACTION_CLEAR', nil, methods, options)
end

.set_sleep_time(sleep_time_sec, methods, options = {}) ⇒ Object



29
30
31
# File 'lib/payment_test/client.rb', line 29

def set_sleep_time(sleep_time_sec, methods, options = {})
  configure('ACTION_SLEEP', sleep_time_sec, methods, options)
end

.set_status_canceled(methods, options = {}) ⇒ Object



25
26
27
# File 'lib/payment_test/client.rb', line 25

def set_status_canceled(methods, options = {})
  configure('ACTION_RETURN_PLUGIN_STATUS_CANCELED', nil, methods, options)
end

.set_status_error(methods, options = {}) ⇒ Object



21
22
23
# File 'lib/payment_test/client.rb', line 21

def set_status_error(methods, options = {})
  configure('ACTION_RETURN_PLUGIN_STATUS_ERROR', nil, methods, options)
end

.set_status_null(methods, options = {}) ⇒ Object



37
38
39
# File 'lib/payment_test/client.rb', line 37

def set_status_null(methods, options = {})
  configure('RETURN_NIL', nil, methods, options)
end

.set_status_pending(methods, options = {}) ⇒ Object



17
18
19
# File 'lib/payment_test/client.rb', line 17

def set_status_pending(methods, options = {})
  configure('ACTION_RETURN_PLUGIN_STATUS_PENDING', nil, methods, options)
end

.set_status_throw(methods, options = {}) ⇒ Object



33
34
35
# File 'lib/payment_test/client.rb', line 33

def set_status_throw(methods, options = {})
  configure('ACTION_THROW_EXCEPTION', nil, methods, options)
end

.status(options = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/payment_test/client.rb', line 10

def status(options = {})
  response = KillBillClient::API.get "#{KILLBILL_PAYMENT_TEST_PREFIX}/status",
                                     {},
                                     options
  JSON.parse(response.body)
end