#hiren-prajapati_api

1 messages ¡ Page 1 of 1 (latest)

buoyant oarBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1324662963293913139

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

river gust
#

in attached image to how to pay funds using bank details for testing trasaction test mode?

#

how to Redirect from stripe invoice page to the web app

vestal latch
river gust
#

Okay, how to perform this steps can you help me for

#

In test mode, why send invoice is not send to email address give by when create stripe customer?

vestal latch
#

This is a different question actually.

river gust
#

which one

vestal latch
#

In test mode, why send invoice is not send to email address give by when create stripe customer?
Stripe don't send emails in test mode. If you want to test invoice emailing you need to use your Stripe email as a Customer email in test mode in order to get an email:
https://docs.stripe.com/test-mode#test-email

vestal latch
#

Sorry I'm not understanding your last follow up.

river gust
#

export async function createInvoice(stripeCustomerId, milestone) {
try {
// Create the invoice
const invoice = await stripe.invoices.create({
customer: stripeCustomerId,
collection_method: 'send_invoice',
due_date: Math.floor(Date.now() / 1000) + 7 * 24 * 60 * 60,
payment_settings: {
payment_method_types: ['customer_balance', 'card'], // Enable customer balance and card
},
auto_advance: true, // Invoice will not auto-finalize until payment is made
metadata: {
freelancerId: milestone.freelancerId,
milestoneId: milestone.id,
projectId: milestone.projectId,
description: Milestone payment for ${milestone.title},
},
});

// Create a new invoice item (chargeable amount)
const invoiceItem = await stripe.invoiceItems.create({
  customer: stripeCustomerId,
  amount: Math.round(milestone.paymentAmount * 100),
  currency: milestone.currency.toLowerCase(),
  description: milestone.title, // Description
  invoice: invoice.id,
});

// Finalize the invoice (send to client)
const finalizedInvoice = await stripe.invoices.finalizeInvoice(invoice.id);
// // Get the hosted invoice URL
const hostedInvoiceUrl = finalizedInvoice.hosted_invoice_url;
const invoicePdfUrl = finalizedInvoice.invoice_pdf;

return { invoice: finalizedInvoice, hostedInvoiceUrl, invoicePdfUrl };

} catch (error) {
console.error('Error creating invoice:', error);
throw error;
}
}

i have created invoice in test mode so why not geeting send invocie emai how can i test in test mode

vestal latch
#

i have created invoice in test mode so why not geeting send invocie emai how can i test in test mode
Have you had a chance to read the guide I shared?
https://docs.stripe.com/test-mode#test-email
Your test customer need to have your Stripe Account email in order to get an email in test mode.

river gust
#

Yes have to customer stripe email but not getting

vestal latch
#

Can you share the invoice Id ?

#

This one in_1Qd6YxBB4d7UbQKndWM750Cq. ?

vestal latch
river gust
#

Okay got it i have to create new custrome using stripe customer email correct ?

#

after make to test correct?

vestal latch
#

Yes

river gust
#

if stripe email and customer is same to so work send email invocie right?

vestal latch
#

Yes in test mode.

river gust
#

Okay let me do that

river gust
#

in_1Qd7XMBB4d7UbQKnccbAjRSj

not working man

#

I have try

#

you can check now req_id

#

??

vestal latch
#

I do see an event invoice.sent generated, have you checked all your email boxes ?

river gust
#

yes man

vestal latch
#

What about your spam ?

river gust
#

Not there also

vestal latch
#

Can you delete this webhook endpoint we_1Qc67rBB4d7UbQKnXMt33g3x and do the test again.

#

I'm suspecting that the pending event is blocking the email sending...

river gust
#

ok

#

NOT working I have try

#

??

vestal latch
#

Checking...

buoyant oarBOT
reef gate
#

we don't send emails in test mode as far as I know, you should use the buttons in the Dashboard to preview and send an email.

river gust
#

Okay got it man I know for that you are correct

#

when pay the invoice righ using card method so in stripe customer balance is why pending this amount webhook event geeting me paid status so why balance amount is pending in test mode

reef gate
#

I'm sorry that's really hard to understand. Could you rephrase the sentence/use more punctuation, and share a specific technical example of e.g. the JSON field you're looking at and what value you expect to see?