From the course: Adding Stripe Payments to Your Ruby on Rails Application

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Resubscribing using an existing card

Resubscribing using an existing card

- [Instructor] Now that we have this working, we can go to the subscription form and update it so that we can display your current card on file when you're resubscribing, and offer to use that card to resubscribe automatically. Or, add a link to add a new card for the subscription. So let's cancel this user subscription. And let's go into the Rails console again. And, let's load that user up and set their expiration to a month ago. So this user can now resubscribe. And if we go to the Subscribe form we don't want to display these fields. We want to display their previous Visa card and then give them the option to fill out this form and submit a payment this way if they choose to add a new card. So we need to open up the App Views Subscriptions folder and go back to our new action. So this view is what displays that credit card form. And this time, we actually want to optionally display this form. We want to display it visible when you're subscribing for the first time. But we want to…

Contents