88
99from pydantic import BaseConfig , Extra , Field
1010
11- from glQiwiApi .types .amount import HashablePlainAmount , PlainAmount
11+ from glQiwiApi .types .amount import Amount , HashableAmount
1212from glQiwiApi .types .base import HashableBase
1313from glQiwiApi .types .exceptions import WebhookSignatureUnverifiedError
1414
@@ -20,7 +20,7 @@ class Customer(HashableBase):
2020
2121
2222class BillStatus (HashableBase ):
23- value : str
23+ amount : str
2424 changed_datetime : Optional [datetime ] = Field (None , alias = 'changedDateTime' )
2525
2626
@@ -39,7 +39,7 @@ class BillError(HashableBase):
3939
4040
4141class Bill (HashableBase ):
42- amount : HashablePlainAmount
42+ amount : HashableAmount
4343 status : BillStatus
4444 site_id : str = Field (..., alias = 'siteId' )
4545 id : str = Field (..., alias = 'billId' )
@@ -61,7 +61,7 @@ def invoice_uid(self) -> str:
6161class RefundedBill (HashableBase ):
6262 """object: RefundedBill"""
6363
64- amount : PlainAmount
64+ amount : Amount
6565 datetime : datetime
6666 refund_id : str = Field (..., alias = 'refundId' )
6767 status : str
@@ -85,7 +85,7 @@ def verify_signature(self, sha256_signature: str, secret_p2p_key: str) -> None:
8585 webhook_key = base64 .b64decode (bytes (secret_p2p_key , 'utf-8' ))
8686 bill = self .bill
8787
88- invoice_params = f'{ bill .amount .currency } |{ bill .amount .value } |{ bill .id } |{ bill .site_id } |{ bill .status .value } '
88+ invoice_params = f'{ bill .amount .currency } |{ bill .amount .amount } |{ bill .id } |{ bill .site_id } |{ bill .status .amount } '
8989 generated_signature = hmac .new (
9090 webhook_key , invoice_params .encode ('utf-8' ), hashlib .sha256
9191 ).hexdigest ()
0 commit comments