Class: WebpayInterswitch::Gateway

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

Constant Summary collapse

TEST_URL =
'https://sandbox.interswitchng.com/webpay/pay'
LIVE_URL =
'https://webpay.interswitchng.com/paydirect/pay'
ACCEPTED_CURRENCIES =

ACCEPTED_CURRENCIES:

  • Naira (In Kobo)

['566']

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



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

def self.setup
  yield self
  set_defaults!
end

.urlObject



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

def self.url
  WebpayInterswitch::Gateway.test ? TEST_URL : LIVE_URL
end

Instance Method Details

#validate!Object



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

def validate!
  requires!(:product_id, :pay_item_id, :currency, :site_redirect_url, :mac_key)
  validate_currency!
end