o
    rN)jR                     @   s   d dl mZ d dlmZ d dlmZmZ d dlmZm	Z	m
Z
mZ d dlmZmZmZ er8d dlmZ d dlmZ G dd	 d	ed	 Zd
S )    )CreateableAPIResource)ExpandableField)StripeObjectUntypedStripeObject)ClassVarListOptionalcast)LiteralUnpackTYPE_CHECKING)PaymentMethod)PaymentEvaluationCreateParamsc                   @   sl  e Zd ZU dZdZeed  ed< G dd deZ	G dd deZ
G dd	 d	eZG d
d deZG dd deZG dd deZee	 ed< 	 eed< 	 ee
 ed< 	 eee  ed< 	 eed< 	 eed< 	 eee  ed< 	 ed ed< 	 ee ed< 	 ee ed< 	 ed ed< 	 eed< 	 eded dd fd d!Zeded dd fd"d#Ze	e
eeeed$Zd%S )&PaymentEvaluationa]  
    Payment Evaluations represent the risk lifecycle of an externally processed payment. It includes the Radar risk score from Stripe, payment outcome taken by the merchant or processor, and any post transaction events, such as refunds or disputes. See the [Radar API guide](https://docs.stripe.com/radar/multiprocessor) for integration steps.
    zradar.payment_evaluationOBJECT_NAMEc                   @      e Zd ZU eed< dS )z-PaymentEvaluation.ClientDeviceMetadataDetailsradar_sessionN__name__
__module____qualname__str__annotations__ r   r   /var/www/html/finance.cargoinsureonline.com/_shared/backend-venv/lib/python3.10/site-packages/stripe/radar/_payment_evaluation.pyClientDeviceMetadataDetails      
 r   c                   @   sR   e Zd ZU ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )z!PaymentEvaluation.CustomerDetailscustomercustomer_accountemailnamephoneNr   r   r   r   r   r   r   r   r   r   CustomerDetails   s   
 r#   c                   @   s   e Zd ZU G dd deZG dd deZG dd deZG dd deZG d	d
 d
eZe	e e
d< 	 e	e e
d< 	 ee
d< 	 e	e e
d< 	 ed e
d< 	 e	e e
d< 	 e	e e
d< 	 eeeeedZdS )zPaymentEvaluation.Eventc                   @   .   e Zd ZU eed< 	 eed< 	 ed ed< dS )z%PaymentEvaluation.Event.DisputeOpenedamountcurrency)account_not_availablecredit_not_processedcustomer_initiated	duplicate
fraudulentgeneralnoncompliantproduct_not_receivedproduct_unacceptablesubscription_canceledunrecognizedreasonNr   r   r   intr   r   r
   r   r   r   r   DisputeOpened6   s   
 r5   c                   @      e Zd ZU ed ed< dS )z1PaymentEvaluation.Event.EarlyFraudWarningReceived)made_with_lost_cardmade_with_stolen_cardotherunauthorized_use_of_card
fraud_typeNr   r   r   r
   r   r   r   r   r   EarlyFraudWarningReceivedP   
   
 r=   c                   @   r$   )z PaymentEvaluation.Event.Refundedr%   r&   )r*   r+   r9   requested_by_customerr2   Nr3   r   r   r   r   Refunded[   s   
 r@   c                   @   sL   e Zd ZU G dd deZee ed< 	 eed< 	 ed ed< 	 deiZ	dS )z.PaymentEvaluation.Event.UserInterventionRaisedc                   @   r   )z5PaymentEvaluation.Event.UserInterventionRaised.CustomtypeNr   r   r   r   r   Customl   r   rB   customkey)3dscaptcharC   rA   N)
r   r   r   r   rB   r   r   r   r
   _inner_class_typesr   r   r   r   UserInterventionRaisedk   s   
 rH   c                   @   s(   e Zd ZU eed< 	 eed  ed< dS )z0PaymentEvaluation.Event.UserInterventionResolvedrD   )	abandonedfailedpassedoutcomeN)r   r   r   r   r   r   r
   r   r   r   r   UserInterventionResolved   s
   
 rM   dispute_openedearly_fraud_warning_receivedoccurred_atrefunded)rN   rO   rQ   user_intervention_raiseduser_intervention_resolvedrA   rR   rS   N)r   r   r   r   r5   r=   r@   rH   rM   r   r   r4   r
   rG   r   r   r   r   Event5   s8   
 

