Class: Payzilla::Gateways::Gorod
- Includes:
- Transports::HTTP
- Defined in:
- lib/payzilla/gateways/gorod.rb
Instance Attribute Summary
Attributes inherited from Gateway
#config, #logger, #revision_page_size
Instance Method Summary collapse
Methods included from Transports::HTTP
Methods inherited from Gateway
available_attachments, available_settings, available_switches, can_list_providers, #can_list_providers?, can_list_providers?, #initialize, register_attachments, register_settings, register_switches, require_payment_fields, required_payment_fields, requires_revision, requires_revision?, #requires_revision?, #revise
Constructor Details
This class inherits a constructor from Payzilla::Gateways::Gateway
Instance Method Details
#check(payment) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/payzilla/gateways/gorod.rb', line 13 def check(payment) return retval(-1001) if settings_miss? begin xml = Builder::XmlMarkup.new and xml.instruct! xml.Document do xml.BILLING do xml.ReqAbonentList do xml.AbonentsOn do xml.AbonentId payment.account end end end end result = request xml.target! return retval(result['fault']['faultactor']) rescue Errno::ECONNRESET return retval(-1000) end end |
#pay(payment) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/payzilla/gateways/gorod.rb', line 36 def pay(payment) return retval(-1001) if settings_miss? begin xml = Builder::XmlMarkup.new and xml.instruct! xml.Document do xml.GIN2 do xml.FORM do xml.Service payment.service xml.Abonent do xml.id payment.account end end end end result = request xml.target! return retval(result['fault']['faultactor']) rescue Errno::ECONNRESET return retval(-1000) end end |