-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from mwarzybok-sumoheavy/feature/SP-883
SP-883 Python 5.0.3 - Pydantic validation
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
InvoiceRefundAddress | ||
""" | ||
|
||
from datetime import datetime | ||
from typing import Union | ||
from pydantic import field_serializer | ||
|
||
from bitpay.models.bitpay_model import BitPayModel | ||
|
||
|
||
class InvoiceRefundAddress(BitPayModel): | ||
date: Union[datetime, None] = None | ||
email: Union[str, None] = None | ||
tag: Union[int, None] = None | ||
type: Union[str, None] = None | ||
|
||
@field_serializer("date") | ||
def serialize_datetime(self, dt: datetime) -> str: | ||
return super().serialize_datetime_to_iso8601(dt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,15 @@ | |
"notify": true | ||
}, | ||
"autoRedirect": true, | ||
"refundAddresses": [], | ||
"refundAddresses": [ | ||
{ | ||
"n2MDYgEhxCAnuoVd1JpPmvxZShE6rQA6zv": { | ||
"type": "buyerSupplied", | ||
"date": "2024-01-08T23:50:56.556Z", | ||
"email": "[email protected]" | ||
} | ||
} | ||
], | ||
"refundAddressRequestPending": false, | ||
"buyerProvidedEmail": "[email protected]", | ||
"buyerProvidedInfo": { | ||
|