ruby on rails - Retrieve Customer's default and active card from Stripe -
i trying retrieve default , active card of customer. (also keep in mind coding have, customer can have 1 card means if there way around it can help).
some months ago used code segment working fine. seems stripe made updates , can't work now.
current_user.stripe_card_id = customer.active_card.id
the error is
undefined method `active_card' #stripe::customer
if need more information please let me know.
edit: customer.default_card.id
not work either.
i used customer.methods check methods , found (default_source):
current_user.stripe_card_id = customer.default_source
works fine now. thank you
Comments
Post a Comment