Git Product home page Git Product logo

Comments (9)

chrisjenx avatar chrisjenx commented on May 31, 2024 2

@evelyne24 It would be preferable to provide a sync method or a RxJava hook/extension (See retrofit etc)

from stripe-android.

evelyne24 avatar evelyne24 commented on May 31, 2024 1

That's because the AsyncTask execute() needs to be called on the main thread. I'm imagining that you're probably calling subscribeOn() with a different thread or this observable is part of a bigger chain and at the end you call subscribeOn() a background thread. This could be solved (without using the Stripe fork) by simply making this observable call subscribeOn() the main thread so that it starts the async task where it needs.

from stripe-android.

mrmcduff-stripe avatar mrmcduff-stripe commented on May 31, 2024 1

@tomislavturcic, @chrisjenx, @caipivara, @evelyne24, and @chrisjenx

I'm happy to announce that we now have a synchronous createToken method (createTokenSynchronous) in Stripe.java, and an example of using it with rxJava hooks in the example project.

I haven't yet shipped a new version to maven central, but I'll be doing that very shortly. In the meantime, the code is in the repo if you'd like to look at it!

from stripe-android.

chrisjenx avatar chrisjenx commented on May 31, 2024

@danielgomezrico see the yoyo/stripe-android fork

from stripe-android.

danielgomezrico avatar danielgomezrico commented on May 31, 2024

@chrisjenx You mean this one? https://github.com/justyoyo/stripe-android ?

from stripe-android.

chrisjenx avatar chrisjenx commented on May 31, 2024

Yeah, we added a sync method so we can wrap it with RX calls

On Sun, 19 Jul 2015 05:48 Daniel Gomez Rico [email protected]
wrote:

@chrisjenx https://github.com/chrisjenx You mean this one?
https://github.com/justyoyo/stripe-android


Reply to this email directly or view it on GitHub
#47 (comment)
.

from stripe-android.

danielgomezrico avatar danielgomezrico commented on May 31, 2024

👍 thanks

from stripe-android.

danielgomezrico avatar danielgomezrico commented on May 31, 2024

@evelyne24 but that will not let me wrap it inside "my own rx api" for my project.

from stripe-android.

tomislavturcic avatar tomislavturcic commented on May 31, 2024

Is there any solution to this? I'm having 3 network calls after Stripe token is created and it would be nice to wrap them all up into a single call :)
EDIT: Would it be possible to copy this project, replace the asnyc call with a sync call and instead of using Android Stripe library, use regular Stripe Java library?

from stripe-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.