Class: GatewayNotification
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- GatewayNotification
show all
- Defined in:
- app/models/gateway_notification.rb
Defined Under Namespace
Classes: EmptyChargeIdError
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
12
13
14
|
# File 'app/models/gateway_notification.rb', line 12
def logger
@logger
end
|
#raw_post ⇒ Object
Returns the value of attribute raw_post.
12
13
14
|
# File 'app/models/gateway_notification.rb', line 12
def raw_post
@raw_post
end
|
Instance Method Details
#acknowledge ⇒ Object
14
15
16
|
# File 'app/models/gateway_notification.rb', line 14
def acknowledge
adapter.acknowledge
end
|
#approve ⇒ Object
30
31
32
33
|
# File 'app/models/gateway_notification.rb', line 30
def approve
logger.info "real amount = #{real_amount}"
charge.approve(real_amount) unless charge.ok?
end
|
#complete? ⇒ Boolean
18
19
20
|
# File 'app/models/gateway_notification.rb', line 18
def complete?
adapter.complete?
end
|
#need_response? ⇒ Boolean
22
23
24
|
# File 'app/models/gateway_notification.rb', line 22
def need_response?
adapter.respond_to?(:success_response)
end
|
#real_amount ⇒ Object
35
36
37
|
# File 'app/models/gateway_notification.rb', line 35
def real_amount
params[service.mappings[:amount]]
end
|
#success_response ⇒ Object
26
27
28
|
# File 'app/models/gateway_notification.rb', line 26
def success_response
adapter.respond_to?(:success_response) ? adapter.success_response : "OK"
end
|