Sha256: 0ddce801ef8d6221aeced3461f0613283aabf06e9dff24f3be1b9390acdc5a28

Contents?: true

Size: 529 Bytes

Versions: 18

Compression:

Stored size: 529 Bytes

Contents

module CatarsePagarme
  class SlipTransaction < TransactionBase
    def charge!
      unless payment.update_attributes({
        gateway: 'Pagarme',
        payment_method: payment_method})

        raise ::PagarMe::PagarMeError.new(
          payment.errors.messages.values.flatten.to_sentence)
      end

      self.transaction = PagarMe::Transaction.new(self.attributes)
      self.transaction.charge

      change_payment_state
      self.transaction
    end

    def payment_method
      PaymentType::SLIP
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
catarse_pagarme-2.14.8 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.7 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.6 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.5 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.4 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.3 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.2 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.1 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.14.0 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.13.0 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.12.0 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.11.0 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.10.15 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.10.14 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.10.13 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.10.12 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.10.11 app/models/catarse_pagarme/slip_transaction.rb
catarse_pagarme-2.10.10 app/models/catarse_pagarme/slip_transaction.rb