Update Membership 2 credit card

I'm trying to create a form that allow members to edit their Stripe credit card number. I have the form for the new CC setup on a page, and need to check if the user already authenticated since they sign up for membership.

Also, is there any reference about hooks or functions that can help with that.