Class: Payzilla::Gateways::Cyberplat

Inherits:
Gateway
  • Object
show all
Includes:
Transports::HTTP
Defined in:
lib/payzilla/gateways/cyberplat.rb

Instance Attribute Summary

Attributes inherited from Gateway

#config, #logger, #revision_page_size

Instance Method Summary collapse

Methods included from Transports::HTTP

#get, #post, #resource, #ssl

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



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/payzilla/gateways/cyberplat.rb', line 14

def check(payment)
  result = request 'pay_check', payment.gateway_provider_id,
    :SD         => @config.setting_dealer,
    :AP         => @config.setting_point,
    :OP         => @config.setting_operator,
    :SESSION    => "c#{payment.id}",
    :NUMBER     => payment.,
    :ACCOUNT    => payment.fields['account'],
    :AMOUNT     => 100,
    :AMOUNT_ALL => 100

  return retval(result)
end

#pay(payment) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/payzilla/gateways/cyberplat.rb', line 28

def pay(payment)
  result = request 'pay', payment.gateway_provider_id, 
    :SD         => @config.setting_dealer,
    :AP         => @config.setting_point,
    :OP         => @config.setting_operator,
    :SESSION    => "p#{payment.id}",
    :NUMBER     => payment.,
    :ACCOUNT    => payment.fields['account'],
    :AMOUNT     => payment.enrolled_amount,
    :AMOUNT_ALL => payment.paid_amount

  return retval(result)
end