Chargify SDK
This library is a small wrapper around a subset of the Chargify API.
Installation
Using your favorite dependency manager, make sure to add github.com/getwagz/go-chargify
. For example, with dep,
dep ensure -add github.com/getwagz/go-chargify
Usage
Usage is fairly straight-forward. See Configuration for more information about setting up and configuring the SDK.
Environment Variables
CHARGIFY_ENV
set to production to actually make callsCHARGIFY_API_KEY
Your secret API keyCHARGIFY_SUBDOMAIN
The subdomain for your account at Chargify
Testing
Testing requires an actual account (nothing is mocked, but that could be a good addition!). Make sure your subdomain, api key, etc are properly set.
IMPORTANT If you run all of the tests, there isn't currently a way to delete the following entities. As such, you will need to handle that in the GUI until a solution is provided in the official REST API:
- Product Family
Other Libraries
We use the following additional tools in this library, and thank the maintainers and contributors of those libraries:
- testify - Makes our unit tests more readable and management
Bugs
There is currently a bug in the Cyfe docs (as of 20180702). The docs mention that if onduplicate is set to replace, it would replace the data instead of accumulating. The behavior we are seeing is that passing anything for the field triggers the replacement, even if we send in a blank string.
Implemented Endpoints
Customers
Payment Profiles
Product Families
Products
- Create a Product
- Archive a Product
- Update a Product
- Get a Product By ID
- Get a Product By Handle
- Get a Product In Family
Subscriptions
- Create Subscription
- Cancel Subscription - Immediately
- Cancel Subscription - Delayed
- Remove Delayed Cancellation
Hiring
Are you on the New Hampshire Seacoast and love Go, Typescript, Swift, or Java? Send an email to engineering@wagz.com and let's find out if we're a good match!
Contributing
Pull Requests are welcome! See our CONTRIBUTING.md
file for more information.