Comments (13)
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.
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.
from functions-samples.
from functions-samples.
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.
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.
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.
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.
Thanks @MarkHoath , Does my users have to have a stripe connect account ?
from functions-samples.
@jamesdaniels did you ever out together that stripe connect example?? would be super useful
from functions-samples.
@jamesdaniels just wanted to second @Huddie's request, that would be very cool!
from functions-samples.
thanks @MarkHoath! Looking forward to it.
from functions-samples.
Was wondering if there is a stripe connect firebase example out there yet
from functions-samples.
Related Issues (20)
- DisplayUnlockCaptcha
- [BUG] in sample:
- [DOCS] for sample: taskqueues-backup-images, it simply doesn't work with tasks_fn.on_task_dispatched function, only with http_fn.on_request function HOT 5
- onTaskDispatched when region is set the function don't deploy to the region in sample:
- [BUG] Some phone numbers do not receive OTP SMS messages with Firebase phone auth: HOT 5
- Problems with sending push notifications
- functions predeploy error: Command terminated with non-zero exit code 2 HOT 1
- functions predeploy error: Command terminated with non-zero exit code 2 HOT 1
- [DOCS] for sample: python callable functions
- How is this still a problem 2 years later? I am running into this now.
- [BUG] in sample: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/v2/providers/scheduler' is not defined HOT 1
- [BUG] in sample:
- [DOCS] for sample: auth-blocking-functions | Cannot extract event_type HOT 1
- [DOCS] for sample: monitor-cloud-logging
- [BUG] Firebase Functions Tasks: Firebase ID token has incorrect "aud" (audience) claim. HOT 2
- https_fn.HttpsError::message isn't really surfaced
- ##https://github.com/firebase/functions-samples/tree/d8ec6aa2263e5403b05a33b0a06e9340f6b4968e/quickstarts HOT 1
- Hey-c6fc3 ____firebase app HOT 1
- [BUG] in sample: taskqueues-backup-images HOT 1
- [DOCS] for sample:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functions-samples.