#syed-retrieve-pm

1 messages ยท Page 1 of 1 (latest)

green shore
#

Hello ๐Ÿ‘‹
I think that endpoint will always return the full object.
You can just grab the id from the object though right?

tepid cipher
#

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

green shore
#

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

tepid cipher
#

shoot okay, so it would end up returning multiple ids?

green shore
#

Yup

#
payment_methods = Stripe::Customer.list_payment_methods(
        cardsave.customer,
        {type: 'card'}
)
payment_methods.each do |pm|
...
end
tepid cipher
#

thanks, will take a crack at implementing this.