     func payMerchant(sender: AnyObject) {
         // Function for toolbar button
         // pay merchant
-        showSuccessAlert()
+        showStatusNotification()
+        Timeout(3.2) {
+            self.showSuccessAlert()
+        }
         chargeInputView.text = ""
         paymentTextField.clear()
     }


import UIKit
import Foundation
import DGRunkeeperSwitch
import Stripe
import JSSAlertView
import MZFormSheetPresentationController
import QRCode

class ChargeViewController: UIViewController, STPPaymentCardTextFieldDelegate {
    
    @IBOutlet weak var switchBal: DGRunkeeperSwitch?
    
    let chargeInputView = UITextField()

    let currencyFormatter = NSNumberFormatter()

    var currentString = ""
    
    let runkeeperSwitch = DGRunkeeperSwitch(leftTitle: "Pay", rightTitle: "Request")

    var paymentTextField = STPPaymentCardTextField()
    
    @IBAction func indexChanged(sender: DGRunkeeperSwitch) {
        if(sender.selectedIndex == 0) {
            NSUserDefaults.standardUserDefaults().setValue("pay", forKey: "chargeType")
        }
        if(sender.selectedIndex == 1) {
            NSUserDefaults.standardUserDefaults().setValue("request", forKey: "chargeType")
        }
    }
    
    func textFieldDidChange(textField: UITextField) {
        let text = textField.text!.stringByReplacingOccurrencesOfString(currencyFormatter.currencySymbol, withString: "").stringByReplacingOccurrencesOfString(currencyFormatter.groupingSeparator, withString: "").stringByReplacingOccurrencesOfString(currencyFormatter.decimalSeparator, withString: "")
        textField.text = currencyFormatter.stringFromNumber((text as NSString).doubleValue / 100.0)

        payWithBitcoinButton.tintColor = UIColor.mediumBlue()
        payWithBitcoinButton.setTitleColor(UIColor.mediumBlue(), forState: .Normal)
        payWithBitcoinButton.titleLabel?.font = UIFont(name: "Avenir-Book", size: 16)
        payWithBitcoinButton.layer.borderColor = UIColor.mediumBlue().colorWithAlphaComponent(0.5).CGColor
        payWithBitcoinButton.layer.borderWidth = 1
        payWithBitcoinButton.layer.cornerRadius = 5
        payWithBitcoinButton.layer.masksToBounds = true
