
    <@g>                     f   d dl Z d dlmZ d dlmZmZmZmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZmZ d d	lmZ d d
lmZmZmZ d dlmZ d dlmZ d dlmZ d dlm Z m!Z! d dl"m#Z#m$Z$ d dl%m&Z& d dl'm(Z( d dl)m*Z*m+Z+m,Z,m-Z-m.Z. d dl/m0Z0 d dl1m2Z2 d dl3m4Z4 d dl5m6Z6 d dl7m8Z8 d dl9m:Z: d dl;m<Z< d dl=m>Z> d dl?m@Z@ d dlAmBZB d dlCmDZD d dlEmFZF d dlGmHZH d d lImJZJ d d!lKmLZL d d"lMmNZN d d#lOmPZP d d$lQmRZR d d%lSmTZT d d&lUmVZV d d'lWmXZX d d(lYmZZZ d d)l[m\Z\ d d*l]m^Z^ d d+l_m`Z` d d,lambZb d d-lcmdZd d d.lemfZf d d/lgmhZh d d0limjZj d d1lkmlZl d d2lmmnZn d d3lompZp d d4lqmrZr d d5lsmtZt d d6lumvZv d d7lwmxZx d d8lymzZz d d9l{m|Z| d d:l}m~Z~ d d;lmZ d d<lmZ d d=lmZ d d>lmZ d d?lmZ d d@lmZ d dAlmZ d dBlmZ d dClmZ d dDlmZ d dElmZ d dFlmZ d dGlmZ d dHlmZ d dIlmZ d dJlmZ d dKlmZ d dLlmZ d dMlmZ d dNlmZ d dOlmZ d dPlmZ d dQlmZ d dRlmZ d dSlmZ d dTlmZ d dUlmZ d dVlmZ d dWlmZ d dXlmZ  G dY dZe      Zy)[    N)OrderedDict)DEFAULT_API_BASEDEFAULT_CONNECT_API_BASEDEFAULT_UPLOAD_API_BASEDEFAULT_METER_EVENTS_API_BASE)ApiMode)AuthenticationError)_APIRequestor)extract_options_from_dict)RequestorOptionsBaseAddresses)_ClientOptions)
HTTPClientnew_default_http_clientnew_http_client_async_fallback)_ApiVersion)StripeObject)StripeResponse)_convert_to_stripe_objectget_api_mode)WebhookWebhookSignature)Event)	ThinEvent)AnyDictOptionalUnioncast)OAuthService)AccountService)AccountLinkService)AccountSessionService)ApplePayDomainService)ApplicationFeeService)AppsService)BalanceService)BalanceTransactionService)BillingService)BillingPortalService)ChargeService)CheckoutService)ClimateService)ConfirmationTokenService)TestHelpersService)CountrySpecService)CouponService)CreditNoteService)CustomerService)CustomerSessionService)DisputeService)EntitlementsService)EphemeralKeyService)EventService)ExchangeRateService)FileService)FileLinkService)FinancialConnectionsService)ForwardingService)IdentityService)InvoiceService)InvoiceRenderingTemplateService)InvoiceItemService)IssuingService)MandateService)PaymentIntentService)PaymentLinkService)PaymentMethodService)!PaymentMethodConfigurationService)PaymentMethodDomainService)PayoutService)PlanService)PriceService)ProductService)PromotionCodeService)QuoteService)RadarService)RefundService)ReportingService)ReviewService)SigmaService)SetupAttemptService)SetupIntentService)ShippingRateService)SourceService)SubscriptionService)SubscriptionItemService)SubscriptionScheduleService)
TaxService)TaxCodeService)TaxIdService)TaxRateService)TerminalService)TokenService)TopupService)TransferService)TreasuryService)WebhookEndpointService)
V2Servicesc                   Z   e Zd Zdddi dddddd	dedee   dee   dee   ded	ee   d
edee   dee   dee   fdZ	e
j                  fdeeeef   dedededef
dZe
j                  fdeeef   dedededef
dZdedefdZdedefdZ	 ddeeeeef   f   deeeef      dedefdZy) StripeClientNT)	stripe_accountstripe_contextstripe_versionbase_addresses	client_idverify_ssl_certsproxymax_network_retrieshttp_clientapi_keyrh   ri   rj   rk   rl   rm   rn   ro   rp   c       	            |t        d      |
r|s|durt        d      t        t        t        t
        d|}t        ||||xs t        j                  ||	      }|
