Class: PaynetEasy::PaynetEasyApi::PaymentData::QueryConfig

Inherits:
Data
  • Object
show all
Defined in:
lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb

Constant Summary collapse

GATEWAY_MODE_SANDBOX =

Execute query to PaynetEasy sandbox gateway

'sandbox'
GATEWAY_MODE_PRODUCTION =

Execute query to PaynetEasy production gateway

'production'
@@allowed_gateway_modes =

Allowed gateway modes

[
  GATEWAY_MODE_SANDBOX,
  GATEWAY_MODE_PRODUCTION
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Data

#initialize

Constructor Details

This class inherits a constructor from PaynetEasy::PaynetEasyApi::PaymentData::Data

Instance Attribute Details

#callback_urlObject

URL the transaction result will be sent to



46
47
48
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 46

def callback_url
  @callback_url
end

#end_pointObject

Merchant end point



21
22
23
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 21

def end_point
  @end_point
end

#gateway_modeObject

PaynetEasy gateway mode: sandbox or production



51
52
53
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 51

def gateway_mode
  @gateway_mode
end

#gateway_url_productionObject

PaynetEasy production gateway URL



61
62
63
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 61

def gateway_url_production
  @gateway_url_production
end

#gateway_url_sandboxObject

PaynetEasy sandbox gateway URL



56
57
58
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 56

def gateway_url_sandbox
  @gateway_url_sandbox
end

#loginObject

Merchant login



26
27
28
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 26

def 
  @login
end

#redirect_urlObject

URL the customer will be redirected to upon completion of the transaction



41
42
43
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 41

def redirect_url
  @redirect_url
end

#signing_keyObject

Merchant key for payment signing



31
32
33
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 31

def signing_key
  @signing_key
end

#site_urlObject

URL the original payment is made from



36
37
38
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 36

def site_url
  @site_url
end

Instance Method Details

#gateway_urlString

Get gateway url for current gateway mode

Returns:

  • (String)

    Sandbox gateway url if gateway mode is sandbox, production gateway url if gateway mode is production



76
77
78
79
80
81
82
# File 'lib/paynet_easy/paynet_easy_api/payment_data/query_config.rb', line 76

def gateway_url
  case gateway_mode
  when GATEWAY_MODE_SANDBOX     then gateway_url_sandbox
  when GATEWAY_MODE_PRODUCTION  then gateway_url_production
  else raise RuntimeError, 'You must set gateway_mode property first'
  end
end