#harinth-
1 messages · Page 1 of 1 (latest)
I have a card saved under a customer as card_xxxxxx in my db.
But that card has been detached from the customer id
So I need to attach it again to that customer
Detachment happened in stripe, not in my db
once a card is detached from a customer it's no longer usable
in all cases you should probably start saving the Payment Method ids pm_xx instead of the Card ids
If you really want to save that information
I don't see why to be honest but maybe you have a viable use-case
In my db I have customer id and card id.
So while trying to make the payment, payment fails
So thats why I am trying to attach the card with that customer
But just now I tried something and it produced a valid response
In my db I have customer id and card id.
yes but what I'm trying to say is that you might not need to store both, since you can always list the customer's payment methods from Stripe
but in all cases, as I mentioned before, once you detach a Payment Method (in this case the card) it's no longer usable
But just now I tried something and it produced a valid response
could you please share the request id? here's how you can find one https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Actually, I tried this request
curl https://api.stripe.com/v1/payment_methods/card_xxxxxxxx/attach
-u sk_test_xxxxxxxx:
-d customer=cus_xxxxxxx
and it given me a valid response as object and card_id was having the customer id in its object
Does that mean, the attachment happened?
Sorry, I am unable to give the request id as its dashboard is not accessible to me
yes
But that card is not pupulated under the card listing of that customer
which card listing exactly?
what field in the API or the Dashboard are you looking at?
I have run the above curl script in POSTMAN and it produced a valid response with a card object
But that card is not listing under the customer query
what query? what field in the API or the Dashboard are you looking at?
show me a screenshot of what you're looking at where you expect to see the card and don't.
https://api.stripe.com/v1/customers/cus_xxxxx/payment_methods?type=card
Here its not listing the card attached before. Its showing all other cards under the customer
In POSTMAN, not in Dashboard
can you share the exact JSON response from that call?