Class: WirecardCheckoutPage::Gateway
- Inherits:
-
Object
- Object
- WirecardCheckoutPage::Gateway
- Defined in:
- lib/wirecard_checkout_page/gateway.rb
Constant Summary collapse
- DEFAULT_INIT_URL =
'https://checkout.wirecard.com/page/init.php'
Instance Attribute Summary collapse
-
#customerId ⇒ Object
Returns the value of attribute customerId.
-
#init_url ⇒ Object
Returns the value of attribute init_url.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
- #init(params = {}) ⇒ Object
-
#initialize(customerId: nil, secret: nil, init_url: nil) ⇒ Gateway
constructor
A new instance of Gateway.
- #response_valid?(params = {}) ⇒ Boolean
Constructor Details
#initialize(customerId: nil, secret: nil, init_url: nil) ⇒ Gateway
Returns a new instance of Gateway.
7 8 9 10 11 |
# File 'lib/wirecard_checkout_page/gateway.rb', line 7 def initialize(customerId: nil, secret: nil, init_url: nil) @customerId = customerId @secret = secret @init_url = init_url || DEFAULT_INIT_URL end |
Instance Attribute Details
#customerId ⇒ Object
Returns the value of attribute customerId.
5 6 7 |
# File 'lib/wirecard_checkout_page/gateway.rb', line 5 def customerId @customerId end |
#init_url ⇒ Object
Returns the value of attribute init_url.
5 6 7 |
# File 'lib/wirecard_checkout_page/gateway.rb', line 5 def init_url @init_url end |
#secret ⇒ Object
Returns the value of attribute secret.
5 6 7 |
# File 'lib/wirecard_checkout_page/gateway.rb', line 5 def secret @secret end |
Instance Method Details
#init(params = {}) ⇒ Object
13 14 15 16 |
# File 'lib/wirecard_checkout_page/gateway.rb', line 13 def init(params = {}) checksum = WirecardCheckoutPage::RequestChecksum.new(params.merge(authentication_params)) InitResponse.new Typhoeus.post(init_url, body: checksum.request_parameters) end |
#response_valid?(params = {}) ⇒ Boolean
18 19 20 |
# File 'lib/wirecard_checkout_page/gateway.rb', line 18 def response_valid?(params = {}) WirecardCheckoutPage::ResponseChecksum.new(params.merge(authentication_params)).valid? end |