I'm trying to integrate Braintree in an Ionic 3 iOS/Android application, but once i call presentDropInPaymentUI(paymentOptions) the promise is never resolved or rejected so I'm unable to get the nonce to send to my server. Any suggestion?
try {
this.httpClient.get(`${Defaults.servicesBaseUrl}/braintree/client_token`).subscribe(async (response: any) => {
if (!response || response.hasError)
throw new Error((response || {}).data);
await this.braintree.initialize(response.data);
this.braintree.presentDropInPaymentUI(paymentOptions)
.then((result: PaymentUIResult) => {
// Resolve #1. Get nonce and send back to my server, but the promise is never resolving or rejecting
if (result.userCancelled) {
console.log("User cancelled payment dialog.");
} else {
console.log("User successfully completed payment!");
console.log("Payment Nonce: " + result.nonce);
console.log("Payment Result.", result);
}
})
.catch(ex => {
// Exception #1
});
});
} catch (ex) {
// Exception #2
}
Once filled the credit card form and clicking "Add card" the modal is simply closed and the promise is not resolved and not rejected. Am i missing something?
I'm trying to integrate Braintree in an Ionic 3 iOS/Android application, but once i call
presentDropInPaymentUI(paymentOptions)
the promise is never resolved or rejected so I'm unable to get thenonce
to send to my server. Any suggestion?Once filled the credit card form and clicking "Add card" the modal is simply closed and the promise is not resolved and not rejected. Am i missing something?