From 3b5f08716052aaf66fc3f5bc43d5647cfe216a48 Mon Sep 17 00:00:00 2001 From: Marcin Warzybok Date: Wed, 28 Feb 2024 10:36:01 +0100 Subject: [PATCH 1/2] SP-883 - fix class name for InvoiceRefundAddress --- src/bitpay/models/invoice/invoice.py | 4 ++-- src/bitpay/models/invoice/invoice_refund_addresses.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bitpay/models/invoice/invoice.py b/src/bitpay/models/invoice/invoice.py index 7719657..2ff8554 100644 --- a/src/bitpay/models/invoice/invoice.py +++ b/src/bitpay/models/invoice/invoice.py @@ -6,7 +6,7 @@ from pydantic import Field from .buyer import Buyer from .buyer_provided_info import BuyerProvidedInfo -from .invoice_refund_addresses import InvoiceRefundAddresses +from .invoice_refund_addresses import InvoiceRefundAddress from .miner_fees import MinerFees from .refund_info import RefundInfo from .shopper import Shopper @@ -48,7 +48,7 @@ class Invoice(BitPayModel): payment_codes: Union[Dict[str, Dict[str, str]], None] = None acceptance_window: Union[int, None] = None buyer: Union[Buyer, None] = None - refund_addresses: Union[List[Dict[str, InvoiceRefundAddresses]], None] = None + refund_addresses: Union[List[Dict[str, InvoiceRefundAddress]], None] = None close_url: Union[str, None] = Field(alias="closeURL", default=None) auto_redirect: Union[bool, None] = False json_paypro_required: Union[bool, None] = False diff --git a/src/bitpay/models/invoice/invoice_refund_addresses.py b/src/bitpay/models/invoice/invoice_refund_addresses.py index 8820722..d359d0b 100644 --- a/src/bitpay/models/invoice/invoice_refund_addresses.py +++ b/src/bitpay/models/invoice/invoice_refund_addresses.py @@ -5,7 +5,7 @@ from bitpay.models.bitpay_model import BitPayModel -class InvoiceRefundAddresses(BitPayModel): +class InvoiceRefundAddress(BitPayModel): date: Union[datetime, None] email: Union[str, None] tag: Union[int, None] = None From e9ab3e26193465339bffd7ebd32f5f60dab505b0 Mon Sep 17 00:00:00 2001 From: Marcin Warzybok Date: Wed, 28 Feb 2024 10:38:58 +0100 Subject: [PATCH 2/2] SP-883 Python 5.0.3 - Pydantic validation --- src/bitpay/models/invoice/invoice_refund_addresses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bitpay/models/invoice/invoice_refund_addresses.py b/src/bitpay/models/invoice/invoice_refund_addresses.py index d359d0b..122838d 100644 --- a/src/bitpay/models/invoice/invoice_refund_addresses.py +++ b/src/bitpay/models/invoice/invoice_refund_addresses.py @@ -6,8 +6,8 @@ class InvoiceRefundAddress(BitPayModel): - date: Union[datetime, None] - email: Union[str, None] + date: Union[datetime, None] = None + email: Union[str, None] = None tag: Union[int, None] = None type: Union[str, None] = None