stripe_customer_token
is a field in Subscription
Model.
User
is associated to Subscription with has_one
association.
Make sure to set the value of @user
.
And change
@customer = Stripe::Customer.retrieve(@user.stripe_customer_token)
to
@user = ... ## Set the value of @user
@customer = Stripe::Customer.retrieve(@user.subscription.stripe_customer_token)