add default org
This commit is contained in:
@@ -44,7 +44,6 @@ class PaymentMethod(str, Enum):
|
||||
CREDIT_CARD = 'CREDIT_CARD'
|
||||
|
||||
|
||||
@dataclass
|
||||
class Address(BaseModel):
|
||||
postcode: str
|
||||
neighborhood: str
|
||||
@@ -76,7 +75,7 @@ class Order(BaseModel):
|
||||
cnpj: str | None = None
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Credentials:
|
||||
account_id: str
|
||||
api_token: str
|
||||
@@ -161,6 +160,7 @@ class Iugu:
|
||||
)
|
||||
r.raise_for_status()
|
||||
except requests.HTTPError as err:
|
||||
logger.info('IUGU Response', response=err.response)
|
||||
logger.exception(err)
|
||||
raise
|
||||
else:
|
||||
@@ -197,6 +197,7 @@ class Iugu:
|
||||
)
|
||||
r.raise_for_status()
|
||||
except requests.HTTPError as err:
|
||||
logger.info('IUGU Response', response=err.response)
|
||||
logger.exception(err)
|
||||
raise
|
||||
else:
|
||||
@@ -233,11 +234,13 @@ class Iugu:
|
||||
|
||||
try:
|
||||
r = requests.post(
|
||||
url, json=payload, timeout=(HTTP_CONNECT_TIMEOUT, HTTP_READ_TIMEOUT)
|
||||
url,
|
||||
json=payload,
|
||||
timeout=(HTTP_CONNECT_TIMEOUT, HTTP_READ_TIMEOUT),
|
||||
)
|
||||
r.raise_for_status()
|
||||
except requests.HTTPError as err:
|
||||
logger.info('Response', err.response)
|
||||
logger.info('IUGU Response', response=err.response)
|
||||
logger.exception(err)
|
||||
raise
|
||||
else:
|
||||
@@ -247,9 +250,13 @@ class Iugu:
|
||||
url = self.url(path=f'/v1/invoices/{format_id(invoice_id)}')
|
||||
|
||||
try:
|
||||
r = requests.get(url, timeout=(HTTP_CONNECT_TIMEOUT, HTTP_READ_TIMEOUT))
|
||||
r = requests.get(
|
||||
url,
|
||||
timeout=(HTTP_CONNECT_TIMEOUT, HTTP_READ_TIMEOUT),
|
||||
)
|
||||
r.raise_for_status()
|
||||
except requests.HTTPError as err:
|
||||
logger.info('IUGU Response', response=err.response)
|
||||
logger.exception(err)
|
||||
raise
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user