can you modify this code for me? i want to change the form of Code/Note that its going to read payment from, its using poof.io API. "const json = {
amount: paymentAmount,
payment: 'cashapp',
currency: 'USD',
redirect_url: 'https://www.poof.io'
};
const headers = {
'Content-Type': 'application/json',
'Authorization': 'FKU0JlwjUhjDyu3yt9r__A'
};
await axios.post('https://www.poof.io/api/v1/create_fiat_invoice', json, { headers })
.then((response) => {
console.log(response.data);
const url = response.data.payment_link;
const note = url.match(/\/cashapp\/(\d+)/)[1];
const NoteInput = new EmbedBuilder()
.setTitle("⚠️ IMPORTANT WARNING ⚠️")
.setDescription("Please make sure to add the note **" + note + "** to your **CashApp Payment Notes**! That way, SMB can detect your transaction.")
.setColor(0x5d3fd3)
.addFields({ name: 'Code', value: note, inline: false })
.addFields({ name: 'Payment URL', value: url, inline: false });
const ClickDone = new EmbedBuilder()
.setTitle("INSTRUCTIONS")
.setDescription("Click **Done** after transaction is sent!")
.setColor(0x5d3fd3);
const data = premiums.findOne({
user: interaction.user.id
})
if (!data) {
new premiums({
user: interaction.user.id,
username: interaction.fields.getTextInputValue("Username"),
amount: paymentAmount,
note: url.match(/\/cashapp\/(\d+)/)[1],
paid: false,
}).save()
} else {
premiums.findOneAndUpdate(
{ user: interaction.user.id },
{
username: interaction.fields.getTextInputValue("Username"),
amount: paymentAmount,
note: url.match(/\/cashapp\/(\d+)/)[1],
paid: false,
},
// Set `upsert` to `true` to create a new document if it doesn't exist
{ upsert: true, new: true }
)
.then(updatedData => {
console.log(updatedData);
})
.catch(err => {
console.error(err);
});
}
interaction.channel.send({ embeds: [NoteInput], components: [paste] })
interaction.channel.send({ embeds: [ClickDone]})
});
})
client.on('interactionCreate', async function (interaction) {
try {
if (!interaction.isButton() || interaction.customId !== "WebReceiptInput") return;
const data = await premiums.findOne({ user: interaction.user.id });
if (data && data.paid) return interaction.reply("Already sent the funds");
const { note: transactionId, amount, username } = data;
const response = await axios.post(
'https://www.poof.io/api/v1/transaction',
{ 'transaction': transactionId },
{
headers: {
'Authorization': 'FKU0JlwjUhjDyu3yt9r__A',
'content-type': 'application/json'
}
}
);"