#syed-retrieve-pm
1 messages ยท Page 1 of 1 (latest)
Hello ๐
I think that endpoint will always return the full object.
You can just grab the id from the object though right?
hi ๐
yeah the endpoint returns only the full object. I was wondering how I would go about only grabbing the id from the object though
the method you're using returns all the payment methods attached to a customer
so its an array
A customer can have many cards attached to them
shoot okay, so it would end up returning multiple ids?
Yup
payment_methods = Stripe::Customer.list_payment_methods(
cardsave.customer,
{type: 'card'}
)
payment_methods.each do |pm|
...
end
thanks, will take a crack at implementing this.