Class: ActiveMerchant::Billing::AprovaFacilGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::AprovaFacilGateway
- Defined in:
- lib/active_merchant/billing/gateways/aprova_facil.rb
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ AprovaFacilGateway
constructor
A new instance of AprovaFacilGateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #void(authorization, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ AprovaFacilGateway
Returns a new instance of AprovaFacilGateway.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/active_merchant/billing/gateways/aprova_facil.rb', line 23 def initialize( = {}) requires!(, :login) @options = super AprovaFacil::Config.usuario = @options[:login] if @options[:test] AprovaFacil::Config.teste = true end end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/active_merchant/billing/gateways/aprova_facil.rb', line 35 def (money, creditcard, = {}) post = {} add_invoice(post, ) add_creditcard(post, creditcard) add_customer_data(post, ) commit('authonly', money, post) end |
#capture(money, authorization, options = {}) ⇒ Object
53 54 55 56 |
# File 'lib/active_merchant/billing/gateways/aprova_facil.rb', line 53 def capture(money, , = {}) post = {:transaction => } commit('capture', money, post) end |
#purchase(money, creditcard, options = {}) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/active_merchant/billing/gateways/aprova_facil.rb', line 44 def purchase(money, creditcard, = {}) post = {} add_invoice(post, ) add_creditcard(post, creditcard) add_customer_data(post, ) commit('sale', money, post) end |
#void(authorization, options = {}) ⇒ Object
58 59 60 61 |
# File 'lib/active_merchant/billing/gateways/aprova_facil.rb', line 58 def void(, = {}) post = {:transaction => } commit('void', nil, post) end |