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)


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

def can_do_refund?
  true
end

#can_generate_second_slip?Boolean

Returns:

  • (Boolean)


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

def can_generate_second_slip?
  true
end

#direct_refund(contribution) ⇒ Object



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

def direct_refund contribution
  contribution.pagarme_delegator.refund
end

#localeObject



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

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
9
# File 'lib/catarse_pagarme/payment_engine.rb', line 7

def review_path contribution
  url_helpers.review_pagarme_path(contribution)
end

#second_slip_path(payment) ⇒ Object



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

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



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

def transfer contribution
  contribution.pagarme_delegator.transfer_funds
end