#muhammad-hamza_testing-connect
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1249710481946575011
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi ๐ you use your testmode key to make your requests in testmode:
https://docs.stripe.com/test-mode
For testing Connect flows, you can use the values shown here to successfully onboard test accounts for your testing:
https://docs.stripe.com/connect/testing
muhammad-hamza_testing-connect
json +>
{
"amount": "105",
"currency": "USD",
"destinationAccountId": "acct_1PQ4WvRG4BIIolyx"
}
response
{
"message": "Something Went Wrong",
"code": 500,
"details": "No such external account: 'acct_1PQ4WvRG4BIIolyx'"
}
code =>
import stripePackage from "stripe";
const stripe = stripePackage(process.env.STRIPE_SECRET_KEY);
import { catchTryAsyncErrors } from "./helper.mjs"
export const stripeTransfer = catchTryAsyncErrors(async (event) => {
const body = JSON.parse(event.body);
const { amount, currency, destinationAccountId } = body;
console.log("{incoming body}=> ", body);
if (!amount || !currency || !destinationAccountId) {
return {
statusCode: 400,
body: JSON.stringify({ message: "Amount, currency, and destinationAccountId are required!" })
}
}
if (amount <= 0) {
return {
statusCode: 400,
body: JSON.stringify({ message: "Amount must be greater than 0" })
}
}
const payout = await stripe.payouts.create({
amount: amount * 100,
currency: currency,
destination: destinationAccountId,
});
console.log("payout ------> ------> ------>", payout);
return {
statusCode: 200,
body: JSON.stringify({ message: "Payout created!", data: payout })
}
});
Can you share the ID of the request that returned that error?