     
     func paymentAuthorizationViewControllerDidFinish(controller: PKPaymentAuthorizationViewController) {
         dismissViewControllerAnimated(true, completion: nil)
-        controller.dismissViewControllerAnimated(true, completion: nil)
+        //controller.dismissViewControllerAnimated(true, completion: nil)
         print("dismissing")
     }
     

         after all of our asynchronous code is finished executing. This is how the
         PKPaymentAuthorizationViewController knows when and how to update its UI.
         */
        print("in payment auth")
        handlePaymentAuthorizationWithPayment(payment) { (PKPaymentAuthorizationStatus) -> () in
            // close pay modal
            self.showSuccessAlert()
            print("success")
            controller.dismissViewControllerAnimated(true, completion: nil)
        }
    }

    
    func showSuccessAlert() {
        let customIcon:UIImage = UIImage(named: "ic_check_light")! // your custom icon UIImage
        let customColor:UIColor = UIColor.brandGreen() // base color for the alert
        let alertView = JSSAlertView().show(
            self,
            title: "",
            text: "Payment for amount " + chargeInputView.text! + " succeeded!",
            buttonText: "Close",
            noButtons: false,
            color: customColor,
            iconImage: customIcon)
        alertView.setTextTheme(.Light) // can be .Light or .Dark
