简体   繁体   中英

Send money to a bank account using Stripe | Node JS

So I have this React application where users can buy gift cards online, and I'm using Stripe Payments. So far, the users can pay the money, except it will go to me(through Stripe), not to the merchant selling the Gift Cards on my app.

Is there a way with Stripe to send money to a bank account? Keep in mind that the bank account will be different for each Gift Card any users can buy. For example, one person selling the gift cards will be the one earning the money through a different bank account than another person.

If there is a way, please tell me how to implement it, and thank you very much in advance.

I finally figured how to do this. You have to follow these steps:

1: Integrate Stripe Checkout

2: Integrate Stripe Onboarding for express accounts

These two steps are the fundamental steps in doing this.

How To Integrate Stripe Checkout:

You can get stripe checkout by using the

stripe.checkout.sessions.create

method. You can then pass in arguments like:

payment_method_types: ["card"],
locale: locale,
line_items: [
  {
    name: `${Name}`,
    images: ["Images"],
    quantity: 1,
    currency: usd,
    amount: price, // Keep the
    // amount on the server to prevent customers
    // from manipulating on client
  },
],
payment_intent_data: {
  transfer_data: {
    destination: product.id,
  },
},
success_url: `success`,
cancel_url: `cancel`,

What this will do is create a new checkout session to use.

Next Step, Onboard the businesses

All you have to do for this is to go to a URL:

const url = `https://connect.stripe.com/express/oauth/authorize?${args.toString()}

where args is this:

const state = uuid();

const args = new URLSearchParams({
  state,
  client_id: process.env.STRIPE_CLIENT_ID,
});

Send this data to your frontend and you will get a good looking form that onboard users and creates express accounts for them.

The basic concept is simple, you onboard the businesses, which creates a stripe account for them. Then with the checkout form, you send the money to that created stripe account. This account will automatically deliver to the businesses bank or debit account, thus making customer to merchant payments.

Here are some helpful documentation I used to solve the problem:

I hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM