Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement Stripe and charging #1863

Merged
merged 1 commit into from Jun 16, 2019

Conversation

@anhanh11001
Copy link
Contributor

anhanh11001 commented May 30, 2019

Details:

  • Remove card type picker as this is a unnecessary component
  • Add Stripe implementation to the flow of ordering ticket

Flow of ordering paid ticket with Stripe:
-> Create order -> Send token -> Charge order -> Confirm order

Fixes: #1830

@anhanh11001

This comment was marked as outdated.

Copy link
Contributor Author

anhanh11001 commented May 30, 2019

@iamareebjamal how should I test whether I can create paid order successfully with Stripe. I have tried creating my own Stripe account, get test Publishable key, put that key into the build.gradle file, use test card from stripe. But I get this error during charging

Logs:

D/OkHttp: Content-Length: 193
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    {"errors": [{"status": 409, "source": {"pointer": ""}, "title": "Conflict", "detail": "Request req_D3l31CujddeW7P: No such token: tok_1EfkSbBwemLKZTQekhvL1fUJ"}], "jsonapi": {"version": "1.0"}}
    <-- END HTTP (193-byte body)
D/AttendeeViewModel$chargeOrder: Failed charging the user
    retrofit2.adapter.rxjava2.HttpException: HTTP 409 CONFLICT
        at retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:54)
        at retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:37)
        at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:44)
        at io.reactivex.Observable.subscribe(Observable.java:12267)
        at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34)
        at io.reactivex.Observable.subscribe(Observable.java:12267)
        at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
        at io.reactivex.Single.subscribe(Single.java:3603)
        at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:784)
@iamareebjamal

This comment has been minimized.

Copy link
Member

iamareebjamal commented May 30, 2019

Open issue on server

Details:
- Flow of charging: Create pending order -> Test valid input data for card -> Create token -> Send token + pending order to server for charging -> Send complete order after successfully charged.

Fixes: #1830
@anhanh11001 anhanh11001 changed the title WIP - feat: Implement Stripe and charging feat: Implement Stripe and charging Jun 15, 2019
@auto-label auto-label bot added the feature label Jun 15, 2019
@anhanh11001 anhanh11001 requested a review from liveHarshit Jun 16, 2019
@iamareebjamal iamareebjamal merged commit bdb3969 into fossasia:development Jun 16, 2019
5 checks passed
5 checks passed
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
Mergeable Mergeable Run has been Completed!
Details
Semantic Pull Request ready to be squashed
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@anhanh11001 anhanh11001 deleted the anhanh11001:1830_stripe branch Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.