https://github.com/bazarnov/fast_spring_api
Wrapper to FastSpring API
https://github.com/bazarnov/fast_spring_api
Last synced: 3 months ago
JSON representation
Wrapper to FastSpring API
- Host: GitHub
- URL: https://github.com/bazarnov/fast_spring_api
- Owner: bazarnov
- Created: 2022-09-07T12:16:40.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-17T19:38:18.000Z (almost 2 years ago)
- Last Synced: 2025-01-18T06:11:02.775Z (4 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wrapper to FastSpring API
## Example Usage
```python
# IMPORT DEPENDENCIES
from fast_spring_api.modules.subscription import Subscription
from fast_spring_api.main.auth import FastSpringAuth# SET THE LIST OF THE SUBS TO BE UPDATED
input_data_list: list = [
# should fail, because subs is Canceled
{
"end":"2023-10-30",
"next":"2023-10-31",
"subscription":"7w4_gDbJQMeKotwi6pxNzA",
},
# should success
{
"end":"2023-11-30",
"next":"2023-11-31",
"subscription": "JgqQCVRHSYiqcd_m9IFvwA",
},
]# SET SINGLE SUBS TO BE UPDATED
input_data: dict = {
"end":"2023-11-30",
"next":"2023-11-31",
"subscription": "JgqQCVRHSYiqcd_m9IFvwA",
}# SET CREDENTIALS
## FastSpring API User
user = "user"
## FastSpring API Password
password = "password"# AUTHENTICATE
fs_auth = FastSpringAuth(user, password)# UPDATE SUBS using list of entities
Subscription(fs_auth).update(input_data_list)# UPDATE SUBS using single entity
Subscription(fs_auth).update(input_data)
```