#matiullah-paymentmethod-fingerprint

1 messages · Page 1 of 1 (latest)

narrow flumeBOT
jolly yoke
#

Hello, I am not clear on your question. Can you give me an example of what you want to do with multiple cards in this scenario?

trim ether
#

like Mastercard, visa card, I want to provide facilty to users to save their cards for later use. I did it using SetupIntent but it showing duplicate card.

4242 4242 4242 4242 (it create 10 records for this card only, when i try to retrieve all Setup intent of a user like cus_123345648)

#

there?

#

I am waiting for your response.

jolly yoke
#

Apologies the server is busy. You can do this but you will need to write custom code to check if you already saved a card like that and to detatch one of the duplicate cards once you find one

#

That fingerprint will be the same when the same card details are saved

#

If you already have a PaymentMethod with that fingerprint on the Customer, you can detach either the old payment method or the new one

trim ether
#

so i can filter cards using fingerprint?

#

when we make request to stripe server, does it has cost or not?

narrow flumeBOT
wicked tree
#

matiullah-paymentmethod-fingerprint

#

We don't have an API to list/search via fingerprints no. What we usually recommend is really to cache this information in your own database which makes it way easier

trim ether
#

is it safe?

wicked tree
#

yes

trim ether
#

so the flow is

after successful payment -> store fingerprints in database if this fingerprint not exist before. if exist then don't store it.

#

I don't think this will work. and its costly in api consumption means.

wicked tree
#

I mean it will work fine, that's what most people do. I don't get what's "costly" here. It's all a few lines of code

trim ether
#

if possible. kindly provide a hint.

#

here is sample of my code.

#

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
header('Content-Type: application/json');

try {
   
    $setupIntent = \Stripe\SetupIntent::create([
        'customer' => 'cus_ONPNdNgiVO3RrT',
    ]);

    echo json_encode(['client_secret' => $setupIntent->client_secret]);
} catch (\Stripe\Exception\CardException $e) {
    http_response_code(500);
    echo json_encode(['error' => $e->getMessage()]);
}
exit;

}