Git Product home page Git Product logo

Comments (8)

lkorth avatar lkorth commented on May 24, 2024

As the javadoc and docs state, you the replacement for Braintree#getInstance is Braintree#setup. What specifically is not working for you?

from braintree_android.

CapitanRedBeard avatar CapitanRedBeard commented on May 24, 2024

@lkorth Here is the code I wrote

Braintree.setup(getActivity(),
                clientToken, new Braintree.BraintreeSetupFinishedListener() {
                    @Override
                    public void onBraintreeSetupFinished(boolean setupSuccessful, Braintree braintree, String errorMessage, Exception exception) {
                        Log.d(TAG,"Exception:" + exception.getMessage());
                        if(setupSuccessful){
                            Log.d(TAG, "Received Braintree Setup");
                            mBraintree = braintree;
                            mBraintree.addListener(thisFrag);
                            mPaymentButton.initialize((MapsActivity)context, mBraintree);
                        }else{
                            Log.w(TAG,"ERROR SETUP FAILURE");
                        }
                    }
                });

Seems to match header file. The first inner log never gets run, so I assume the function is simply never finishing. It'd be cool if there was at least one available working implementation of this instantiation.

from braintree_android.

lkorth avatar lkorth commented on May 24, 2024

Sounds like you are never receiving a callback. Have you tried setting a breakpoint and stepping in? There is a working implementation of it, Drop-in uses it completely. You could also try Drop-in to see if it works for you. The Demo app has been updated to use Braintree#setup, it just hasn't been released yet.

from braintree_android.

CapitanRedBeard avatar CapitanRedBeard commented on May 24, 2024

I am stepping through it and I have no idea what I'm looking for. I really have no idea how the whole thing works, not sure how I'm messing this up. This is also in a fragment if that is known to have issues. What should I be looking for when stepping through the function? Thanks for the help btw

from braintree_android.

lkorth avatar lkorth commented on May 24, 2024

There are no know issues with Fragments.

If you get into Braintree#setupHelper it should be pretty clear to follow and see if there are any errors, that method is pretty straight forward.

You may also want to try launching Drop-in instead of calling Braintree#setup and see if that works for you. If you can reproduce the issue in a simple new app, I'm happy to take a look at the code.

You can also reach our support team via phone or email and they will be happy to help.

from braintree_android.

lkorth avatar lkorth commented on May 24, 2024

The Demo app has been updated to use Braintree#setup

from braintree_android.

lkorth avatar lkorth commented on May 24, 2024

@CapitanRedBeard: looking at it more if the thread it's running on crashes, there will be no callback. One other person has run into this by passing a non-base64 or non-json client token to Braintree#setup.

from braintree_android.

lkorth avatar lkorth commented on May 24, 2024

@CapitanRedBeard: version 1.6.2 that was released today includes additional error handling around setup and should call your callback in all cases. Feel free to re-open if it's still an issue.

from braintree_android.

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.