#Arghya Das
1 messages ยท Page 1 of 1 (latest)
Hi there, how can I help?
hello
or should I just redirect user to the url that are coming back from the response
redirectToCheckout is deprecated, you should just redirect your customer to the checkout session URL.
yea I am returning a url which is session.url
yea ok
let me try that with the url then I wll tell you the problem I am facing
yes so after successful payment I am updating something in my database
so for that work I need to listen to that webhook url right?
as I am using localhost
https://stripe.com/docs/payments/checkout/fulfill-orders#handle-the-event so you should listen to checkout.session.completed event and fulfil the order based on the checkout session data
yes yes
working fine
but if I make the payment without listening to it
the webhook doesn't work
now the problem is I am redirecting my user in the completion page with the session id
where I am sending them a completion message
is there any way to send the receipt as a downloadable pdf on that page
no I don't want to send them to email for now
just on the completion page with a download button
if I can somehow show or send the receipt of the payment
Do you mean post-payment invoice with checkouts https://stripe.com/docs/payments/checkout/post-payment-invoices#after-session ?
No emails are sent in test mode
no not emails
can I send to the page I am redirecting the user to?
on the website
No, I don't see an option to directly download the invoice from a checkout page
So before you navigate your customer to the success page, in your backend you need to manually retrieve the checkout session's invoice (https://stripe.com/docs/api/checkout/sessions/object?lang=cli#checkout_session_object-invoice) and provide the invoice's invoice_pdf (https://stripe.com/docs/api/invoices/object?lang=cli#invoice_object-invoice_pdf) link in the success page.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh that's how I can
and one thing
my checkout page is very very simple
how can I more images on it
you have some docs on that
?
I coulnd't find it
https://stripe.com/docs/payments/checkout/customization here's how you can customize a checkout page
thanks
now a last question
I have seen in a video that you can send the invoice to user where they can go to payment page for payment
can I also do like same?
I am using this and redirecting user to the url
instead of that can I somehow redirect user to the invoice page first then from there they can pay?
Do you have the video link? I'd like to know what video you have seen
OK. I guess you are talking about about subscriptions of collect_method=send_invoice
Also there's no checkout.session.created webhook events.
I am just making a guess if I can do it here or not
mine is one time payment
what I am thinking that
first redirect to them to the hosted invoice page then from there they can be redirected to the checkout page
I don't understand, why do you want to redirect your customer form the hosted invoice page to a checkout page?
for showing the invoice to the user first
I mean the customer can make a payment directly on the hosted invoice page, there's no need to create a new checkout session and redirect them to there to make another payment.
yea yea I understand that
but for redirecting them to the hosted invoice page
what method I need to use
to get the url back from the response and give it to the user so they can be redirected to the invoice page
https://stripe.com/docs/invoicing you can create an invoice in Dashboard, or use Invoicing APIs to create one programmatically.
Once an invoice is created, you can send (https://stripe.com/docs/api/invoices/send) it to customer's email, or just redirect your customer to the hosted invoice page through its url
https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh ok
so in your opinion which is best
redirecting to them in the checkout url or invoice?
There's no checkout here, just invoice.
nono I ask for you opnion
so what will be the best usecase or option
to send the user to the checkout page
or to send the user to the invoice page
๐ Taking over this thread, catching up now
Using Checkout Session or Invoice is up to your your business decision. You can either redirect customer to the Checkout Session to complete the payment or send invoice to the customer to complete the payment
ok ok thanks
No problem! Happy to help ๐
also when I am returning the session id
from the success url
there are so many properties which are null or empty
can I just simple remove them or what?
What properties are you referring to? Why do you need to remove them?
so they are empty or null
If you're referring to Checkout Session request, you can just don't set them.
If you're referring to Checkout Session response, you can just ignore them. You only need to look for the parameters needed. There's no need to remove or modify them