Sha256: f0edcaa027d8d824a51761a8b8e706adf2f81e72df0fb582582d7e2e4c390a33

Contents?: true

Size: 585 Bytes

Versions: 1

Compression:

Stored size: 585 Bytes

Contents

module CatarsePagarme
  class SlipTransaction < TransactionBase
    def charge!
      unless payment.update(
        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.merge(payment_method: 'boleto', async: false)
      )
      self.transaction.charge

      change_payment_state
      self.transaction
    end

    def payment_method
      PaymentType::SLIP
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
catarse_pagarme-3.0.1 app/models/catarse_pagarme/slip_transaction.rb