#priyan-murugan_api
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/1314611611427803256
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, you can obtain all the payment methods on a customer by making this call, https://docs.stripe.com/api/payment_methods/customer_list.
I'm using this but I'm not getting the recent payment method
cus_RLkKsNR961PBjz
this is customer id
this is my code
PaymentMethodService pService = new();
PaymentMethodListOptions listOptions = new()
{
Customer = stripeCustomerId
};
StripeList<PaymentMethod> stripePaymentMethods = await pService.ListAsync(listOptions);
PaymentMethod paymentMethod = stripePaymentMethods.MaxBy(n => n.Created);
I'm getting paymentmethod null only
That is beacuse the payment method must be verified and attached to the customer first. Since it's pending verification, it won't show.
ok
in this case, we call the setup intent then we create the payment intent based on success on setup intent
how can I check this user added payment method is not verified
You can retrieve the payment method, https://docs.stripe.com/api/payment_methods/retrieve and look at the status
we have logic like, once user setup intent is done, we get the latest payment method from stripe then we charge against that payment method id
incase if user have one verified payment method and he wants to use diff payment method is its not verified, we not able to get the latest payment method @heady sentinel
You can't use a payment method that has not beein verified yet so you would get an error likely if you treid to use that payment method.
You can retrieve the payment method by the id and look at the status
yes
thats why I want to get the recently added payment method if its not verifed I'll show the message to user, you payment method require verification like that
So you would keep track of those payment methods, and show those messages on your page.