#rohith_code
1 messages ยท Page 1 of 1 (latest)
๐ 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.
- rohith_code, 2 days ago, 43 messages
Hi there, can you share with me the invoice ID?
yes just a sec
in_1ROddnPq0Tpc8aFd0lfWdmGK
i tried a lot but could not find a way where i want to generate page similar to url
https://invoice.stripe.com/i/acct_1R4EftPq0Tpc8aFd/test_YWNjdF8xUjRFZnRQcTBUcGM4YUZkLF9TSkdGTTFsNTM3UzBhRk5hQ1NZd2RLOXp5eGlXNnpmLDEzNzgyNTg3MQ0200ReP6yQv4?s=dbre
and once user pays want to redirect to my website
in_1ROdipPq0Tpc8aFdJZXwvE11
To claify, you want to redirect your customer to the hosted invoice page to complete the payment?
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
I see. No, there's no option let hosted invoice page to redirect your customer to your webpage.
yes correct so i am trying to do with session check out url which post payment still invoice is pending
Although you specifeid the invoice ID in the metadata, completing this checkout session won't make the invoice paid.
Sure, you can build you own frontend integration with PaymentElement, and pass the invoice's confirmation_secret.client_secret to render the PaymentElement.
can you please provide code snippet i have tried a lot could not found
https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#add-the-payment-element-to-your-payment-page there you go. You just need to replace the payment_intent.client_secret with invoice's confirmation_secret.client_secret
can you please point out to some c# code repo
You mean .NET? You can find C# example code in the same doc by changing the programming language. For example https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements&lang=dotnet#add-the-payment-element-to-your-payment-page
i am not able to find where i can change option
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.
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
No you don't need to use Checkout Sessions API at all. This is what you should do
- Create a webpage, and integrate it with PaymentElement
- Pass the invoice's confirmation_secret.client_secret to the frontend, and use it to render the PaymentElement
- Call
stripe.confirmPaymentfrom the frontend to confirm the payment. - Based on the result of the
stripe.confirmPayment, redirect the customer to the desired page
im getting invoice ConfirmationSecret as null
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.
Hey! Taking over for my colleague. Let me catch up.
Actually that Invoice have a PaymentIntent pi_3ROwKmPq0Tpc8aFd29WuuMXB
Could you please share more details about your issue ?
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
i'm trying upgrade which is failing as invoice is in open state as user needs to authenticate
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
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
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.
yes but i should be able to send a link to user so that he will complete this invoice payment
Yeah sure, you can get the hosted invoice url via this attribute:
https://docs.stripe.com/api/invoices/object#invoice_object-hosted_invoice_url
What you want to send than ?
No there is not such an option.
so if inovice is in open state i can compelet it only wth hosted invoice url?
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
any code link please
Yeah sure, it's like this guide:
https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements
Just you don't create a PaymentIntent, but you reuse the Invoice's PaymentIntent
If the PaymentIntent is in requires_Action, you then simply call this JS function with the Invoice's PaymentIntent's Secret:
https://docs.stripe.com/js/payment_intents/handle_next_action
And as it's your website, you can configure redirection as you want after completion.
i want to give a link which will finalise this invoice from backend
No you'll need a frontend for this too.
because i want to send this to customer in an email
where can i have fromt end in email there
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.