diff --git a/android/src/main/java/com/pw/droplet/braintree/Braintree.java b/android/src/main/java/com/pw/droplet/braintree/Braintree.java index ccdb78bb..fe2e4e32 100644 --- a/android/src/main/java/com/pw/droplet/braintree/Braintree.java +++ b/android/src/main/java/com/pw/droplet/braintree/Braintree.java @@ -21,7 +21,7 @@ import com.braintreepayments.api.PayPal; import com.braintreepayments.api.interfaces.PaymentMethodNonceCreatedListener; import com.braintreepayments.api.interfaces.BraintreeErrorListener; - +import com.braintreepayments.api.interfaces.BraintreeCancelListener; import com.facebook.react.bridge.Callback; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; @@ -68,6 +68,12 @@ public void onPaymentMethodNonceCreated(PaymentMethodNonce paymentMethodNonce) { nonceCallback(paymentMethodNonce.getNonce()); } }); + this.mBraintreeFragment.addListener(new BraintreeCancelListener() { + @Override + public void onCancel(int requestCode){ + nonceErrorCallback("REQUEST_CANCELED"); + } + }); this.mBraintreeFragment.addListener(new BraintreeErrorListener() { @Override public void onError(Exception error) {