#Shra_1
1 messages · Page 1 of 1 (latest)
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.
how do we expnad that while creating invoice
when you call the API to finalize the invoice, it should be possible to pass expand:["payment_intent"]
https://stripe.com/docs/api/invoices/finalize + https://stripe.com/docs/expand
thank you
hi
i don't know why some of webhook triggers fails.
this is the response I get
Webhook signature verification failed. No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing
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.
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
Hi! I'm taking over this thread.
Can you share a specific event that generated this error (evt_xxx)?
evt_1LiGFzLKyyfhhfy3BUbuaNzh
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.
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
Can you share the invoice ID (in_xxx)?
pi_3LiGYmLKyyfhhfy31UJGUHcJ
If you look at that PaymentIntent in your dashboard, the issue is pretty clear:
https://dashboard.stripe.com/test/payments/pi_3LiGYmLKyyfhhfy31UJGUHcJ
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
but payment should happen through payment methods that customer have right
Only if the customer has a default payment method set there: https://stripe.com/docs/api/customers/create#create_customer-invoice_settings-default_payment_method
Otherwise you should manually set the PaymentMethod when creating the invoice: https://stripe.com/docs/api/invoices/create#create_invoice-default_payment_method
I tried with default payment method now, but still the status is incomplete.
this is the Id pi_3LiHFtLKyyfhhfy3095ZAqtp
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)
thank you