Class: Processor::Base

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Callbacks
Defined in:
lib/nimbleshop/processor/base.rb

Overview

Processor

Processor class is responsible for payment processing transactions using gateway. This is an abstract class in the sense that implementations of processors should sublass Processor class.

It defines five methods: authorize, kapture, purchase, void and refund . These methods in turn invoke methods do_authorize, do_kapture, do_purchase, do_void, do_refund.

Instance Method Summary collapse

Instance Method Details

#authorize(options = {}) ⇒ Object



25
26
27
# File 'lib/nimbleshop/processor/base.rb', line 25

def authorize(options = {})
  execute(:authorize, options)
end

#kapture(options = {}) ⇒ Object



21
22
23
# File 'lib/nimbleshop/processor/base.rb', line 21

def kapture(options = {})
  execute(:kapture, options)
end

#purchase(options = {}) ⇒ Object



33
34
35
# File 'lib/nimbleshop/processor/base.rb', line 33

def purchase(options = {})
  execute(:purchase, options)
end

#refund(options = {}) ⇒ Object



37
38
39
# File 'lib/nimbleshop/processor/base.rb', line 37

def refund(options = {})
  execute(:refund, options)
end

#void(options = {}) ⇒ Object



29
30
31
# File 'lib/nimbleshop/processor/base.rb', line 29

def void(options = {})
  execute(:void, options)
end