I am creating a payment app and using braintree for that. I want to use braintree dropIn UI. Installed BraintreeDropIn through pod. Using the following code to present dropIn UI.
func showDropIn(clientTokenOrTokenizationKey: String) {
let request = BTDropInRequest()
let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
{ (controller, result, error) in
if (error != nil) {
print("ERROR")
} else if (result?.cancelled == true) {
print("CANCELLED")
} else if result != nil {
// Use the BTDropInResult properties to update your UI
// result.paymentOptionType
// result.paymentMethod
// result.paymentIcon
// result.paymentDescription
}
controller.dismissViewControllerAnimated(true, completion: nil)
}
self.presentViewController(dropIn!, animated: true, completion: nil)
}
I got tokenization
key from sandbox control panel under Tokenization Keys
and I am passing it to showDropIn function. Still its not showing anything, not going inside this function
(BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
{ (controller, result, error))
Try using this:
Hope this will work...!!