Class: Stall::Payments::GatewayResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/stall/payments/gateway_response.rb

Direct Known Subclasses

ManualPaymentGateway::Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ GatewayResponse

Returns a new instance of GatewayResponse.



6
7
8
# File 'lib/stall/payments/gateway_response.rb', line 6

def initialize(request)
  @request = request
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



4
5
6
# File 'lib/stall/payments/gateway_response.rb', line 4

def request
  @request
end

Instance Method Details

#cartObject



26
27
28
29
30
# File 'lib/stall/payments/gateway_response.rb', line 26

def cart
  fail NotImplementedError, 'Stall::Payments::GatewayResponse ' \
    'subclasses should override the #cart method to allow the default ' \
    'payment processing.'
end

#processObject



22
23
24
# File 'lib/stall/payments/gateway_response.rb', line 22

def process
  valid? && success?
end

#rendering_optionsObject



10
11
12
# File 'lib/stall/payments/gateway_response.rb', line 10

def rendering_options
  { nothing: true }
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/stall/payments/gateway_response.rb', line 14

def success?
  false
end

#valid?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/stall/payments/gateway_response.rb', line 18

def valid?
  false
end