I'm sure I'm missing something obvious here, but I can't figure out how to check an existing card for a client.
I use the Stripe Connect API in the Laravel application to manage payments on behalf of others, and the main process is as follows:
- the
token strip is created using stripe.js and sent with the payment form - if the client exists in the local database, I take it
stripe_id , otherwise a new client is created using the token as a source / map - then a
charge is created using the found or new client stripe_id
Currently, if a customer returns and uses a different card, since the fee includes only the client and not the source, he will be debited from the card by default, regardless.
I would like to do the following:
- create a
token strip - check
customer with local database, etc. - check
card fingerprint on customer cards - if necessary, create a new
card in the customer record - create a charge using
customer and card identifiers
Simply put: I do not see where in the process a constant card_id generated; both the ones used in stripe.js answer and when creating stripes on the dashboard seem unique, which means that each charge creates a new map object in the strip.
I know that I can get a list of cards stored in the clientβs account, but where can I get the initial card_id for the search?
I saw a question that addresses this question here - Can I check if a map strip exists before creating a new one? βBut I donβt know Ruby, so I canβt make out a single tail of it.
EDIT:
The simplified version - is there a way to get a fingerprint , as described here in the strip documents - https://stripe.com/docs/api/php#card_object - without having to first create a map object?
php laravel stripe-payments stripe-connect
taekni
source share