Skip to content

Instantly share code, notes, and snippets.

@KamaKAzii
Created February 19, 2018 10:55
Show Gist options
  • Save KamaKAzii/d5b653d9618805ee994f4cddd0e5e563 to your computer and use it in GitHub Desktop.
Save KamaKAzii/d5b653d9618805ee994f4cddd0e5e563 to your computer and use it in GitHub Desktop.
class TransactionManager
attr_accessor :transation_type,
:payment_type,
:description,
:amount,
:transaction_date,
:payment_processor,
:payment_gateway
def initialize(transaction_type: Transaction::TRANSACTION_TYPES.DirectDebit,
payment_type: Transaction::PAYMENT_TYPES.DirectDebit,
description: nil,
amount: 0,
transaction_date: Date.today,
payment_processor: PaymentProcessor.new,
payment_gateway: PaymentGateway.new)
self.transaction_type = transaction_type
self.payment_type = payment_type
self.description = description
self.amount = amount
self.payment_processor = payment_processor
self.payment_gateway = payment_gateway
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment