Class: Caboose::PaymentProcessors::Base

Inherits:
Object
  • Object
show all
Defined in:
app/models/caboose/payment_processors/base.rb

Direct Known Subclasses

Authorizenet

Instance Method Summary collapse

Instance Method Details

#authorize_error(params) ⇒ Object

Called if authorized? returns false. Returns the error given by the processor.


30
31
32
# File 'app/models/caboose/payment_processors/base.rb', line 30

def authorize_error(params)
  return ""
end

#authorize_relay(params) ⇒ Object

Handles the relay during an authorize transaction.

Should save the transaction information if a successful authorize. Returns the response required to make the processor to redirect to /checkout/payment-receipt.


18
19
20
# File 'app/models/caboose/payment_processors/base.rb', line 18

def authorize_relay(params)
  return ""
end

#authorized?(params) ⇒ Boolean

Called during the receipt of an authorize transaction. Returns true of false indicating whether the authorize transaction was successful.

Returns:

  • (Boolean)

24
25
26
# File 'app/models/caboose/payment_processors/base.rb', line 24

def authorized?(params)
  return false
end

#capture(invoice) ⇒ Object

Captures funds for the given invoice. Returns true or false indicating the success of the transaction.


36
37
38
# File 'app/models/caboose/payment_processors/base.rb', line 36

def capture(invoice)
  return false
end

#get_authorize_form(transaction) ⇒ Object

Gets the hidden form and hidden iframe to which the form will be submitted.

Both are shown on the /checkout/billing page.


11
12
13
# File 'app/models/caboose/payment_processors/base.rb', line 11

def get_authorize_form(transaction)
  return ""
end

#get_authorize_transaction(invoice) ⇒ Object

Gets a transaction object that obfuscates transaction info.

Included in this info is the relay URL, which should be set to /checkout/payment-relay.


5
6
7
# File 'app/models/caboose/payment_processors/base.rb', line 5

def get_authorize_transaction(invoice)
  return {}
end