-1

I was trying to implement braintree in my project which is on Java and completly stuck here. Same way is working on a fresh project.

Braintree Implementation in Android

Akash kumar
  • 981
  • 3
  • 14
  • 27

1 Answers1

0

Sometime DropIn create issues, as in my case its dependency was clashing with proxy so it was throwing above issue.

What I did? Ans - I used another approach to implement paypal but issue was that with this approach PayPalListner was not working, so I Implemented BrowserSwitch. Please check below alternate in case if DropIn fails.

PayPal https://developer.paypal.com/braintree/docs/guides/paypal/checkout-with-paypal

  val browserSwitchResult = braintreeClient.deliverBrowserSwitchResult(this)
    if (browserSwitchResult != null && browserSwitchResult.requestCode == BraintreeRequestCodes.PAYPAL) {
        payPalClient.onBrowserSwitchResult(browserSwitchResult) { payPalAccountNonce, error ->
            if (payPalAccountNonce != null) {
                val nonce: String = payPalAccountNonce.string
                setSuccessResult(nonce)
            } else if (error != null) {
                when (error) {
                    is UserCanceledException -> {
                        setErrorResult(error, cancelled = true)
                    }
                    else -> {
                        setErrorResult(error)
                    }
                }
            }
        }
    }
Akash kumar
  • 981
  • 3
  • 14
  • 27