DEV Community

Ashish Mehra
Ashish Mehra

Posted on

Destination Charges in stripe

Here is the link of stripe documentation for creating destination charges
https://stripe.com/docs/connect/destination-charges

// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("sk_test_############");

stripe.charges.create({
  amount: 1000,
  currency: "usd",
  source: "tok_visa",
  destination: {
            account: "{CONNECTED_STRIPE_ACCOUNT_ID}",
          },
}).then(function(charge) {
  // asynchronously called
});

What CONNECTED_STRIPE_ACCOUNT_ID is ? and how I suppose to retreive it ?

Oldest comments (3)

Collapse
 
razbounak profile image
Bredillet Thomas

You must create an account linked with a real other stripe account

This is the main advantage of Stripe connect, if you don't need, don't use connect fonctionnality

stripe.com/docs/connect/quickstart...

Collapse
 
mehraas profile image
Ashish Mehra

Is it possible to test it with 2 different test account ? One will be main platform and other is connected one.

Collapse
 
hudaniabhee profile image
Abhee Hudani ☕ • Edited

You are supposed to retrieve that ID by logging into your stripe account. And there we'll be a organization account token. If you want you can check my recent post about stripe payment with node js