Sha256: 798b2bbc6b5b2c924e36d3f5a532c77f3678255f93c7f3eacb5bb1a5cf17be90
Contents?: true
Size: 1.07 KB
Versions: 86
Compression:
Stored size: 1.07 KB
Contents
module CatarsePagarme class TransactionBase attr_accessor :attributes, :payment, :transaction, :user def initialize(attributes, payment) self.attributes = attributes self.payment = payment self.user = payment.user end def change_payment_state self.payment.update_attributes(attributes_to_payment) self.payment.save! delegator.update_transaction self.payment.payment_notifications.create(contribution_id: self.payment.contribution_id, extra_data: self.transaction.to_json) delegator.change_status_by_transaction(self.transaction.status) end def payment_method PaymentType::CREDIT_CARD end def attributes_to_payment { payment_method: payment_method, gateway_id: self.transaction.id, gateway: 'Pagarme', gateway_data: self.transaction.to_json, installments: default_installments } end def default_installments (self.transaction.installments || 1) end def delegator self.payment.pagarme_delegator end end end
Version data entries
86 entries across 86 versions & 1 rubygems