"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from ..shared import authorized_payment_method as shared_authorized_payment_method
from dataclasses_json import Undefined, dataclass_json
from klarna import utils
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class Order:
    r"""Order was successfully created."""
    
    order_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('order_id') }})
    r"""Unique order ID of the transaction. This ID will be used for all order management processes."""  
    authorized_payment_method: Optional[shared_authorized_payment_method.AuthorizedPaymentMethod] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('authorized_payment_method'), 'exclude': lambda f: f is None }})  
    fraud_status: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fraud_status'), 'exclude': lambda f: f is None }})
    r"""Fraud status for the order. Either ACCEPTED or PENDING. If ACCEPTED, the order could be captured. If PENDING, please wait till you receive the notification from Klarna in the notification URL that the order has been approved. You can find additional information here."""  
    redirect_url: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('redirect_url'), 'exclude': lambda f: f is None }})
    r"""URL to redirect the customer to after placing the order. This is a Klarna URL to which the merchant should redirect the customer to. Klarna will place a cookie in the customer’s browser (if redirected) and redirect the customer back to the confirmation URL provided by the merchant. This is not a mandatory step but a recommended one to improve the returning customer’s experience. It is a spontaneous step and does not harm the customer’s experience."""  
    