#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/1372936796266299453
๐ 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, 1 day ago, 68 messages
- rohith_code, 4 days ago, 43 messages
hi there, what are you expective to happen here and what are you observing?
Can you share the customer ID you're retrieving?
hi i'm trying to retrieve user card last 4 digits shown similarly in below url
cus_SK1R9hvZi7w8jV
So you can retrieve the Subscription and expand default_payment_method: https://docs.stripe.com/api/subscriptions/object?api-version=2025-04-30.basil#subscription_object-default_payment_method
Are you expanding?
See: https://stripe.com/docs/expand for info on how that works
i'm getting stripe callback event of invoice failed
in that i get invoice object
Ah you want to go from the Invoice to the PaymentMethod
Yep that's because you aren't expanding default_payment_method
var service = new SubscriptionService();
var options = new SubscriptionListOptions()
{
Customer = customerId,
Limit = 1,
};
var subscriptionsList = await service.ListAsync(options);
if (!subscriptionsList.Any())
{
return null;
}
return subscriptionsList.First();
Sure thing
i need one more help please
Sure what's up
i have a similar scenario where my upgrade fails due to 3d secure confirm is required , as part of that i'm receiveing a invoice hosted url which has option to confirm payment
instead of sending that to customer i want to create a url similar to check out session url , using which user can make payment against this invoice and redirect to my website
Okay so you want to create your own payment form on your own website to have your user pay for the Invoice on your website, correct?
yeah tecnically at backend i will generate url and pass it to website, which will redirect to stripe checkout page and post payment user is redirected to my website
thisi is code i used , but im not able to clear the actual invoice
So you can't use Stripe Checkout here and tie the Invoice to the Subscription.
Stripe Checkout is only used for creating a new Subscription or taking a one-off payment not associated to an Invoice.
You would need to create a custom integration using Payment Element if you want to pay the Invoice on your own site.
so how can i acheive what i'm loking for
The only other option is to have them pay via Stripe Checkout and then you can mark the Invoice as paid.
can you please give sample for stripe check out
You would follow https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements if you want to create your own payment form here -- you would use the Client Secret of the PaymentIntent associated to the Invoice instead of creating your own PaymentIntent.
exactly, but i could not get payment intent when i fetched invoice details
You want the confirmation_secret.client_secret: https://docs.stripe.com/api/invoices/object?api-version=2025-04-30.basil#invoice_object-confirmation_secret-client_secret
i am getting that as null
Are you expanding?
Since it is a nullable dictionary it will be null unless expanded.
var invoiceService = new InvoiceService(_stripeClient);
await Task.Delay(2000);
var invoice = await invoiceService.GetAsync(updatedSubscription.LatestInvoiceId);
You need to expand latest_invoice.confirmation_secret
Err wait sorry you are retrieving the Invoice here
So you just expand confirmation_secret
can you pease point out to sample ccode
Or if you are going from the Subscription you would do latest_invoice.confirmation_secret
We don't have exact example code, but similar idea to: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription#create-intent
var subscriptionOptions = new SubscriptionCreateOptions
...
subscriptionOptions.AddExpand("latest_invoice.confirmation_secret");
oh cool i can do from subscription too
Yeah