Class: Rubyplat::Gateways::Gateway

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

Overview

Represents payment gateway for performing operations

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, number, pay_check_uri, pay_uri, pay_status_uri) ⇒ Gateway

Returns a new instance of Gateway.



20
21
22
23
24
25
26
# File 'lib/rubyplat/gateways/gateway.rb', line 20

def initialize(name, number, pay_check_uri, pay_uri, pay_status_uri)
  @name = name
  @number = number
  @pay_check_uri = URI(pay_check_uri)
  @pay_uri = URI(pay_uri)
  @pay_status_uri = URI(pay_status_uri)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



18
19
20
# File 'lib/rubyplat/gateways/gateway.rb', line 18

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



18
19
20
# File 'lib/rubyplat/gateways/gateway.rb', line 18

def number
  @number
end

#pay_check_uriObject (readonly)

Returns the value of attribute pay_check_uri.



18
19
20
# File 'lib/rubyplat/gateways/gateway.rb', line 18

def pay_check_uri
  @pay_check_uri
end

#pay_status_uriObject (readonly)

Returns the value of attribute pay_status_uri.



18
19
20
# File 'lib/rubyplat/gateways/gateway.rb', line 18

def pay_status_uri
  @pay_status_uri
end

#pay_uriObject (readonly)

Returns the value of attribute pay_uri.



18
19
20
# File 'lib/rubyplat/gateways/gateway.rb', line 18

def pay_uri
  @pay_uri
end

Class Method Details

.availableObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rubyplat/gateways/gateway.rb', line 6

def self.available
  @available ||= [
    ::Rubyplat::Gateways::Gateway.new(
      'Тройка (Московский Метрополитен и Мосгортранс)',
      3589,
      'https://service.cyberplat.ru/cgi-bin/tc/tc_pay_check.cgi/3589',
      'https://service.cyberplat.ru/cgi-bin/tc/tc_pay.cgi/3589',
      'https://service.cyberplat.ru/cgi-bin/tc/tc_pay_status.cgi'
    )
  ]
end