rT   c                   @   s   e Zd ZU G dd deZG dd deZG dd deZee ed< 	 ee	 ed< 	 ee ed	< 	 ee ed
< 	 e
d ed< 	 eeedZdS )zPaymentEvaluation.Outcomec                   @   r6   )z)PaymentEvaluation.Outcome.MerchantBlocked)authentication_requiredblocked_for_fraudinvalid_paymentr9   r2   Nr<   r   r   r   r   MerchantBlocked   r>   rX   c                   @   4   e Zd ZU G dd deZee ed< 	 deiZdS )z"PaymentEvaluation.Outcome.Rejectedc                   @   sD   e Zd ZU ed ed< 	 ed ed< 	 ed ed< 	 ed ed< dS )z'PaymentEvaluation.Outcome.Rejected.Cardfailpassunavailable	uncheckedaddress_line1_checkaddress_postal_code_check	cvc_check)authentication_faileddo_not_honorexpiredincorrect_cvcincorrect_numberincorrect_postal_codeinsufficient_fundsinvalid_account	lost_cardr9   processing_errorreported_stolentry_again_laterr2   Nr<   r   r   r   r   Card   s   
 rn   cardNr   r   r   r   rn   r   r   rG   r   r   r   r   Rejected   s
   
 $rq   c                   @   rY   )z#PaymentEvaluation.Outcome.Succeededc                   @   s6   e Zd ZU ed ed< 	 ed ed< 	 ed ed< dS )z(PaymentEvaluation.Outcome.Succeeded.CardrZ   r_   r`   ra   Nr<   r   r   r   r   rn      s   
 rn   ro   Nrp   r   r   r   r   	Succeeded   s
   
 rr   merchant_blockedpayment_intent_idrejected	succeeded)rJ   rs   ru   rv   rA   )rs   ru   rv   N)r   r   r   r   rX   rq   rr   r   r   r   r
   rG   r   r   r   r   Outcome   s$   
 +
rw   c                   @   s   e Zd ZU G dd deZG dd deZG dd deZeed< 	 e	ed< 	 e
e	 ed	< 	 e
e ed
< 	 e
e ed< 	 e
e ed< 	 e
e	 ed< 	 eeedZdS )z PaymentEvaluation.PaymentDetailsc                   @   sB   e Zd ZU G dd deZee ed< 	 ed ed< 	 deiZdS )z5PaymentEvaluation.PaymentDetails.MoneyMovementDetailsc                   @   s0   e Zd ZU eed  ed< 	 eed  ed< dS )z:PaymentEvaluation.PaymentDetails.MoneyMovementDetails.Card)off_session
on_sessioncustomer_presence)one_off	recurringsetup_one_offsetup_recurringpayment_typeN)r   r   r   r   r
   r   r   r   r   r   rn      s   
 rn   ro   money_movement_typeN)	r   r   r   r   rn   r   r   r
   rG   r   r   r   r   MoneyMovementDetails  s   
 r   c                   @   sB   e Zd ZU G dd deZee ed< 	 ed ed< 	 deiZdS )z5PaymentEvaluation.PaymentDetails.PaymentMethodDetailsc                   @   sZ   e Zd ZU G dd deZeed< 	 ee ed< 	 ee ed< 	 ee ed< 	 deiZdS )zDPaymentEvaluation.PaymentDetails.PaymentMethodDetails.BillingDetailsc                   @   `   e Zd ZU ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )zLPaymentEvaluation.PaymentDetails.PaymentMethodDetails.BillingDetails.Addresscitycountryline1line2postal_codestateNr"   r   r   r   r   Address?     
 r   addressr   r    r!   N	r   r   r   r   r   r   r   r   rG   r   r   r   r   BillingDetails>  s   
 r   billing_detailsr   payment_methodN)	r   r   r   r   r   r   r   r   rG   r   r   r   r   PaymentMethodDetails=  s   
 -r   c                   @   sL   e Zd ZU G dd deZeed< 	 ee ed< 	 ee ed< 	 deiZdS )z0PaymentEvaluation.PaymentDetails.ShippingDetailsc                   @   r   )z8PaymentEvaluation.PaymentDetails.ShippingDetails.Addressr   r   r   r   r   r   Nr"   r   r   r   r   r   v  r   r   r   r    r!   Nr   r   r   r   r   ShippingDetailsu  s   
 r   r%   r&   descriptionmoney_movement_detailspayment_method_detailsshipping_detailsstatement_descriptor)r   r   r   N)r   r   r   r   r   r   r   r4   r   r   r   rG   r   r   r   r   PaymentDetails  s,   
 8)
r   c                   @   s0   e Zd ZU G dd deZeed< 	 deiZdS )zPaymentEvaluation.Signalsc                   @   s.   e Zd ZU eed< 	 ed ed< 	 eed< dS )z+PaymentEvaluation.Signals.FraudulentPaymentevaluated_at)elevatedhighestlownormalnot_assessedunknown
risk_levelscoreN)r   r   r   r4   r   r
   floatr   r   r   r   FraudulentPayment  s   
 r   fraudulent_paymentN)r   r   r   r   r   r   rG   r   r   r   r   Signals  s
   
 r   client_device_metadata_details
created_atcustomer_detailseventsidlivemodemetadataobjectrL   payment_details)blockcontinuerecommended_actionsignalsparamsr   returnc                 K   s   t d| jd|  |dS )
        Request a Radar API fraud risk score from Stripe for a payment before sending it for external processor authorization.
        r   postr   )r	   _static_request	class_urlclsr   r   r   r   create  s   zPaymentEvaluation.createc                    s"   t d| jd|  |dI dH S )r   r   r   r   N)r	   _static_request_asyncr   r   r   r   r   create_async  s   
zPaymentEvaluation.create_async)r   r   r   rL   r   r   N)r   r   r   __doc__r   r   r
   r   r   r   r#   rT   rw   r   r   r   r4   r   r   boolr   classmethodr   r   r   rG   r   r   r   r   r      sl   
 j #
r   N)stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._stripe_objectr   r   typingr   r   r   r	   typing_extensionsr
   r   r   stripe._payment_methodr   5stripe.params.radar._payment_evaluation_create_paramsr   r   r   r   r   r   <module>   s   