Giter VIP home page Giter VIP logo

Comments (13)

jamesdaniels avatar jamesdaniels commented on July 4, 2024 3

Feel free to continue to discuss, just closing the issue as it's not strictly related to the example up now. I'll consider putting together a Stripe Connect example.

from functions-samples.

MarkHoath avatar MarkHoath commented on July 4, 2024 1

lets say you are uber.. the drivers need a connect account, the passengers are just customers... If the driver also wants to use the uber app as a passenger, then they need to be both a connect account and a customer.

drivers need to authenticate their connect account with you (OAUTH) and you record the stripe_account in firebase. The passengers create a customer record and save their card for processing.

When you do the charge between the driver and the passenger, you pass the drivers stripe_account and the passengers source (card id) and you would get whatever you put in the application_fee field (see above example in php).

from functions-samples.

MarkHoath avatar MarkHoath commented on July 4, 2024 1

from functions-samples.

MarkHoath avatar MarkHoath commented on July 4, 2024 1

from functions-samples.

MarkHoath avatar MarkHoath commented on July 4, 2024

If you want to REVERSE a charge this is called a REFUND and you need to use the REFUND object, pass the original CHARGE ID and the amount of the Refund. (You can only refund up to the charge amount)

If you want to PAY someone (like a supplier), then you need to use CONNECT ACCOUNTS to get the people you are paying to supply Bank Account details, then you can do a TRANSFER to send money between your account and their account.

Alternatively you can bill users on behalf of connect accounts and you just take a commission. The difference is that any disputes are handled directly by the connect account.

from functions-samples.

fxo140130 avatar fxo140130 commented on July 4, 2024

I never talk about reverse charge, @nicolasgarnier help me implemented stripe with Firebase. My question was to do the reverse process, meaning send money to my supplier with connect stripe. If you read my post I already talked about Connect account. My question was how to implement Connect Account with Firebase.
I will be glad if you can help me.

from functions-samples.

MarkHoath avatar MarkHoath commented on July 4, 2024

You should read your own comments.... "Sir, do you have any idea how I can do the reverse charge".

Each of your users will need to authenticate you for a Connect Account. Then you will get their stripe_account which you can save to Firebase.

When you call the "Charge/Capture" call to bill the end user on behalf of the Connect Account, you need to pass the Firebase Connect Account to the charge request.

Below is my PHP Code (I'm in the process of converting). If you remove the array(stripe_account) then you would bill the customer. If you supply the stripe account details, then you collect the fee and the amounts (less fee and stripe fee) are charged to the customer and deposited to the connect account.

$charge = \Stripe\Charge::create(array(
"amount" => $amount,
"currency" => $currency,
"source" => $token,
"description" => $description,
"application_fee" => $fee,
"capture" => $capture),
array('stripe_account' => $clientID)
);

from functions-samples.

MarkHoath avatar MarkHoath commented on July 4, 2024

stripe npm has the following example

// Retrieve the balance for a connected account:
stripe.balance.retrieve({
stripe_account: "acct_foo"
}).then(function(balance) {
// The balance object for the connected account
}).catch(function(err) {
// Error
});

from functions-samples.

fxo140130 avatar fxo140130 commented on July 4, 2024

Thanks @MarkHoath , Does my users have to have a stripe connect account ?

from functions-samples.

Huddie avatar Huddie commented on July 4, 2024

@jamesdaniels did you ever out together that stripe connect example?? would be super useful

from functions-samples.

joeynelson42 avatar joeynelson42 commented on July 4, 2024

@jamesdaniels just wanted to second @Huddie's request, that would be very cool!

from functions-samples.

joeynelson42 avatar joeynelson42 commented on July 4, 2024

thanks @MarkHoath! Looking forward to it.

from functions-samples.

copypasteearth avatar copypasteearth commented on July 4, 2024

Was wondering if there is a stripe connect firebase example out there yet

from functions-samples.

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.