t        t        ||      ||      }
t        ||
      | _        t        |||	      | _        t        | j                  | j                        | _        t#        | j                        | _        t'        | j                        | _        t+        | j                        | _        t/        | j                        | _        t3        | j                        | _        t7        | j                        | _        t;        | j                        | _        t?        | j                        | _         tC        | j                        | _"        tG        | j                        | _$        tK        | j                        | _&        tO        | j                        | _(        tS        | j                        | _*        tW        | j                        | _,        t[        | j                        | _.        t_        | j                        | _0        tc        | j                        | _2        tg        | j                        | _4        tk        | j                        | _6        to        | j                        | _8        ts        | j                        | _:        tw        | j                        | _<        t{        | j                        | _>        t        | j                        | _@        t        | j                        | _B        t        | j                        | _D        t        | j                        | _F        t        | j                        | _H        t        | j                        | _J        t        | j                        | _L        t        | j                        | _N        t        | j                        | _P        t        | j                        | _R        t        | j                        | _T        t        | j                        | _V        t        | j                        | _X        t        | j                        | _Z        t        | j                        | _\        t        | j                        | _^        t        | j                        | _`        t        | j                        | _b        t        | j                        | _d        t        | j                        | _f        t        | j                        | _h        t        | j                        | _j        t        | j                        | _l        t        | j                        | _n        t        | j                        | _p        t        | j                        | _r        t        | j                        | _t        t        | j                        | _v        t        | j                        | _x        t        | j                        | _z        t        | j                        | _|        t        | j                        | _~        t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _        t#        | j                        | _        t'        | j                        | _        t+        | j                        | _        t/        | j                        | _        t3        | j                        | _        y )
NzNo API key provided. (HINT: set your API key using "client = stripe.StripeClient(<API-KEY>)"). You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.TzYou cannot specify `proxy` or `verify_ssl_certs` when passing in a custom `http_client`. Please set these values on your custom `http_client` instead.)apiconnectfilesmeter_events)rq   rh   ri   rj   rk   ro   )rn   rm   )async_fallback_clientrn   rm   )optionsclient)rl   rn   rm   )r	   
ValueErrorr   r   r   r   r   r   CURRENTr   r   r
   
