Class: Freemium::Gateways::Base
- Inherits:
-
Object
- Object
- Freemium::Gateways::Base
- Defined in:
- lib/freemium/gateways/base.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#cancel(billing_key) ⇒ Object
cancels the subscription identified by the given billing key.
-
#charge(billing_key, amount) ⇒ Object
charges money against the given billing key.
-
#store(credit_card, address = nil) ⇒ Object
stores a credit card with the gateway.
-
#transactions(options = {}) ⇒ Object
only needed to support an ARB module.
-
#update(billing_key, credit_card = nil, address = nil) ⇒ Object
updates a credit card in the gateway.
-
#validate(credit_card, address = nil) ⇒ Object
validates a credit card with the gateway.
Instance Method Details
#cancel(billing_key) ⇒ Object
cancels the subscription identified by the given billing key. this might mean removing it from the remote system, or halting the remote recurring billing.
should return a Freemium::Response
15 16 17 |
# File 'lib/freemium/gateways/base.rb', line 15 def cancel(billing_key) raise MethodNotImplemented end |
#charge(billing_key, amount) ⇒ Object
charges money against the given billing key. should return a Freemium::Transaction
60 61 62 |
# File 'lib/freemium/gateways/base.rb', line 60 def charge(billing_key, amount) raise MethodNotImplemented end |
#store(credit_card, address = nil) ⇒ Object
stores a credit card with the gateway. should return a Freemium::Response
21 22 23 |
# File 'lib/freemium/gateways/base.rb', line 21 def store(credit_card, address = nil) raise MethodNotImplemented end |
#transactions(options = {}) ⇒ Object
only needed to support an ARB module. otherwise, the manual billing process will take care of processing transaction information as it happens.
concrete classes need to support these options:
:billing_key : - only retrieve transactions for this specific billing key
:after : - only retrieve transactions after this datetime (non-inclusive)
:before : - only retrieve transactions before this datetime (non-inclusive)
return value should be a collection of Freemium::Transaction objects.
50 51 52 |
# File 'lib/freemium/gateways/base.rb', line 50 def transactions( = {}) raise MethodNotImplemented end |
#update(billing_key, credit_card = nil, address = nil) ⇒ Object
updates a credit card in the gateway. should return a Freemium::Response
27 28 29 |
# File 'lib/freemium/gateways/base.rb', line 27 def update(billing_key, credit_card = nil, address = nil) raise MethodNotImplemented end |
#validate(credit_card, address = nil) ⇒ Object
validates a credit card with the gateway. should return a Freemium::Response
33 34 35 |
# File 'lib/freemium/gateways/base.rb', line 33 def validate(credit_card, address = nil) raise MethodNotImplemented end |