Raghav Herugu
Raghav Herugu

Reputation: 546

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.

Upvotes: 2

Views: 3930

Answers (2)

Unknown
Unknown

Reputation: 11

  1. Install Stripe Package: Use npm to install the Stripe package.
  2. Initialize Stripe: Set up Stripe with your API keys.
  3. Create Payment Intent: Generate a payment intent for the transaction.
  4. Confirm Payment: Authenticate the payment intent.
  5. Transfer Funds: Use the transfer API to send money to the bank account.

Upvotes: 1

Raghav Herugu
Raghav Herugu

Reputation: 546

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!

Upvotes: 7

Related Questions