_requestorr   _optionsr    oauthr!   accountsr"   account_linksr#   account_sessionsr$   apple_pay_domainsr%   application_feesr&   appsr'   balancer(   balance_transactionsr)   billingr*   billing_portalr+   chargesr,   checkoutr-   climater.   confirmation_tokensr/   test_helpersr0   country_specsr1   couponsr2   credit_notesr3   	customersr4   customer_sessionsr5   disputesr6   entitlementsr7   ephemeral_keysr8   eventsr9   exchange_ratesr:   ru   r;   
file_linksr<   financial_connectionsr=   
forwardingr>   identityr?   invoicesr@   invoice_rendering_templatesrA   invoice_itemsrB   issuingrC   mandatesrD   payment_intentsrE   payment_linksrF   payment_methodsrG   payment_method_configurationsrH   payment_method_domainsrI   payoutsrJ   plansrK   pricesrL   productsrM   promotion_codesrN   quotesrO   radarrP   refundsrQ   	reportingrR   reviewsrS   sigmarT   setup_attemptsrU   setup_intentsrV   shipping_ratesrW   sourcesrX   subscriptionsrY   subscription_itemsrZ   subscription_schedulesr[   taxr\   	tax_codesr]   tax_idsr^   	tax_ratesr_   terminalr`   tokensra   topupsrb   	transfersrc   treasuryrd   webhook_endpointsre   v2)selfrq   rh   ri   rj   rk   rl   rm   rn   ro   rp   requestor_optionss               T/var/www/html/AdoubleTech/venv/lib/python3.12/site-packages/stripe/_stripe_client.py__init__zStripeClient.__init__s   s{    ?%@  E%5T%A0  $/,9	

 
 -)))@[-@-@) 3
 1&D2B' !1K (%

 '-
 "$//4==A
 't7/@ 5doo F!6t!G 5doo F0	%doo6$=doo$N!%doo624??C$T__5'8%doo6#;DOO#L .t?/@$T__5-doo>(9!7!H&t7/@1$//B"4??31$//B 1
)$//:%@OO&
" ,DOO<'8&t7+JOO,
( 0@%doo6&t73DOOD/@3DOOD-NOO.
* 'AOO'
# %T__5 1
"4??3&t73DOOD"4??3!$//2
$T__5)$//:$T__5!$//2
1$//B/@1$//B$T__50A"9$//"J&AOO'
# doo.'8#DOO4'8'8"4??3"4??3(9'8!7!HT__-    raw
sig_headersecret	tolerancereturnc                     t        |d      r,t        t        t        t        f   |      j                  d      nt        t        |      }t        j                  ||||       t        |      S )Ndecodeutf-8)
hasattrr   r   bytes	bytearrayr   strr   verify_headerr   )r   r   r   r   r   payloads         r   parse_thin_eventzStripeClient.parse_thin_event  s^     sH% ui'(#.55g>c3 	 	&&w
FIN!!r   r   c                    t        |d      rt        t        |      j                  d      }t	        j
                  ||||       t        j                  |t              }t        j                  || j                  d      }|S )Nr   r   )object_pairs_hookV1)values	requestorapi_mode)r   r   r   r   r   r   jsonloadsr   r   _construct_fromr|   )r   r   r   r   r   dataevents          r   construct_eventzStripeClient.construct_event  sm     7H%5'*11':G&&w
FINzz'[A%%oo
 r   method_url_c           	         |j                         }t        |      \  }}t        |      }|j                  dd      }|j                  dd       }|@|j	                  di       |d<   t        |d   t              sJ |d   j                  d|i       | j                  j                  ||||||dg      \  }}	}
| j                  j                  ||	|
|      S )Nbasers   ri   headerszStripe-Contextraw_requestparamsrx   base_addressr   usage)copyr   r   popget
isinstancedictupdater|   request_raw_interpret_response)r   r   r   r   rx   r   r   ri   rbodyrcoderheaderss              r   r   zStripeClient.raw_request3  s    3F;%zz&%0$4d; %!(Y!;GIgi0$777I%%'7&HI!%!<!<% / "= "
uh 225(H
 	
r   c           	        K   |j                         }t        |      \  }}t        |      }|j                  dd      }| j                  j                  ||||||dg       d {   \  }}}	| j                  j                  |||	|      S 7 &w)Nr   rs   r   r   )r   r   r   r   r|   request_raw_asyncr   )
r   r   r   r   rx   r   r   r   r   r   s
             r   raw_request_asynczStripeClient.raw_request_asyncR  s     3F;%zz&%0'+'H'H% / (I (
 "
uh 225(H
 	
"
s   A"B$B%'Brespr   r   c                4    t        ||| j                  |      S )N)r   r   r   r   )r   r|   )r   r   r   r   s       r   deserializezStripeClient.deserializef  s!     )oo	
 	
r   )N)__name__
__module____qualname__r   r   r   boolintr   r   r   DEFAULT_TOLERANCEr   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r   r   rg   rg   r   s   
 )-(,(,(*#'!%#-1,0W.W. !	W.
 !W. !W. &W. C=W. W. }W. &c]W. j)W.~ !22"5#y()" " 	"
 " 
", !22ucz"  	
  
*
3 
c 
>
s 
# 
. ,0
NDcN23
 c3h(

 
 

r   rg   )r   collectionsr   striper   r   r   r   stripe._api_moder   stripe._errorr	   stripe._api_requestorr
   stripe._request_optionsr   stripe._requestor_optionsr   r   stripe._client_optionsr   stripe._http_clientr   r   r   stripe._api_versionr   stripe._stripe_objectr   stripe._stripe_responser   stripe._utilr   r   stripe._webhookr   r   stripe._eventr   stripe.v2._eventr   typingr   r   r   r   r   stripe._oauth_servicer    stripe._account_servicer!   stripe._account_link_servicer"   stripe._account_session_servicer#    stripe._apple_pay_domain_servicer$   stripe._application_fee_servicer%   stripe._apps_servicer&   stripe._balance_servicer'   #stripe._balance_transaction_servicer(   stripe._billing_servicer)   stripe._billing_portal_servicer*   stripe._charge_servicer+   stripe._checkout_servicer,   stripe._climate_servicer-   "stripe._confirmation_token_servicer.   stripe._test_helpers_servicer/   stripe._country_spec_servicer0   stripe._coupon_servicer1   stripe._credit_note_servicer2   stripe._customer_servicer3    stripe._customer_session_servicer4   stripe._dispute_servicer5   stripe._entitlements_servicer6   stripe._ephemeral_key_servicer7   stripe._event_servicer8   stripe._exchange_rate_servicer9   stripe._file_servicer:   stripe._file_link_servicer;   %stripe._financial_connections_servicer<   stripe._forwarding_servicer=   stripe._identity_servicer>   stripe._invoice_servicer?   *stripe._invoice_rendering_template_servicer@   stripe._invoice_item_servicerA   stripe._issuing_servicerB   stripe._mandate_servicerC   stripe._payment_intent_servicerD   stripe._payment_link_servicerE   stripe._payment_method_servicerF   ,stripe._payment_method_configuration_servicerG   %stripe._payment_method_domain_servicerH   stripe._payout_servicerI   stripe._plan_servicerJ   stripe._price_servicerK   stripe._product_servicerL   stripe._promotion_code_servicerM   stripe._quote_servicerN   stripe._radar_servicerO   stripe._refund_servicerP   stripe._reporting_servicerQ   stripe._review_servicerR   stripe._sigma_servicerS   stripe._setup_attempt_servicerT   stripe._setup_intent_servicerU   stripe._shipping_rate_servicerV   stripe._source_servicerW   stripe._subscription_servicerX   !stripe._subscription_item_servicerY   %stripe._subscription_schedule_servicerZ   stripe._tax_servicer[   stripe._tax_code_servicer\   stripe._tax_id_servicer]   stripe._tax_rate_servicer^   stripe._terminal_servicer_   stripe._token_servicer`   stripe._topup_servicera   stripe._transfer_servicerb   stripe._treasury_servicerc    stripe._webhook_endpoint_servicerd   stripe._v2_servicesre   objectrg   r  r   r   <module>r]     s?    #  % - / = E 1 
 , . 2 @ 5  & 3 3 / 3 ; A B A , 2 I 2 ? 0 4 2 G ; ; 0 9 4 C 2 < = . = , 5 M 8 4 2 < 2 2 ? ; ? M 0 , . 2 ? . . 0 6 0 . = ; = 0 < E M * 3 / 3 4 . . 4 4 C *@
6 @
r   