async Task HandlePaymentAuthorization(PKPayment payment, Action <PKPaymentAuthorizationStatus> completion, bool isTest = false, bool shouldTestFail = false) { try { Token token = null; if (isTest) { token = await StripeClient.CreateTestToken(payment, shouldTestFail); } else { token = await StripeClient.CreateToken(payment); } var msg = string.Format("Good news! Stripe turned your credit card into a token: \n{0} \n\nYou can follow the instructions in the README to set up Parse as an example backend, or use this token to manually create charges at dashboard.stripe.com .", token.Id); var avMsg = new UIAlertView("Todo: Submit this token to your backend", msg, null, "OK"); avMsg.Show(); completion(PKPaymentAuthorizationStatus.Success); } catch (Exception ex) { var avMsg = new UIAlertView("Payment Failed", ex.Message, null, "OK"); avMsg.Show(); } }