Skip to content

Instantly share code, notes, and snippets.

@amixpal
Last active November 7, 2019 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amixpal/0c1832427d2df4f73e2efbd14aaa3a48 to your computer and use it in GitHub Desktop.
Save amixpal/0c1832427d2df4f73e2efbd14aaa3a48 to your computer and use it in GitHub Desktop.
func createCard(token: STPToken) {
if let customerId = UserDefaults.standard.value(forKey: ApiParametersConstant.STRIPE_CUSTOMER_ID) {
let attributes = RappleActivityIndicatorView.attribute(style: RappleStyle.apple)
RappleActivityIndicatorView.startAnimatingWithLabel("Fetching card details...", attributes: attributes)
CardManager.sharedInstance.createCard(customerId: customerId as! String, token: token.tokenId) { (success, response) in
DispatchQueue.main.async() {
RappleActivityIndicatorView.stopAnimation()
}
if (success) {
self.skipButton.setTitle("Done", for: .normal)
self.updateCardVerify()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment