#dawidzawada-elements-react
1 messages · Page 1 of 1 (latest)
No worries, I'll be waiting there
It might be also some server-side config solution
👋 can you share your initPaymentSheet?
yes
wait a minute
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Okay actually sorry the initPaymentSheet doesn't matter. I hadn't played with this in a bit but now I remember.
So this is based on paymentmethods attached to a Customer object
PaymentSheet will automatically display those attached cards.
I don't believe there is a way to disable this, but let me check.
Are you only using PaymentSheet to collect cards?
Or other LPMs as well?
So a workaround here would be to create a new Customer object every time a card is added
But that likely isn't great for you
As you would then need to link Customers and track on your end.
Yes, only cards, I'm using separated buttons and code for apple/gpay
Okay so the workaround here would be to not pass the ephemeralkey to initPaymentSheet. The ephemeralkey is what gives the front-end access to the Customer details. We call this out in our docs (https://stripe.com/docs/payments/accept-a-payment?platform=react-native#react-native-add-server-endpoint) If you never save cards to a Customer and don’t allow returning Customers to reuse saved cards, you can omit the Customer and Customer Ephemeral Key objects from your integration.
However what you are going to do here will be slightly out of intended scope since you will be passing a Customer but not ephemeral key. This should work fine but I recommend thorough testing with this approach in case there is any edge-case since we usually would recommend passing both Customer + EphKey or neither.
I did do a quick basic test and it did work fine to save the new card to the Customer and their saved cards are not displayed.
Ok, I'm actually kind of saving cards and retrieving them trough SMS code veryfication, is this workaround will be good for this?
Hmm can you explain more about what you mean by that?
The route I mention above still does save the Card within Stripe. It just doesn't display saved cards in the UI.
So it seems to be what you were originally looking for.
As far I understand cards will be still on stripe but frontend without ephemeralkey will not receive that information
Yep
Ok that seems like a solution for me, can you not close for a minute this thread? I'll run a quick test and check if it works
Yep sure thing
Also you can always pop in later if the thread does get archived at some point and ask another question!
Ok, I've run a quick test and it is working, thank you for that!
🎉
Definitely recommend testing thoroughly... both Android and iOS (I only tested on iOS fyi).
But I do think it should work fine.
Sure thing, should I test also live mode?
We can't recommend testing in production as it is against card network regulations.
I can recommend that you test the UI in production.
But I can't recommend that you actually save/charge cards in production for a testing purpose.
Ok, I think test cards will be fine tho, thank u again and have a nice day!