#muhammad-hamza_testing-connect

1 messages ยท Page 1 of 1 (latest)

crisp nacelleBOT
#

๐Ÿ‘‹ 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.

plush raptor
crisp nacelleBOT
#

muhammad-hamza_testing-connect

wicked hamlet
#

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 })
}
});

plush raptor
#

Can you share the ID of the request that returned that error?

wicked hamlet
#

which id?

#

requestID=>

#

requestId: 'req_IWLAmAURmfivVW',