#Arghya Das

1 messages ยท Page 1 of 1 (latest)

lapis dragonBOT
candid rune
#

Hi there, how can I help?

wicked monolith
#

hello

#

or should I just redirect user to the url that are coming back from the response

candid rune
#

redirectToCheckout is deprecated, you should just redirect your customer to the checkout session URL.

wicked monolith
#

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

candid rune
wicked monolith
#

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

candid rune
wicked monolith
#

I am using test api key

#

so it will not go automatically?

candid rune
#

No emails are sent in test mode

wicked monolith
#

no not emails

#

can I send to the page I am redirecting the user to?

#

on the website

candid rune
#

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.

wicked monolith
#

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

candid rune
wicked monolith
#

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?

candid rune
#

Do you have the video link? I'd like to know what video you have seen

wicked monolith
#

oh that video doesn't show that

#

it's from the stripe developers

candid rune
#

OK. I guess you are talking about about subscriptions of collect_method=send_invoice

#

Also there's no checkout.session.created webhook events.

wicked monolith
#

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

candid rune
#

I don't understand, why do you want to redirect your customer form the hosted invoice page to a checkout page?

wicked monolith
#

for showing the invoice to the user first

candid rune
#

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.

wicked monolith
#

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

candid rune
#

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

wicked monolith
#

oh ok

#

so in your opinion which is best

#

redirecting to them in the checkout url or invoice?

candid rune
#

There's no checkout here, just invoice.

lapis dragonBOT
wicked monolith
#

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

fleet ferry
#

๐Ÿ‘‹ 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

wicked monolith
#

ok ok thanks

fleet ferry
#

No problem! Happy to help ๐Ÿ˜„

wicked monolith
#

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?

fleet ferry
#

What properties are you referring to? Why do you need to remove them?

wicked monolith
#

so they are empty or null

fleet ferry
#

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

wicked monolith
#

oh ok

#

that's what I wanted to know

#

thanks