Class: CatarsePagarme::PaymentEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/catarse_pagarme/payment_engine.rb

Instance Method Summary collapse

Instance Method Details

#can_do_refund?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/catarse_pagarme/payment_engine.rb', line 14

def can_do_refund?
  true
end

#can_generate_second_slip?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/catarse_pagarme/payment_engine.rb', line 26

def can_generate_second_slip?
  true
end

#direct_refund(contribution) ⇒ Object



18
19
20
# File 'lib/catarse_pagarme/payment_engine.rb', line 18

def direct_refund contribution
  contribution.pagarme_delegator.refund
end

#localeObject



10
11
12
# File 'lib/catarse_pagarme/payment_engine.rb', line 10

def locale
  'pt'
end

#nameObject



3
4
5
# File 'lib/catarse_pagarme/payment_engine.rb', line 3

def name
  'Pagarme'
end

#review_path(contribution) ⇒ Object



7
8
# File 'lib/catarse_pagarme/payment_engine.rb', line 7

def review_path contribution
end

#second_slip_path(payment) ⇒ Object



30
31
32
33
# File 'lib/catarse_pagarme/payment_engine.rb', line 30

def second_slip_path(payment)
  # The second slip generates a new payment base on the contribution ID
  url_helpers.second_slip_pagarme_path(id: payment.contribution.id)
end

#transfer(contribution) ⇒ Object



22
23
24
# File 'lib/catarse_pagarme/payment_engine.rb', line 22

def transfer contribution
  contribution.pagarme_delegator.transfer_funds
end