Git Product home page Git Product logo

Comments (8)

quinnjn avatar quinnjn commented on June 27, 2024

It sounds like fetching the token from the server is the issue since Drop-in launches fine with a hard coded client token.

You can verify your client token is correct by following these steps:

When Drop-in is passed a malformed authorization it finishes with an error.

This example usage in our README shows where that error is referenced back to your activity.

That exception will clue into why Drop-in is not starting.

from braintree-android-drop-in.

quinnjn avatar quinnjn commented on June 27, 2024

@jin9393 I'm going to close this. Feel free to reopen it if you are still having issues.

from braintree-android-drop-in.

jin9393 avatar jin9393 commented on June 27, 2024

Sorry I forget I posted here as i have been on email with braintree support team. Yes i am still facing the same error since that day.

onActivityResult, i cant cast data to exception. The drop-in ui is still not loading. I have sent over the whole code to the support team and still waiting for their feedback.

from braintree-android-drop-in.

quinnjn avatar quinnjn commented on June 27, 2024

You shouldn't cast Intent data to an Exception. See our Usage example.

If some serializable extra exists under DropInActivity.EXTRA_ERROR then the exception will be there.

from braintree-android-drop-in.

jin9393 avatar jin9393 commented on June 27, 2024

My bad, I did exactly what is stated on the example and i got this when i try to log the exception.
"Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Exception".

from braintree-android-drop-in.

jin9393 avatar jin9393 commented on June 27, 2024

Another thing to take note is the onActivityResult resultCode. The resultCode is returning 1 and its not loading into resultCode == Activity.RESULT_OK, even though the drop-in is not loading

from braintree-android-drop-in.

quinnjn avatar quinnjn commented on June 27, 2024

when i try to log the exception.
"Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Exception"

Hmm, we do pass a string as a value for DropInActivity.EXTRA_ERROR when BraintreeFragment has an invalid argument which sounds like it would be the Client Token mentioned in your first comment. We should be passing the Exception back and not the String though so we'll work on a fix for that! This would be unrelated to the invalid argument that is being passed in though.

resultCode is returning 1 and its not loading into resultCode == Activity.RESULT_OK, even though the drop-in is not loading

This makes sense, Activity.RESULT_OK == -1. RESULT_OK would be used when Drop-in finishes successfully. If it has an issue it would not return RESULT_OK Activity.RESULT_FIRST_USER == 1 which is the value we use to represent that an error has happened when using Drop-in.

Please check the value you're getting back for DropInActivity.EXTRA_ERROR. If the error is Tokenization Key or client token was invalid we will know that the client token is malformed, and there is some issue with passing the String from your server.

from braintree-android-drop-in.

jin9393 avatar jin9393 commented on June 27, 2024

Yes client token was invalid. Thing have been solved. The token from the server pass in with a extra double quote and it was insert into the drop-in ui token. Was solved after removing it. Thanks you very much

from braintree-android-drop-in.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.