|
@@ -22,28 +22,15 @@ class Transaction: NSObject { |
|
|
var isPending: Bool |
|
|
var isModifiable: Bool |
|
|
|
|
|
//this constructor is for the case if it is a posted transaction |
|
|
init(type: TransactionType, amount: Double, merchantID: String, date: Date, isPending: Bool) { |
|
|
self.type = type |
|
|
self.amount = amount |
|
|
self.merchantID = merchantID |
|
|
self.date = date |
|
|
self.confirmationNum = "" |
|
|
self.paymentId = 0 |
|
|
self.isPending = isPending |
|
|
self.isModifiable = false |
|
|
} |
|
|
|
|
|
//this constructor is for the case if it is a pending transaction |
|
|
init(type: TransactionType, amount: Double, merchantID: String, date: Date, |
|
|
confirmationNum: String, paymentId: Int, isPending: Bool, isModifiable: Bool) { |
|
|
confirmationNum: String? = nil, paymentId: Int? = nil, isPending: Bool? = nil, isModifiable: Bool? = nil) { |
|
|
self.type = type |
|
|
self.amount = amount |
|
|
self.merchantID = merchantID |
|
|
self.date = date |
|
|
self.confirmationNum = confirmationNum |
|
|
self.paymentId = paymentId |
|
|
self.isPending = isPending |
|
|
self.isModifiable = isModifiable |
|
|
self.confirmationNum = confirmationNum ?? "" |
|
|
self.paymentId = paymentId ?? 0 |
|
|
self.isPending = isPending ?? false |
|
|
self.isModifiable = isModifiable ?? false |
|
|
} |
|
|
} |