#Shra_1

1 messages · Page 1 of 1 (latest)

reef turretBOT
fiery sand
#

hi! no there isn't

#

if you need a more customised flow you might want to take the invoice.payment_intent and integrate that directly into a custom payment form using Elements for example that you build, rather than the hosted page.

restive tide
#

how do we expnad that while creating invoice

fiery sand
restive tide
#

thank you

restive tide
#

hi

fiery sand
#

there are many potential causes of that. The usual one is that the body you pass is not the exact raw HTTP body, which is why the error message links to an example app which correctly accesses the raw body.

#

to debug this you'd have to start by adding some logs to check the exact parameters you pass to constructEvent such as the signature and the event payload.

restive tide
#

but I don't think I have any issue with parameters, why because there are other trigers in same code file which are working fine

strong parcel
#

Hi! I'm taking over this thread.

#

Can you share a specific event that generated this error (evt_xxx)?

restive tide
#

evt_1LiGFzLKyyfhhfy3BUbuaNzh

strong parcel
#

because there are other trigers in same code file which are working fine
I checked your webhook endpoint, and all events are failing.

#

So like karllekko said:

to debug this you'd have to start by adding some logs to check the exact parameters you pass to constructEvent such as the signature and the event payload.

restive tide
#

okay, i'll check them

#

I have another doubt, I was trying to create invoice with "collection_method: "charge_automatically"
this how i do
const invoice = await stripe.invoices.create({
collection_method: "charge_automatically",
customer: "cus_MOm2GvE2fOcsFX",
pending_invoice_items_behavior: "include",
collection_method: "send_invoice",
days_until_due: 30,
});
console.log("invoice", invoice);
const invoiceItem = await stripe.invoiceItems.create({
customer: "cus_MOm2GvE2fOcsFX",
price: "price_1LiCTDLKyyfhhfy3DrrAB9LM",
invoice: invoice.id,
quantity: 5,
});
console.log("invoice item", invoiceItem);

but I still see incomplete status in dashboard

strong parcel
#

Can you share the invoice ID (in_xxx)?

restive tide
#

pi_3LiGYmLKyyfhhfy31UJGUHcJ

strong parcel
restive tide
#

but payment should happen through payment methods that customer have right
there are methods attached to customer.
or am I going in a wrong approach

strong parcel
restive tide
#

I tried with default payment method now, but still the status is incomplete.
this is the Id pi_3LiHFtLKyyfhhfy3095ZAqtp

strong parcel
#

This is from an invoice with collection_method: "send_invoice", so here the default payment method is ignored and an email is sent.

#

(but in test mode Stripe doesn't send any email)

restive tide
#

thank you