Skip to content

Commit 30ccf88

Browse files
authored
Feat(wallets): add code to wallet (#361)
* add code to wallet * fix tests
1 parent e7d3bfb commit 30ccf88

5 files changed

Lines changed: 9 additions & 1 deletion

File tree

lago_python_client/models/charge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class Charge(BaseModel):
3535
filters: Optional[ChargeFilters]
3636
tax_codes: Optional[List[str]]
3737
applied_pricing_unit: Optional[AppliedPricingUnit]
38+
accepts_target_wallet: Optional[bool]
3839

3940

4041
class Charges(BaseModel):
@@ -55,6 +56,7 @@ class ChargeResponse(BaseResponseModel):
5556
properties: Optional[Dict[str, Any]]
5657
filters: Optional[ChargeFilters]
5758
taxes: Optional[TaxesResponse]
59+
accepts_target_wallet: Optional[bool]
5860

5961

6062
class ChargesResponse(BaseResponseModel):

lago_python_client/models/wallet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Wallet(BaseModel):
5656
external_customer_id: Optional[str]
5757
rate_amount: Optional[str]
5858
name: Optional[str]
59+
code: Optional[str]
5960
priority: Optional[int]
6061
paid_credits: Optional[str]
6162
granted_credits: Optional[str]
@@ -79,6 +80,7 @@ class WalletResponse(BaseResponseModel):
7980
status: str
8081
currency: str
8182
name: Optional[str]
83+
code: Optional[str]
8284
priority: Optional[int]
8385
rate_amount: str
8486
credits_balance: str

tests/fixtures/plan.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"applied_to_organization": false,
5151
"created_at": "2022-04-29T08:59:51Z"
5252
}
53-
]
53+
],
54+
"accepts_target_wallet": true
5455
}
5556
],
5657
"minimum_commitment": {

tests/fixtures/wallet.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"status": "active",
77
"currency": "EUR",
88
"name": "name",
9+
"code": "wallet_code",
910
"priority": 30,
1011
"rate_amount": "1.5",
1112
"credits_balance": "10",

tests/test_wallet_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def wallet_object():
3131
)
3232
return Wallet(
3333
name="name",
34+
code="wallet_code",
3435
priority=30,
3536
external_customer_id="12345",
3637
rate_amount="1",
@@ -73,6 +74,7 @@ def test_valid_create_wallet_request(httpx_mock: HTTPXMock):
7374
"external_customer_id": "12345",
7475
"rate_amount": "1",
7576
"name": "name",
77+
"code": "wallet_code",
7678
"priority": 30,
7779
"paid_credits": "10",
7880
"granted_credits": "10",

0 commit comments

Comments
 (0)