Class: GreenByPhone::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/green_by_phone/gateway.rb

Constant Summary collapse

API_URL =
'https://www.greenbyphone.com/eCheck.asmx'

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Gateway

Returns a new instance of Gateway.



5
6
7
8
# File 'lib/green_by_phone/gateway.rb', line 5

def initialize(options = {})
  @login = options[:login]
  @password = options[:password]
end

Instance Method Details

#one_time_draft(options = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/green_by_phone/gateway.rb', line 10

def one_time_draft(options = {})
  post = {}
  add_customer(post, options)
  add_check(post, options)
  commit(options[:real_time] ? 'OneTimeDraftRTV' : 'OneTimeDraftBV', post)
end

#recurring_draft(options = {}) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/green_by_phone/gateway.rb', line 17

def recurring_draft(options = {})
  post = {}
  add_customer(post, options)
  add_check(post, options)
  add_recurring(post, options)
  commit(options[:real_time] ? 'RecurringDraftRTV' : 'RecurringDraftBV', post)
end

#verification_result(options = {}) ⇒ Object



25
26
27
28
# File 'lib/green_by_phone/gateway.rb', line 25

def verification_result(options = {})
  post = { 'Check_ID' => options[:check_id] }
  commit('VerificationResult', post)
end