14

I am working on Ride Sharing app and i choose Stripe as payment procedure. What happens in app that rider can tip to driver. For this i used this approach that, Rider will pay to the App's stripe account and then app will keep its percentage and then it will transfer remaining amount to driver's stripe account.

So far everything is going good.App has successfully charged the rider but bit confused about transfering amount to driver's stripe account. I have looked into stripe documentation which says i need driver's stripe account CONNECTED_STRIPE_ACCOUNT_ID, which i am unable to find and unable to figure out what is it. What is stripe connect account is? how can i add user to stripe connect from android to my platform?

This is the code snippet provided by stripe

Stripe.apiKey = PLATFORM_SECRET_KEY;

Map<String, Object> transferParams = new HashMap<String, Object>();
transferParams.put("amount", 1000);
transferParams.put("currency", "gbp");
transferParams.put("destination", {CONNECTED_STRIPE_ACCOUNT_ID});

Transfer.create(transferParams);

It would be nice if someone explain this to me. Thanks P.s i don't want to use webview in my app in any case. I am not allowed to use it.

Zeeshan Shabbir
  • 6,704
  • 4
  • 38
  • 74

1 Answers1

10

There are three different ways to create charges with Connect :

Which way you should use depends on your exact use case, as it also determines who pays Stripe's fees and who's responsible for refunds and chargebacks. Check out this paragraph to help you decide which way is best suited for your business.

In the first two cases, you'd specify your platform's cut with the application_fee parameter, and the destination account's ID ("acct_...") in either the Stripe-Account header or the destination parameter.

The account ID should be in your database. If you use standard accounts or Express accounts, then you get it at the end of the OAuth flow, in the stripe_user_id field. If you use custom accounts, then you get it in the id field in the response to the account creation request. In all cases, you need to save this ID in your database so you can retrieve it to issue API requests and accept payments on behalf of this account.

Ywain
  • 16,854
  • 4
  • 51
  • 67
  • Thank you very much for clearing this to me. But i am pretty much worried about ```OAuth flow``` I am using standalone account. Thing is i am using android platform and i don't want to use browser or webview for ```OAuth flow``` is there any other way?? – Zeeshan Shabbir Aug 10 '16 at 02:35
  • If your user does not already have a Stripe account, you could use [deferred account activation](https://stripe.com/docs/connect/deferred-accounts). You could do this from your backend, and let your user provide the required information directly from their dashboard, outside of your app. However, if your user does already have a Stripe account, then you have to implement the OAuth flow which requires using a browser / webview. – Ywain Aug 10 '16 at 09:19
  • yes you were right about it. I needed to use webview for it. But you guys need to provide some sdk support of mobile version. That would be awesome. Thanks – Zeeshan Shabbir Aug 13 '16 at 05:24
  • I think this id has power for managing payments and needs to be stored as encrypted. If you store in a database, it will be saved in clear text and shown in database backups, logs etc. – Bahadir Balban May 15 '20 at 20:07
  • Would you mind specifying how to access the stripe_user_id field, I went through the entire documentation but couldn't find a reference to it. https://stripe.com/docs/connect/add-and-pay-out-guide?integration=with-code, please improve this document. – Abhirup Pal May 03 '21 at 09:30