I'm sure I'm missing something obvious here, but I can't get my head around how to check for an existing card against a customer.
I'm using the stripe connect api within an laravel app to manage payments on behalf of others, and the basic process is as follows:
- a stripe
is created via
and submitted with the payment form
- if the customer exists in the local database, I grab their
, otherwise a new customer is created using the token as the source/card
is then created using the retrieved or new customer
Currently, if the customer returns and uses a different card, as the charge only includes a customer, not source, it'll be charged against their default card regardless.
What I'd like to do is:
- create a stripe
against local database etc
fingerprint against customer's cards
- if necessary, create new
on customer's record
- create charge using both
I can't see where in the process a persistent
is generated; both those used in the
response, and when created in the stripe dashboard, appear to be unique, meaning every charge creates a brand-new card object in stripe.
I know I can retrieve a list of cards stored against a customer's account - but where do I get the initial
from to search against?
I've seen a question that touches on this here - Can I check whether stripe a card is already existed before going to create new one?
- but I don't know Ruby, so can't make head nor tail of it.
Simpler version - is there a way to get the
as described in the stripe docs here - https://stripe.com/docs/api/php#card_object
- without having to first create a card object ?