Class: Gateway::Pagseguro
- Inherits:
-
Gateway
- Object
- Gateway
- Gateway::Pagseguro
- Defined in:
- app/models/spree/gateway/pagseguro.rb
Instance Method Summary collapse
- #authorize(amount, source, gateway_options = {}) ⇒ Object
- #auto_capture? ⇒ Boolean
- #method_type ⇒ Object
- #provider_class ⇒ Object
- #supports?(source) ⇒ Boolean
Instance Method Details
#authorize(amount, source, gateway_options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/models/spree/gateway/pagseguro.rb', line 19 def (amount, source, = {}) transaction = PagSeguro::Transaction.find_by_code(source.transaction_id) if transaction ActiveMerchant::Billing::Response.new(true, 'PagSeguro Gateway: Realizado com sucesso', {}, :authorization => source.transaction_id) else ActiveMerchant::Billing::Response.new(false, 'PagSeguro Gateway: Realizado com falha', { :message => 'Pagamento com PagSeguro inconsistente, por favor verificar!' }) end end |
#auto_capture? ⇒ Boolean
15 16 17 |
# File 'app/models/spree/gateway/pagseguro.rb', line 15 def auto_capture? false end |
#method_type ⇒ Object
7 8 9 |
# File 'app/models/spree/gateway/pagseguro.rb', line 7 def method_type 'pagseguro' end |
#provider_class ⇒ Object
3 4 5 |
# File 'app/models/spree/gateway/pagseguro.rb', line 3 def provider_class Spree::PagseguroProvider end |
#supports?(source) ⇒ Boolean
11 12 13 |
# File 'app/models/spree/gateway/pagseguro.rb', line 11 def supports?(source) true end |