I am having difficulties when I try to apply the transfer method so I need your help.
What I want to do is transfer money [IN TEST MODE] from one stripe account to another, I did the exact thing that was written in the documentation looks like this:
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2020-03-02',
maxNetworkRetries: 2,
});
exports.handler = async (event) => {
try {
const paymentIntent = await stripe.paymentIntents.create({
amount: 100,
currency: 'eur',
payment_method_types: ['card'],
transfer_group: '{ORDER10}',
});
// Create a Transfer to the connected account (later):
await stripe.transfers.create({
amount: 70,
currency: 'eur',
destination: '{{ACCOUNT_ID}}',
transfer_group: '{ORDER10}',
});
return {
statusCode: 200,
body: JSON.stringify(paymentIntent),
};
} catch (error) {
console.log({ error });
return {
statusCode: 400,
body: JSON.stringify(error),
};
}
};
What I am getting is an error with saying there is no such destination, which means that the account ID is not available.
I got my other stripe account's ID with the curl command:
curl https://api.stripe.com/v1/account -u {{SK_TEST_KEY}}
this gave me the ID and that's what I pasted in the {{ACCOUNT_ID}} field.
What am I doing wrong? Is it something that this thing can not be done in test mode?
Or somehow I need to connect both of my stripe accounts??
Thanks in advance
I created an account on my dashboard stripe page, the main thing was that it has to be a standard account, filled in with some dummy data which I found thanks to Jonathan Steele, after that the transfer worked.