Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I delete a subscription and the customer on Chargify using this gem? #173

Open
zackxu1 opened this issue Feb 10, 2020 · 3 comments
Open

Comments

@zackxu1
Copy link

zackxu1 commented Feb 10, 2020

How can I use this gem to delete a subscription and the associated customer? When I call subscription.destroy, the subscription is cancelled. I would like to delete both the subscription and customer in Chargify. Is this supported? I don't see any examples in the code or in the rspec files. Thanks.

@wsmoak
Copy link
Contributor

wsmoak commented Feb 10, 2020

Chargify generally doesn't recommend deleting subscriptions in a live site because it removes all the historical transaction and activity records and changes prior analytics, etc. It can be manually done in the Admin UI if needed however.

If this is a test site, you can "Clear Site Data" and remove all the customers and subscriptions to start over.

I think it's been deemed too dangerous to have in the public gem code, but if you have a use case for really deleting individual subscriptions, write to support (or sales if you're not yet signed up) and ask about it.

@zackxu1
Copy link
Author

zackxu1 commented Feb 10, 2020

Thanks for your feedback. This is for automated testing. We would like to clean up after we run the tests by deleting the Chargify objects created during the tests.

Manually deleting the objects via the admin UI can be laborious. "Clear Site Data" is too extreme as this is our staging environment used by interactive users too.

Is there no workaround for this? What's the support contact email address?

Thank you.

@wsmoak
Copy link
Contributor

wsmoak commented Feb 10, 2020

You can write to [email protected]

I can't tell from your message how often these tests are run, but something like VCR might be helpful to decouple the tests from Chargify. https://github.com/vcr/vcr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants