Ah, so a SaaS site where users can enter their Stripe API KEY and receive payments through your application. Funny, I'm actually working on one of these right now so I'll be sure to take notes of certain aspects during the process for this episode.
See if something like this will work.
```customer = current_user.stripe_customer
subscription = customer.subscriptions.retrieve(current_user.stripe_subscription_id)
subscription.cancel_at_period_end = true
subscription.save```