#heleem
1 messages ยท Page 1 of 1 (latest)
Did you pass the raw request body from the firebase request with firebaseRequest.rawBody?
app.post('/', async (req, res) => {
// ...
const firebaseRequest = req as https.Request
event = stripe.webhooks.constructEvent(
firebaseRequest.rawBody,
sig,
ENDPOINT_SECRET,
)
// ...
}
Yes I have tried to use like this but it is giving error like success_url is missing and other time it gave error for another parameter. I was trying to call webhook for payment_intent.succeeded
stripe.webhooks.constructEvent is for event signature validation. Where did you see "error like success_url is missing and other time it gave error for another parameter" from as this function doesn't throw these errors?
I tried it again and it is working now but it wasn't working earlier. Is there anything I need to change?
If it's working now, then you shouldn't need to change anything
Okay, Thank you.
No problem! Happy to help ๐
Hello,
I have question for the invoices,
Can we get the direct downloadable link for the invoice from the API?
You may find the downloadable invoice PDF url from invoice_pdf field: https://stripe.com/docs/api/invoices/object#invoice_object-invoice_pdf
Okay. And how can we get the invoice id from the payment_intent.succeeded webhook ?
"id": "pi_3NXKhsSAbls2I3yI0P3uyT4g",
"object": "payment_intent",
"amount": 110000,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 110000,
"application": null,
"application_fee_amount": 10000,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3NXKhsSAbls2I3yI0P3uyT4g_secret_PxvoXDcnXPU6MsirpCevXqR08",
"confirmation_method": "automatic",
"created": 1690189532,
"currency": "inr",
"customer": null,
"description": null,
"invoice": null,
"last_payment_error": null,
"latest_charge": "ch_3NXKhsSAbls2I3yI0FyTttJ6",
"livemode": false,
"metadata": {
"agentId": "qOznsMoV3PNdfZWwJeYIhOJiVDJ3",
"clientId": "0SxJZAiQg4x0JzeiPwpR"
},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1NXKhrSAbls2I3yI2r0Oi73I",
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": "TEST TESTSET",
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": {
"destination": "acct_1NVw7jSF1pNBnPaX"
},
"transfer_group": "group_pi_3NXKhsSAbls2I3yI0P3uyT4g"
}```
This is what I am getting
event is payment_intent.succeeded and I am using event.data.object
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-invoice_creation let's use this invoice_creation.enabled when you create the Checkout Session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
in this request https://dashboard.stripe.com/test/logs/req_r0aQZ3Cmudo1wZ
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you provide the example request id you set invoice_creation?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It takes long for me to open the Id, gimme some times
Okay
https://dashboard.stripe.com/test/events/evt_3NXzgiSAbls2I3yI0rTA9qzh this is your events, correct?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you do a Retrieve PaymentIntent API, with expand: ['invoice']?