Skip to content

Instantly share code, notes, and snippets.

@Mreyna3
Last active June 7, 2019 11:47
Show Gist options
  • Save Mreyna3/d6a0faa4689b21132d0242694a1d2ac6 to your computer and use it in GitHub Desktop.
Save Mreyna3/d6a0faa4689b21132d0242694a1d2ac6 to your computer and use it in GitHub Desktop.
import UIKit
public class PaymentProcessor {
// Variable Declaration
fileprivate var batchSum : Double!
private var queue: Queue<Double>!
private let BATCH_CAP: Double!
private var defaults: UserDefaults!
init() {
queue = Queue<Double>()
defaults = UserDefaults()
batchSum = defaults.value(forKey: "batch_sum") as? Double ?? 0.0
BATCH_CAP = 0.50
}
private func shouldProcessBatch() -> Bool{
return false
}
public func enqueue(transaction: Double){
}
private func addToBatch(transaction: Double) {
}
func processBatch(){
}
func resetBatchSum(){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment