Hello stackover community, I want to integrate paypal payout functionality in my existing nodeJS Application. while doing RnD i found out that i can’t send money from paypal’s account to bank account directly. so i changed my appraoch, such as in payout api, i have passed “receipent_type” to PAYPAL_ID. i am in pakistan asia region. Paypal does not work here. now i want to test my api. from where i can get Paypal_account_ID as while completing the profile it requires me the bank account, SNS and other details which i am not having is there any way to that i can test my code
const paypalPayouts = async (req, res) => {
const { paypalID, amount, currency, note } = req.body;
if (!paypalID || !amount || !currency) {
return res
.status(400)
.json({ message: "paypalID, amount, and currency are required" });
}
const payout = {
sender_batch_header: {
sender_batch_id: Math.random().toString(36).substring(9),
email_subject: "You have a payout!",
email_message:
"You have received a payout! Thanks for using our paypal payout service!!",
},
items: [
{
recipient_type: "PAYPAL_ID",
amount: {
value: amount,
currency: currency,
},
receiver: paypalID,
note: note || "Thank you.",
sender_item_id: Math.random().toString(36).substring(9),
},
],
};
paypal.payout.create(payout, (error, payout) => {
if (error) {
console.error(error);
return res
.status(500)
.json({ message: "Error creating payout", error: error.response });
} else {
console.log("paypal Payout response=>", payout);
return res
.status(200)
.json({ message: "Payout created successfully", payout: payout });
}
});
};
how can i get my accountID or is there any way to run this api.