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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -