#Parth R. Jangid (Pseudo Bugs)

1 messages · Page 1 of 1 (latest)

autumn coyoteBOT
pulsar birch
#

Hello! To clarify, you're handling the raw card data yourself? Are you fully PCI compliant?

desert lodge
#

I am actually not complaint!

#

Is there a way through which I can safely send the card details that the user enters using STPPaymentCardTextField and then use those details to attach the card to the user?

frosty sonnet
#

im not a stripe employee... but i had the same issue. i solve it by checking if the customer object has a card with identical fingerprint.
You can get fingerprint in paymentMethod.Card.Fingerprint
According to stripe docs, fingerprint is
Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

reference: https://stripe.com/docs/api/cards/object

pulsar birch
desert lodge
pulsar birch
#

Look under the Mobile SDK tab there.

#

Can you tell me more about where you're seeing the duplicate attachment?

#

Or can you give me a Customer ID so I can investigate?

desert lodge
#

Yes the customer id is cus_O2cK7KonnxAZ0g.

pulsar birch
#

Okay, first, it looks like you're making some API calls to directly attach Payment Methods to this Customer. You shouldn't do that; the best way to attach a Payment Method to a Customer is with a Setup Intent or a Payment Intent with setup_future_usage set.

desert lodge
#

Oh

pulsar birch
#

That request to confirm the Setup Intent attached the Payment Method to the Customer.

desert lodge
#

Oh I see. Thanks!

pulsar birch
#

The typical approach, at a high level, is to create a Setup Intent, specify a Customer for it, then confirm that Setup Intent client-side with payment details provided in a Stripe UI component. Upon successful confirmation the Setup Intent will attach the Payment Method it creates to the Customer.

desert lodge
#

Makes sense and if someone tries to attach the same card again then it will not attach it to the customer again and rather give an error correct?

pulsar birch
#

That depends on what you mean by "same card". If you mean the same Payment Method object, then yeah, you'll get an error. If you mean someone types in card details, those get attached, then separately they type in the same card details, a different Payment Method is created, and that gets attached, that can happen.

desert lodge
#

Understood. Thanks!

#

Just one more question, do we have any method .createPaymentMethod if so can I use this to safely send my card details to server?

#

my own server*

pulsar birch
#

No, wait, that's the wrong link...

#

You can look at the web version of that guide to get a general feel for how that flow works.

desert lodge
#

Sounds good thanks!

#

I have one more question if you don't mind. So if I pass setup_future_usage: 'off_session' while creating the payment Intent then it will process the payment and also attach that method to that customer correct?

If so then can I get an access to that payment_method's id, last 4, exp month and date? If yes then how?

pulsar birch
#

Yep, that's correct. All of those details will be on the resulting Payment Method.