Class: WirecardCheckoutPage::Gateway

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(customer_id: nil, secret: nil, toolkit_password: nil, shop_id: nil) ⇒ Gateway

Returns a new instance of Gateway.



6
7
8
9
10
11
# File 'lib/wirecard_checkout_page/gateway.rb', line 6

def initialize(customer_id: nil, secret: nil, toolkit_password: nil, shop_id: nil)
  @customer_id      = customer_id
  @secret           = secret
  @toolkit_password = toolkit_password
  @shop_id          = shop_id
end

Instance Attribute Details

#customer_idObject

Returns the value of attribute customer_id.



4
5
6
# File 'lib/wirecard_checkout_page/gateway.rb', line 4

def customer_id
  @customer_id
end

#secretObject

Returns the value of attribute secret.



4
5
6
# File 'lib/wirecard_checkout_page/gateway.rb', line 4

def secret
  @secret
end

#shop_idObject

Returns the value of attribute shop_id.



4
5
6
# File 'lib/wirecard_checkout_page/gateway.rb', line 4

def shop_id
  @shop_id
end

#toolkit_passwordObject

Returns the value of attribute toolkit_password.



4
5
6
# File 'lib/wirecard_checkout_page/gateway.rb', line 4

def toolkit_password
  @toolkit_password
end

Instance Method Details

#check_response(params = {}) ⇒ Object



28
29
30
# File 'lib/wirecard_checkout_page/gateway.rb', line 28

def check_response(params = {})
  CheckedResponse.new params.merge(authentication_params)
end

#init(params = {}) ⇒ Object



13
14
15
16
# File 'lib/wirecard_checkout_page/gateway.rb', line 13

def init(params = {})
  params = params.merge(authentication_params).merge( transactionIdentifier: 'SINGLE' )
  InitRequest.new(params: params).call
end

#recurring_init(params = {}) ⇒ Object



18
19
20
21
# File 'lib/wirecard_checkout_page/gateway.rb', line 18

def recurring_init(params = {})
  params = params.merge(authentication_params).merge( transactionIdentifier: 'INITIAL' )
  InitRequest.new(params: params).call
end

#recurring_process(params = {}) ⇒ Object



23
24
25
26
# File 'lib/wirecard_checkout_page/gateway.rb', line 23

def recurring_process(params = {})
  params = params.merge(toolkit_authentication_params)
  Toolkit::RecurPayment.new(params: params).call
end