#rohith_code

1 messages ยท Page 1 of 1 (latest)

lilac joltBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1372437190541447221

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

autumn dagger
#

Hi there, can you share with me the invoice ID?

young valley
#

yes just a sec

#

in_1ROddnPq0Tpc8aFd0lfWdmGK

#

and once user pays want to redirect to my website

#

in_1ROdipPq0Tpc8aFdJZXwvE11

autumn dagger
#

To claify, you want to redirect your customer to the hosted invoice page to complete the payment?

young valley
#

no i want to show something similar to hosted url page and redirect user to my website upon payment

#

with hosted page url i can only make payment and not redirect to my website

autumn dagger
#

I see. No, there's no option let hosted invoice page to redirect your customer to your webpage.

autumn dagger
#

Although you specifeid the invoice ID in the metadata, completing this checkout session won't make the invoice paid.

young valley
#

is there a way to get this done

#

can you please suggest a way

autumn dagger
#

Sure, you can build you own frontend integration with PaymentElement, and pass the invoice's confirmation_secret.client_secret to render the PaymentElement.

young valley
#

can you please provide code snippet i have tried a lot could not found

autumn dagger
young valley
#

can you please point out to some c# code repo

autumn dagger
young valley
#

i am not able to find where i can change option

autumn dagger
#

You should be able to see example code in C# by clicking the link that I shared earlier.

You still need to use Javascript or react for the frontend integration.

young valley
#

var sessionCreateOptions = new SessionCreateOptions
{
Mode = "payment",
SuccessUrl = $"https://clinic-portal-euw-dev.azurewebsites.net",
CancelUrl = $"https://clinic-portal-euw-dev.azurewebsites.net",
Customer = invoice.CustomerId, // Replace with the customer's ID
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
PriceData = new SessionLineItemPriceDataOptions
{
Currency = invoice.Currency,
UnitAmount = invoice.AmountDue,
ProductData = new SessionLineItemPriceDataProductDataOptions
{
Name = $"Invoice {invoice.Number} Payment",
},
},
Quantity = 1,
},
},
Metadata = new Dictionary<string, string>
{
{ "InvoiceId", invoice.Id },
},
PaymentIntentData = new SessionPaymentIntentDataOptions
{
SetupFutureUsage = "off_session",
},
};

#

in this still i'm not able to pass invoice.ConfirmationSecret

autumn dagger
#

No you don't need to use Checkout Sessions API at all. This is what you should do

#
  1. Create a webpage, and integrate it with PaymentElement
  2. Pass the invoice's confirmation_secret.client_secret to the frontend, and use it to render the PaymentElement
  3. Call stripe.confirmPayment from the frontend to confirm the payment.
  4. Based on the result of the stripe.confirmPayment , redirect the customer to the desired page
young valley
#

im getting invoice ConfirmationSecret as null

autumn dagger
#

What's the invoice ID?

#

If the invoice was created with a Stripe API version earlier than basil, you can use its payment_intent.client_secret.

lilac joltBOT
young valley
#

even payment intent is null

#

in_1ROwKmPq0Tpc8aFdy6gokjjD

glacial rune
#

Hey! Taking over for my colleague. Let me catch up.

glacial rune
#

Could you please share more details about your issue ?

young valley
#

this is my code
i'm trying upgrade which is failing as invoice is in open state as user needs to authenticate
so here i want to generate link for this invoice which will redirect to my app

glacial rune
young valley
#

req_NtKP07fu694obj

#

Why is it so difficult to create a link with invoice and redirect to my web page post payment

#

this cannot redirect to my web page post payment

#

i want similar , which im trying using checkout session

glacial rune
#

Ah I see what you mean

#

Why is it so difficult to create a link with invoice and redirect to my web page post payment
You can't configure the invoice to redirect your customer to your website after completion that's not Supported.

young valley
#

yes but i should be able to send a link to user so that he will complete this invoice payment

glacial rune
young valley
#

no i dont want to send hosted invoice url

#

beacause it will not redirect

glacial rune
#

What you want to send than ?

young valley
#

i want to send a link which will redirect to my webpage

#

post payment

glacial rune
#

No there is not such an option.

young valley
#

so if inovice is in open state i can compelet it only wth hosted invoice url?

glacial rune
#

Or you can use it's PaymentIntent and complete it with a PaymentElement

#

Like you implement a PaymentPage in your website, where you share its link with your customer and will enable the Customer to complete the Invoice's PaymentIntent

young valley
#

any code link please

glacial rune
#

And as it's your website, you can configure redirection as you want after completion.

young valley
#

i want to give a link which will finalise this invoice from backend

glacial rune
#

No you'll need a frontend for this too.

young valley
#

because i want to send this to customer in an email

#

where can i have fromt end in email there

glacial rune
#

What I meant is: you create a separate page in your website where you handle this case (confirm an Invoice's PaymentIntent) and share with your customer the url to your website's page.