File tree Expand file tree Collapse file tree 5 files changed +33
-5
lines changed
lago_python_client/models Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ This is a python wrapper for Lago API
7
7
8
8
## Current Releases
9
9
10
- | Project | Release Badge |
11
- | --------------------| -----------------------------------------------------------------------------------------------------|
12
- | ** Lago** | [ ![ Lago Release] ( https://img.shields.io/github/v/release/getlago/lago )] ( https://github.com/getlago/lago/releases ) |
13
- | ** Lago Python Client** | [ ![ Lago Python Client Release] ( https://img.shields.io/github/v/release/getlago/lago-python-client )] ( https://github.com/getlago/lago-python-client/releases ) |
10
+ | Project | Release Badge |
11
+ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
12
+ | ** Lago** | [ ![ Lago Release] ( https://img.shields.io/github/v/release/getlago/lago )] ( https://github.com/getlago/lago/releases ) |
13
+ | ** Lago Python Client** | [ ![ Lago Python Client Release] ( https://img.shields.io/github/v/release/getlago/lago-python-client )] ( https://github.com/getlago/lago-python-client/releases ) |
14
14
15
15
## Installation
16
16
@@ -32,7 +32,7 @@ Check the [lago API reference](https://doc.getlago.com/docs/api/intro)
32
32
33
33
``` bash
34
34
python -m pip install --upgrade pip setuptools wheel
35
- python -m pip install ' .[test]'
35
+ python -m pip install ' .[test,lint ]'
36
36
```
37
37
38
38
### Run tests
@@ -41,6 +41,12 @@ python -m pip install '.[test]'
41
41
pytest
42
42
```
43
43
44
+ ### Lint
45
+
46
+ ``` bash
47
+ ruff format
48
+ ```
49
+
44
50
## Documentation
45
51
46
52
The Lago documentation is available at [ doc.getlago.com] ( https://doc.getlago.com/docs/api/intro ) .
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ class SubscriptionResponse(BaseResponseModel):
44
44
downgrade_plan_date : Optional [str ]
45
45
current_billing_period_started_at : Optional [str ]
46
46
current_billing_period_ending_at : Optional [str ]
47
+ on_termination_credit_note : Optional [str ]
47
48
48
49
49
50
class SubscriptionsResponse (BaseResponseModel ):
Original file line number Diff line number Diff line change 39
39
pytest
40
40
pytest_httpx
41
41
42
+ lint =
43
+ ruff
44
+
42
45
[options.package_data]
43
46
* = py.typed
Original file line number Diff line number Diff line change 11
11
"status" : " active" ,
12
12
"billing_time" : " anniversary" ,
13
13
"terminated_at" : null ,
14
+ "on_termination_credit_note" : " skip" ,
14
15
"subscription_at" : " 2022-04-29T08:59:51Z" ,
15
16
"previous_plan_code" : null ,
16
17
"next_plan_code" : null ,
Original file line number Diff line number Diff line change @@ -140,6 +140,23 @@ def test_valid_destroy_subscription_request(httpx_mock: HTTPXMock):
140
140
assert response .plan_code == "eartha lynch"
141
141
142
142
143
+ def test_valid_destroy_subscription_with_on_termination_credit_note_request (httpx_mock : HTTPXMock ):
144
+ client = Client (api_key = "886fe239-927d-4072-ab72-6dd345e8dd0d" )
145
+ identifier = "sub_id"
146
+
147
+ httpx_mock .add_response (
148
+ method = "DELETE" ,
149
+ url = "https://api.getlago.com/api/v1/subscriptions/" + identifier + "?on_termination_credit_note=skip" ,
150
+ content = mock_response (),
151
+ )
152
+ response = client .subscriptions .destroy (identifier , {"on_termination_credit_note" : "skip" })
153
+
154
+ assert response .external_customer_id == "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
155
+ assert response .status == "active"
156
+ assert response .plan_code == "eartha lynch"
157
+ assert response .on_termination_credit_note == "skip"
158
+
159
+
143
160
def test_valid_destroy_pending_subscription_request (httpx_mock : HTTPXMock ):
144
161
client = Client (api_key = "886fe239-927d-4072-ab72-6dd345e8dd0d" )
145
162
identifier = "sub_id"
You can’t perform that action at this time.
0 commit comments