Episodes
ovi_tsb said over 3 years ago on More on Stripe and Subscriptions :
Hi Dave, on the min 5:40 we have on unsubscribes controller : subscription = customer.subscriptions .retrieve(current_user.stripe_subscription_id) .delete(at_period_end: true) I'm receiving : "Stripe::InvalidRequestError in Subscriptions::UnsubscribesController#destroy Received unknown parameter: at_period_end". https://stripe.com/docs/upgrades#2018-08-23 I looked on stripe and they said at_period_end it was replaced with cancel_at_period_end but still the same. If I leave without nothing like ".delete()" I can get "subscription = current_user.stripe_customer.subscriptions.first" for resubscribe later. Thank you.

David Kimura PRO said over 3 years ago on More on Stripe and Subscriptions :
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```

ovi_tsb said over 3 years ago on More on Stripe and Subscriptions :
Perfect !!! I tried something like this but I had subscription.delete instead subscription.save. Thank you man I was working to find the solution in the last 3 days.

tbcooney PRO said about 3 years ago on More on Stripe and Subscriptions :
Extending this logic to the `Resubscriptions` controller, you may find something like ``` subscription = current_company.stripe_customer.subscriptions.first Stripe::Subscription.update( subscription.id, { cancel_at_period_end: false } ) ```

Login to Comment