#pawan_docs
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/1288093408593969152
๐ 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.
- pawan_code, 1 day ago, 38 messages
Hi @drowsy sun
Sorry unclear from your question what exactly is the issue? Sounds like a saved card is not surfacing in hosted Checkout?
yes
I am Refering this Doc to save and show saved card in checkout
https://docs.stripe.com/payments/save-during-payment?platform=web&ui=elements#save-payment-methods
Here is the Payment form in My Checkout
So In Saved Card I am seeing only one card but i am having more then one and that one card in not the latest saved card
can you please go through the above doc which i provided
What is the pm_xxx ID of the card that is not showing up?
pm_1Q2WGDHBIoGyEgRJ0IVWIxhv
pm_1Q2WEbHBIoGyEgRJQPtdPe4F
allow_redisplay is always i setted customly via update payment method
Can you share the code you use to create the Customer Session?
/**
- This is used to create a customer session for registered users to save the cards
*/
import Stripe from 'stripe'
import stripeApiKeys from './stripe-api-keys'
export default async function (req, res) {
const stripeAPIKeysResults = await stripeApiKeys()
const stripe = Stripe(stripeAPIKeysResults.secretkey)
const {customerId} = req.body
try {
const customerSession = await stripe.customerSessions.create({
customer: customerId,
components: {
payment_element: {
enabled: true,
features: {
payment_method_redisplay: 'enabled',
payment_method_save: 'enabled',
payment_method_save_usage: 'on_session',
payment_method_remove: 'enabled',
payment_method_allow_redisplay_filters: [
'always',
'limited',
'unspecified'
],
payment_method_redisplay_limit: 3
}
}
}
})
res.status(200).send({
customerSession: customerSession
})
} catch (error) {
res.status(400).send({error: error.message})
}
}
Taking a look
As Per The Doc Follwed the Approach to show checkbox in payment page by creating customer session and passing the customerSessionClientSecret in options
To clartify, which of these saved cards is not showing in the Element?
did't got your question ?
I asked which pm_xx is not showing in the list, you sent me two pm_xxx IDs
Which one of the two is it?
pm_1Q2WGDHBIoGyEgRJ0IVWIxhv : Not Showing
pm_1Q2WEbHBIoGyEgRJQPtdPe4F : Showing
As you can see in the Doc There is Option to **See More ** in saved card Section, But Its Also Not coming for me
Hi @drowsy sun Are you there ?
Yes, please be patient we're looking into it and also helping other users
Can you try adding a new pm_xxx to the same customer but using a different test card, maybe 4242
We think that payment methods that have the same card number are deduplicated. Both pm_1Q2WGDHBIoGyEgRJ0IVWIxhv and pm_1Q2WEbHBIoGyEgRJQPtdPe4F are created from the 1111 test card so we only show one of them
Yep, so this is expected. We only list unique payment methods
i.e. not ones that are from the same card details
Ok If We Saved Differnt card then Only It Will Show See More
What if We Saved one Card with different month/expiery and CVV
Hi @drowsy sun , @boreal bramble ?
Have some patience, please
Yes, the deduplication is specific to the card number
So you can add 1111 again with a different expiry and it should show
Not Clear Can you please Elaborate
hi there!
so you want to know if you add the same card twice with a different expiry date, if you will see the two cards in the Payment Element?
I recommend testing this yourself. but it looks like we would show a single card in this case.
I am Getting Single Card When Using Same card With different Expiry
yes same on my end. so that answers your question.
Ok Let me know One More Thing in below Scenario how to Handle
for Ex : I have Saved 2-3 Cards
4111 4111 4111 4111 12/30 999
4111 4111 4111 4111 04/25 255
4111 4111 4111 4111 01/28 858
So If There if Will Show One Card Then How Can I Place Order with Other Saved card
but in real life users won't have the same card with different expiry dates, right? so that's not really an issue.
I Am Having One More Issue Actually I am Customly setted the allow_redisplay='always' via calling the updatePayment Method but As Per the Doc It Should Not Happen,
I don't undertsand. what's your question/issue?
When we Create payment method and Sucessfully placed Order In payment method response i am Getting allow_redisplay='unspecified'
It Should Automatic handle by stripe when we click on checkbox
can you share the PaymentMethod ID (pm_xxx)?
https://docs.stripe.com/payments/save-during-payment?platform=web&ui=elements#save-payment-methods
can you refer this doc please
PMid : pm_1Q2W1zHBIoGyEgRJLP5HKqM0
having a look
Sure Soma Take your Time
if you check the creation request of that PaymentMethod: https://dashboard.stripe.com/test/logs/req_IRYnrapagRxWqj
you can see that Stripe.js set allow_redisplay: "unspecified".
are you sure you checked the box to save the PaymentMethod on the Payment Element?
Yes I am Sure I Checked the Box and Payment is Saved for The Customer
okay let me try to reproduce. it's possible to documentation is wrong.
Yes
Please Don't Close The Thread Allow me 30-45mins , because if you close then again i have to describe all the issue to your collegue
we may close this thread if it's inactive, but you can zasily reopen a new thread if needed and share a quick summary of the issue.
I think there is No any Option to reopen the thread
Let me reverify again the Scenario
Now I am removing the custom code which i wrote to update paymentMethod allow_redisplay: "always"
I think there is No any Option to reopen the thread
no, but you can open a new one.
yes no Issues I am trying give me 5 min and let me reverify again
looking on it
Hi @boreal bramble are you there
Let me Know if You are Available @boreal bramble
Hi @thorny whale Let me know if you are available.
Hey there, yep stepping in for soma who had to step away, just getting caught up
Sure
Did everything work in your retesting after removing that update?
Here is the Video Link Please Have a Look
https://pawan-etg.tinytake.com/msc/MTAxMzM0NjlfMjM4MDkzNDc
PMID : pm_1Q2YLpHBIoGyEgRJfwTK9aKu
I Have removed my custom code and captured Please have a look
Have you gone Through ?
Yea but its long and I don't understand the pieces. Trying to come up with some questions.
I noticed you're using manual payment method creation, and a test card that isn't a typical stripe test card (4111). Are you sure you're confirming the intent with the created payment method? Can you share the associated intent?
Honestly, I can try to review but I think this would be better handled by you writing in with a clear minimal reproduction along with an instance that we can access to probe the behaviour.
No We Are not Using manual Payment Method Creation It its trigrring function once all the fields are filled then Its Creating Payment methid
if you notice after payment intent Confirmation we are navigating to Order Confirmation page
You're specifying paymentMethodCreation: 'manual' and calling createPaymentMethod
That's manual payment method creation
If you want to use a flow like that with Saved Payment Methods, you need to use Confirmation Tokens
If I recall correctly, this is required for Saved Payment Methods to work like you expect
Where you have seen paymentMethodCreation: 'manual'
in ElementsOptions ?
Yes Its Mine
What if i Use Manual then what need to do ?
And When i don't use manual then ?
If you use confirmPayment without PM/CT creation, this should work as you expect
I'm pretty sure the reason this isn't working like you expect is becaus eof this manual PM creation flow. SPM requires using ConfirmationTokens for this pattern.
See here for guidance on moving from createPaymentMethod to createConfirmationToken in your flow: https://docs.stripe.com/payments/payment-element/migration-ct
Okay, I will try it out. Additionally, if this thread closes and I have any related questions, will providing this thread link allow your colleagues to access the discussion so I don't have to explain everything again?
If you open a new thread later, it will automatically link back to your recent threads ๐