Class: Payzilla::Gateways::Dummy

Inherits:
Gateway
  • Object
show all
Defined in:
lib/payzilla/gateways/dummy.rb

Instance Attribute Summary

Attributes inherited from Gateway

#config, #logger, #revision_page_size

Instance Method Summary collapse

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) ⇒ Hash

Validate payment on server’s side

Parameters:

Returns:

  • (Hash)

    hash with error code



13
14
15
# File 'lib/payzilla/gateways/dummy.rb', line 13

def check(payment)
  retval
end

#generate_revision(revision) ⇒ Array

Generate revision

Parameters:

Returns:

  • (Array)

    array with ready-to-send revision



29
30
31
32
33
34
35
36
37
# File 'lib/payzilla/gateways/dummy.rb', line 29

def generate_revision(revision)
  buffer = []

  paginate_payments(revision.payments, buffer) do |slice, buffer|
    buffer << generate_revision_page(slice)
  end

  [:xml, buffer.join('')]
end

#pay(payment) ⇒ Hash

Send payment to the carrier’s server

Parameters:

Returns:

  • (Hash)

    hash with error code



21
22
23
# File 'lib/payzilla/gateways/dummy.rb', line 21

def pay(payment)
  retval
end

#send_revision(revision, data) ⇒ Hash

Send revision to the carrier’s server

Parameters:

  • revision (Revision)
  • data (Array)

    is generated from ‘generate_revision` method

Returns:

  • (Hash)

    hash with error code



44
45
46
# File 'lib/payzilla/gateways/dummy.rb', line 44

def send_revision(revision, data)
  retval
end