gr4vy 1.10.12__py3-none-any.whl → 1.10.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gr4vy/_version.py +3 -3
- gr4vy/basesdk.py +20 -6
- gr4vy/models/__init__.py +132 -0
- gr4vy/models/accountsreceivablesreportspec.py +18 -1
- gr4vy/models/accountupdaterinquirysummary.py +18 -1
- gr4vy/models/accountupdaterjob.py +18 -1
- gr4vy/models/accountupdateroptions.py +30 -31
- gr4vy/models/add_buyer_shipping_detailsop.py +34 -1
- gr4vy/models/add_buyerop.py +34 -1
- gr4vy/models/add_payment_linkop.py +34 -1
- gr4vy/models/add_reportop.py +34 -1
- gr4vy/models/address.py +38 -39
- gr4vy/models/adyencardoptions.py +32 -33
- gr4vy/models/adyenoptions.py +14 -19
- gr4vy/models/adyensepaoptions.py +30 -31
- gr4vy/models/adyensplitsoptions.py +14 -19
- gr4vy/models/affirmitineraryoptions.py +34 -35
- gr4vy/models/affirmoptions.py +14 -19
- gr4vy/models/airline.py +58 -59
- gr4vy/models/airlineleg.py +66 -67
- gr4vy/models/airlinepassenger.py +42 -43
- gr4vy/models/applepaypaymentmethodcreate.py +34 -35
- gr4vy/models/auditlogentries.py +14 -19
- gr4vy/models/auditlogentry.py +14 -19
- gr4vy/models/auditlogentryuser.py +14 -19
- gr4vy/models/billingdetails.py +32 -33
- gr4vy/models/braintreedynamicdatafieldsoptions.py +26 -27
- gr4vy/models/braintreeoptions.py +18 -19
- gr4vy/models/browserinfo.py +14 -19
- gr4vy/models/buyer.py +31 -32
- gr4vy/models/buyercreate.py +18 -29
- gr4vy/models/buyers.py +14 -19
- gr4vy/models/buyerupdate.py +18 -29
- gr4vy/models/cancel_transactionop.py +34 -1
- gr4vy/models/capture_transactionop.py +30 -19
- gr4vy/models/cardpaymentmethodcreate.py +31 -32
- gr4vy/models/cardschemedefinition.py +18 -1
- gr4vy/models/cardwithurlpaymentmethodcreate.py +33 -34
- gr4vy/models/cartitem.py +52 -53
- gr4vy/models/chaseoptions.py +14 -19
- gr4vy/models/checkoutsession.py +37 -38
- gr4vy/models/checkoutsessioncreate.py +35 -36
- gr4vy/models/checkoutsessionpaymentmethod.py +16 -27
- gr4vy/models/checkoutsessionpaymentmethodcreate.py +18 -28
- gr4vy/models/checkoutsessionpaymentmethoddetails.py +14 -19
- gr4vy/models/checkoutsessionwithurlpaymentmethodcreate.py +29 -30
- gr4vy/models/clicktopayfpanpaymentmethodcreate.py +32 -33
- gr4vy/models/clicktopaypaymentmethodcreate.py +28 -29
- gr4vy/models/configure_digital_walletop.py +34 -1
- gr4vy/models/create_account_updater_jobop.py +34 -1
- gr4vy/models/create_apple_pay_digital_wallet_sessionop.py +34 -1
- gr4vy/models/create_checkout_sessionop.py +34 -1
- gr4vy/models/create_full_transaction_refundop.py +30 -19
- gr4vy/models/create_gift_cardop.py +34 -1
- gr4vy/models/create_google_pay_digital_wallet_sessionop.py +34 -1
- gr4vy/models/create_payment_method_network_token_cryptogramop.py +34 -1
- gr4vy/models/create_payment_method_network_tokenop.py +34 -1
- gr4vy/models/create_payment_method_payment_service_tokenop.py +34 -1
- gr4vy/models/create_payment_methodop.py +34 -1
- gr4vy/models/create_payment_service_sessionop.py +34 -1
- gr4vy/models/create_payment_serviceop.py +34 -1
- gr4vy/models/create_payoutop.py +34 -1
- gr4vy/models/create_report_execution_urlop.py +34 -1
- gr4vy/models/create_three_ds_scenarioop.py +79 -0
- gr4vy/models/create_transaction_refundop.py +34 -1
- gr4vy/models/create_transactionop.py +32 -19
- gr4vy/models/createsession.py +14 -19
- gr4vy/models/cryptogram.py +18 -1
- gr4vy/models/cybersourceantifraudoptions.py +18 -27
- gr4vy/models/cybersourceoptions.py +27 -28
- gr4vy/models/delete_buyer_shipping_detailsop.py +34 -1
- gr4vy/models/delete_buyerop.py +34 -1
- gr4vy/models/delete_checkout_sessionop.py +34 -1
- gr4vy/models/delete_digital_walletop.py +34 -1
- gr4vy/models/delete_gift_cardop.py +34 -1
- gr4vy/models/delete_payment_method_network_tokenop.py +34 -1
- gr4vy/models/delete_payment_method_payment_service_tokenop.py +34 -1
- gr4vy/models/delete_payment_methodop.py +34 -1
- gr4vy/models/delete_payment_serviceop.py +34 -1
- gr4vy/models/delete_three_ds_scenarioop.py +76 -0
- gr4vy/models/detailedsettlementreportspec.py +18 -1
- gr4vy/models/digitalwallet.py +27 -33
- gr4vy/models/digitalwalletcreate.py +23 -28
- gr4vy/models/digitalwalletupdate.py +30 -31
- gr4vy/models/dlocaloptions.py +14 -19
- gr4vy/models/dlocalupioptions.py +14 -19
- gr4vy/models/dlocalupiwalletoptions.py +18 -33
- gr4vy/models/dlocalwalletoptions.py +14 -19
- gr4vy/models/expire_payment_linkop.py +34 -1
- gr4vy/models/fiservinstallmentoptions.py +27 -28
- gr4vy/models/fiservoptions.py +14 -19
- gr4vy/models/forterantifraudoptions.py +30 -31
- gr4vy/models/forterantifraudoptionscartitem.py +13 -18
- gr4vy/models/forterantifraudoptionscartitembasicitemdata.py +14 -19
- gr4vy/models/forterantifraudoptionscartitembeneficiary.py +13 -18
- gr4vy/models/forterantifraudoptionscartitembeneficiaryaddress.py +18 -19
- gr4vy/models/forterantifraudoptionscartitembeneficiarycomments.py +18 -27
- gr4vy/models/forterantifraudoptionscartitembeneficiarypersonaldetails.py +14 -19
- gr4vy/models/forterantifraudoptionscartitemdeliverydetails.py +13 -18
- gr4vy/models/forterantifraudoptionsdiscount.py +13 -18
- gr4vy/models/forterantifraudoptionsdiscountcoupondiscountamount.py +14 -19
- gr4vy/models/get_buyer_shipping_detailsop.py +34 -1
- gr4vy/models/get_buyerop.py +34 -1
- gr4vy/models/get_checkout_sessionop.py +34 -1
- gr4vy/models/get_digital_walletop.py +34 -1
- gr4vy/models/get_gift_cardop.py +34 -1
- gr4vy/models/get_payment_linkop.py +34 -1
- gr4vy/models/get_payment_methodop.py +34 -1
- gr4vy/models/get_payment_serviceop.py +34 -1
- gr4vy/models/get_payoutop.py +34 -1
- gr4vy/models/get_refundop.py +34 -1
- gr4vy/models/get_report_executionop.py +34 -1
- gr4vy/models/get_reportop.py +34 -1
- gr4vy/models/get_three_ds_scenarioop.py +105 -0
- gr4vy/models/get_transaction_refundop.py +34 -1
- gr4vy/models/get_transaction_settlementop.py +34 -1
- gr4vy/models/get_transactionop.py +34 -1
- gr4vy/models/giftcard.py +14 -19
- gr4vy/models/giftcardcreate.py +14 -19
- gr4vy/models/giftcardredemption.py +29 -30
- gr4vy/models/giftcards.py +14 -19
- gr4vy/models/giftcardservice.py +18 -1
- gr4vy/models/giftcardsummary.py +35 -36
- gr4vy/models/givingblockoptions.py +14 -19
- gr4vy/models/googlepayassurancedetails.py +14 -19
- gr4vy/models/googlepayfpanpaymentmethodcreate.py +32 -33
- gr4vy/models/googlepaypaymentmethodcreate.py +36 -37
- gr4vy/models/guestbuyer.py +30 -31
- gr4vy/models/internal/globals.py +18 -1
- gr4vy/models/latitudeoptions.py +14 -19
- gr4vy/models/list_all_report_executionsop.py +50 -35
- gr4vy/models/list_audit_logsop.py +39 -26
- gr4vy/models/list_buyer_gift_cardsop.py +32 -23
- gr4vy/models/list_buyer_payment_methodsop.py +42 -33
- gr4vy/models/list_buyer_shipping_detailsop.py +34 -1
- gr4vy/models/list_buyersop.py +32 -25
- gr4vy/models/list_card_scheme_definitionsop.py +34 -1
- gr4vy/models/list_digital_walletsop.py +34 -1
- gr4vy/models/list_gift_card_balancesop.py +34 -1
- gr4vy/models/list_gift_cardsop.py +38 -25
- gr4vy/models/list_merchant_accountsop.py +14 -19
- gr4vy/models/list_payment_linksop.py +32 -19
- gr4vy/models/list_payment_method_network_tokensop.py +34 -1
- gr4vy/models/list_payment_method_payment_service_tokensop.py +30 -19
- gr4vy/models/list_payment_methodsop.py +48 -33
- gr4vy/models/list_payment_optionsop.py +34 -1
- gr4vy/models/list_payment_service_definitionsop.py +14 -19
- gr4vy/models/list_payment_servicesop.py +32 -25
- gr4vy/models/list_payoutsop.py +30 -19
- gr4vy/models/list_report_executionsop.py +30 -19
- gr4vy/models/list_reportsop.py +39 -26
- gr4vy/models/list_transaction_actionsop.py +34 -1
- gr4vy/models/list_transaction_eventsop.py +30 -19
- gr4vy/models/list_transaction_refundsop.py +34 -1
- gr4vy/models/list_transaction_settlementsop.py +34 -1
- gr4vy/models/list_transactionsop.py +124 -109
- gr4vy/models/mattildatapioptions.py +14 -19
- gr4vy/models/merchantaccount.py +52 -53
- gr4vy/models/merchantaccountcreate.py +52 -53
- gr4vy/models/merchantaccounts.py +14 -19
- gr4vy/models/merchantaccountupdate.py +54 -55
- gr4vy/models/mockcardmerchantadvicecodeoptions.py +14 -19
- gr4vy/models/mockcardoptions.py +14 -19
- gr4vy/models/networktoken.py +18 -1
- gr4vy/models/networktokencreate.py +14 -19
- gr4vy/models/networktokenpaymentmethodcreate.py +34 -35
- gr4vy/models/nuveiairlinedataoptions.py +14 -19
- gr4vy/models/nuveiidealoptions.py +14 -19
- gr4vy/models/nuveioptions.py +14 -19
- gr4vy/models/nuveipseoptions.py +13 -18
- gr4vy/models/oxxooptions.py +14 -19
- gr4vy/models/paymentlink.py +59 -60
- gr4vy/models/paymentlinkcreate.py +59 -60
- gr4vy/models/paymentlinks.py +14 -19
- gr4vy/models/paymentmethod.py +51 -52
- gr4vy/models/paymentmethodcard.py +14 -19
- gr4vy/models/paymentmethoddetailscard.py +14 -19
- gr4vy/models/paymentmethods.py +14 -19
- gr4vy/models/paymentmethodstoredcard.py +18 -1
- gr4vy/models/paymentmethodsummary.py +47 -48
- gr4vy/models/paymentoption.py +14 -19
- gr4vy/models/paymentoptioncontext.py +14 -19
- gr4vy/models/paymentoptioncontextapprovalui.py +14 -19
- gr4vy/models/paymentoptionrequest.py +18 -26
- gr4vy/models/paymentservice.py +35 -36
- gr4vy/models/paymentservicecreate.py +36 -37
- gr4vy/models/paymentservicedefinition.py +14 -19
- gr4vy/models/paymentservicedefinitions.py +14 -19
- gr4vy/models/paymentservices.py +14 -19
- gr4vy/models/paymentservicetoken.py +14 -19
- gr4vy/models/paymentservicetokencreate.py +14 -19
- gr4vy/models/paymentserviceupdate.py +45 -46
- gr4vy/models/payoutconnectionoptions.py +14 -19
- gr4vy/models/payoutcreate.py +34 -35
- gr4vy/models/payoutmerchant.py +14 -19
- gr4vy/models/payoutmerchantsummary.py +14 -19
- gr4vy/models/payoutpaymentservice.py +14 -19
- gr4vy/models/payoutsummaries.py +14 -19
- gr4vy/models/payoutsummary.py +35 -36
- gr4vy/models/paypaloptions.py +14 -19
- gr4vy/models/paypalshippingoptions.py +14 -19
- gr4vy/models/paypalshippingoptionsitem.py +14 -19
- gr4vy/models/plaidpaymentmethodcreate.py +31 -32
- gr4vy/models/powertranzoptions.py +14 -19
- gr4vy/models/recipient.py +14 -19
- gr4vy/models/redirectpaymentmethodcreate.py +18 -27
- gr4vy/models/refund.py +39 -40
- gr4vy/models/refunds.py +14 -19
- gr4vy/models/register_digital_wallet_domainop.py +34 -1
- gr4vy/models/report.py +33 -34
- gr4vy/models/reportcreate.py +14 -19
- gr4vy/models/reportexecution.py +18 -1
- gr4vy/models/reportexecutions.py +14 -19
- gr4vy/models/reportexecutionsummary.py +18 -1
- gr4vy/models/reportexecutionurlgenerate.py +18 -1
- gr4vy/models/reports.py +14 -19
- gr4vy/models/reportsummary.py +16 -19
- gr4vy/models/reportupdate.py +14 -19
- gr4vy/models/requiredcheckoutfields.py +14 -19
- gr4vy/models/resume_payment_method_network_tokenop.py +34 -1
- gr4vy/models/security.py +18 -1
- gr4vy/models/settlement.py +16 -25
- gr4vy/models/shippingdetails.py +35 -36
- gr4vy/models/shippingdetailscreate.py +18 -31
- gr4vy/models/shippingdetailsupdate.py +18 -31
- gr4vy/models/statementdescriptor.py +34 -35
- gr4vy/models/stripeconnectoptions.py +30 -31
- gr4vy/models/stripeoptions.py +14 -19
- gr4vy/models/suspend_payment_method_network_tokenop.py +34 -1
- gr4vy/models/sync_transactionop.py +34 -1
- gr4vy/models/threedsecure.py +14 -19
- gr4vy/models/threedsecuredatav1.py +14 -19
- gr4vy/models/threedsecuredatav2.py +14 -19
- gr4vy/models/threedsecureerror.py +14 -19
- gr4vy/models/threedsecurescenario.py +77 -0
- gr4vy/models/threedsecurescenarioconditions.py +84 -0
- gr4vy/models/threedsecurescenariocreate.py +24 -0
- gr4vy/models/threedsecurescenariooutcome.py +57 -0
- gr4vy/models/threedsecurescenariooutcomeauthentication.py +31 -0
- gr4vy/models/threedsecurescenariooutcomeresult.py +27 -0
- gr4vy/models/threedsecurescenarios.py +58 -0
- gr4vy/models/threedsecurescenarioupdate.py +54 -0
- gr4vy/models/threedsecurev2.py +34 -35
- gr4vy/models/tokenpaymentmethodcreate.py +14 -19
- gr4vy/models/transaction.py +111 -112
- gr4vy/models/transactionaction.py +18 -1
- gr4vy/models/transactionbuyer.py +31 -32
- gr4vy/models/transactioncancel.py +14 -19
- gr4vy/models/transactioncapture.py +14 -19
- gr4vy/models/transactioncapturecreate.py +14 -19
- gr4vy/models/transactionconnectionoptions.py +104 -105
- gr4vy/models/transactioncreate.py +88 -89
- gr4vy/models/transactionevent.py +18 -1
- gr4vy/models/transactionevents.py +14 -19
- gr4vy/models/transactiongiftcard.py +14 -19
- gr4vy/models/transactionpaymentmethod.py +49 -50
- gr4vy/models/transactionpaymentservice.py +18 -1
- gr4vy/models/transactionrefundallcreate.py +14 -19
- gr4vy/models/transactionrefundcreate.py +16 -25
- gr4vy/models/transactionretriesreportspec.py +18 -1
- gr4vy/models/transactionsreportspec.py +18 -1
- gr4vy/models/transactionsummaries.py +14 -19
- gr4vy/models/transactionsummary.py +50 -51
- gr4vy/models/transactionthreedsecuresummary.py +18 -33
- gr4vy/models/transactionupdate.py +14 -19
- gr4vy/models/transactionvoid.py +14 -19
- gr4vy/models/travelhubcustomdata.py +14 -19
- gr4vy/models/travelhuboptions.py +14 -19
- gr4vy/models/trustlyoptions.py +14 -19
- gr4vy/models/unregister_digital_wallet_domainop.py +34 -1
- gr4vy/models/update_buyer_shipping_detailsop.py +34 -1
- gr4vy/models/update_buyerop.py +34 -1
- gr4vy/models/update_checkout_sessionop.py +34 -1
- gr4vy/models/update_digital_walletop.py +34 -1
- gr4vy/models/update_payment_serviceop.py +34 -1
- gr4vy/models/update_reportop.py +34 -1
- gr4vy/models/update_three_ds_scenarioop.py +91 -0
- gr4vy/models/update_transactionop.py +34 -1
- gr4vy/models/verify_payment_service_credentialsop.py +34 -1
- gr4vy/models/verifycredentials.py +14 -19
- gr4vy/models/void_transactionop.py +30 -19
- gr4vy/models/wpayeverdaypayoptions.py +30 -31
- gr4vy/models/wpaypaytooptions.py +14 -19
- gr4vy/models/wpaypaytoresourceoptions.py +14 -19
- gr4vy/models/wpaypaytosimulationoptions.py +14 -19
- gr4vy/sdk.py +3 -0
- gr4vy/three_ds_scenarios.py +1322 -0
- gr4vy/utils/__init__.py +13 -1
- {gr4vy-1.10.12.dist-info → gr4vy-1.10.14.dist-info}/METADATA +8 -1
- gr4vy-1.10.14.dist-info/RECORD +464 -0
- gr4vy-1.10.12.dist-info/RECORD +0 -451
- {gr4vy-1.10.12.dist-info → gr4vy-1.10.14.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,1322 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from gr4vy import errors, models, utils
|
|
5
|
+
from gr4vy._hooks import HookContext
|
|
6
|
+
from gr4vy.types import OptionalNullable, UNSET
|
|
7
|
+
from gr4vy.utils import get_security_from_env
|
|
8
|
+
from gr4vy.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from jsonpath import JSONPath
|
|
10
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ThreeDsScenarios(BaseSDK):
|
|
14
|
+
def create(
|
|
15
|
+
self,
|
|
16
|
+
*,
|
|
17
|
+
conditions: Union[
|
|
18
|
+
models.ThreeDSecureScenarioConditions,
|
|
19
|
+
models.ThreeDSecureScenarioConditionsTypedDict,
|
|
20
|
+
],
|
|
21
|
+
outcome: Union[
|
|
22
|
+
models.ThreeDSecureScenarioOutcome,
|
|
23
|
+
models.ThreeDSecureScenarioOutcomeTypedDict,
|
|
24
|
+
],
|
|
25
|
+
merchant_account_id: Optional[str] = None,
|
|
26
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
27
|
+
server_url: Optional[str] = None,
|
|
28
|
+
timeout_ms: Optional[int] = None,
|
|
29
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
30
|
+
) -> models.ThreeDSecureScenario:
|
|
31
|
+
r"""Create a 3DS scenario
|
|
32
|
+
|
|
33
|
+
Create a new 3DS scenario for a merchant account. Only available in sandbox environments.
|
|
34
|
+
|
|
35
|
+
:param conditions:
|
|
36
|
+
:param outcome:
|
|
37
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
38
|
+
:param retries: Override the default retry configuration for this method
|
|
39
|
+
:param server_url: Override the default server URL for this method
|
|
40
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
41
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
42
|
+
"""
|
|
43
|
+
base_url = None
|
|
44
|
+
url_variables = None
|
|
45
|
+
if timeout_ms is None:
|
|
46
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
47
|
+
|
|
48
|
+
if server_url is not None:
|
|
49
|
+
base_url = server_url
|
|
50
|
+
else:
|
|
51
|
+
base_url = self._get_url(base_url, url_variables)
|
|
52
|
+
|
|
53
|
+
request = models.CreateThreeDsScenarioRequest(
|
|
54
|
+
merchant_account_id=merchant_account_id,
|
|
55
|
+
three_d_secure_scenario_create=models.ThreeDSecureScenarioCreate(
|
|
56
|
+
conditions=utils.get_pydantic_model(
|
|
57
|
+
conditions, models.ThreeDSecureScenarioConditions
|
|
58
|
+
),
|
|
59
|
+
outcome=utils.get_pydantic_model(
|
|
60
|
+
outcome, models.ThreeDSecureScenarioOutcome
|
|
61
|
+
),
|
|
62
|
+
),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
req = self._build_request(
|
|
66
|
+
method="POST",
|
|
67
|
+
path="/three-ds-scenarios",
|
|
68
|
+
base_url=base_url,
|
|
69
|
+
url_variables=url_variables,
|
|
70
|
+
request=request,
|
|
71
|
+
request_body_required=True,
|
|
72
|
+
request_has_path_params=False,
|
|
73
|
+
request_has_query_params=True,
|
|
74
|
+
user_agent_header="user-agent",
|
|
75
|
+
accept_header_value="application/json",
|
|
76
|
+
http_headers=http_headers,
|
|
77
|
+
_globals=models.CreateThreeDsScenarioGlobals(
|
|
78
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
79
|
+
),
|
|
80
|
+
security=self.sdk_configuration.security,
|
|
81
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
82
|
+
request.three_d_secure_scenario_create,
|
|
83
|
+
False,
|
|
84
|
+
False,
|
|
85
|
+
"json",
|
|
86
|
+
models.ThreeDSecureScenarioCreate,
|
|
87
|
+
),
|
|
88
|
+
allow_empty_value=None,
|
|
89
|
+
timeout_ms=timeout_ms,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
if retries == UNSET:
|
|
93
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
94
|
+
retries = self.sdk_configuration.retry_config
|
|
95
|
+
|
|
96
|
+
retry_config = None
|
|
97
|
+
if isinstance(retries, utils.RetryConfig):
|
|
98
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
99
|
+
|
|
100
|
+
http_res = self.do_request(
|
|
101
|
+
hook_ctx=HookContext(
|
|
102
|
+
config=self.sdk_configuration,
|
|
103
|
+
base_url=base_url or "",
|
|
104
|
+
operation_id="create_three_ds_scenario",
|
|
105
|
+
oauth2_scopes=None,
|
|
106
|
+
security_source=get_security_from_env(
|
|
107
|
+
self.sdk_configuration.security, models.Security
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
request=req,
|
|
111
|
+
error_status_codes=[
|
|
112
|
+
"400",
|
|
113
|
+
"401",
|
|
114
|
+
"403",
|
|
115
|
+
"404",
|
|
116
|
+
"405",
|
|
117
|
+
"409",
|
|
118
|
+
"422",
|
|
119
|
+
"425",
|
|
120
|
+
"429",
|
|
121
|
+
"4XX",
|
|
122
|
+
"500",
|
|
123
|
+
"502",
|
|
124
|
+
"504",
|
|
125
|
+
"5XX",
|
|
126
|
+
],
|
|
127
|
+
retry_config=retry_config,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
response_data: Any = None
|
|
131
|
+
if utils.match_response(http_res, "201", "application/json"):
|
|
132
|
+
return unmarshal_json_response(models.ThreeDSecureScenario, http_res)
|
|
133
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
134
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
135
|
+
raise errors.Error400(response_data, http_res)
|
|
136
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
137
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
138
|
+
raise errors.Error401(response_data, http_res)
|
|
139
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
140
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
141
|
+
raise errors.Error403(response_data, http_res)
|
|
142
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
143
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
144
|
+
raise errors.Error404(response_data, http_res)
|
|
145
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
146
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
147
|
+
raise errors.Error405(response_data, http_res)
|
|
148
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
149
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
150
|
+
raise errors.Error409(response_data, http_res)
|
|
151
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
152
|
+
response_data = unmarshal_json_response(
|
|
153
|
+
errors.HTTPValidationErrorData, http_res
|
|
154
|
+
)
|
|
155
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
156
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
157
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
158
|
+
raise errors.Error425(response_data, http_res)
|
|
159
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
160
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
161
|
+
raise errors.Error429(response_data, http_res)
|
|
162
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
163
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
164
|
+
raise errors.Error500(response_data, http_res)
|
|
165
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
166
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
167
|
+
raise errors.Error502(response_data, http_res)
|
|
168
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
169
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
170
|
+
raise errors.Error504(response_data, http_res)
|
|
171
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
172
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
173
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
174
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
175
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
176
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
177
|
+
|
|
178
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
179
|
+
|
|
180
|
+
async def create_async(
|
|
181
|
+
self,
|
|
182
|
+
*,
|
|
183
|
+
conditions: Union[
|
|
184
|
+
models.ThreeDSecureScenarioConditions,
|
|
185
|
+
models.ThreeDSecureScenarioConditionsTypedDict,
|
|
186
|
+
],
|
|
187
|
+
outcome: Union[
|
|
188
|
+
models.ThreeDSecureScenarioOutcome,
|
|
189
|
+
models.ThreeDSecureScenarioOutcomeTypedDict,
|
|
190
|
+
],
|
|
191
|
+
merchant_account_id: Optional[str] = None,
|
|
192
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
193
|
+
server_url: Optional[str] = None,
|
|
194
|
+
timeout_ms: Optional[int] = None,
|
|
195
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
196
|
+
) -> models.ThreeDSecureScenario:
|
|
197
|
+
r"""Create a 3DS scenario
|
|
198
|
+
|
|
199
|
+
Create a new 3DS scenario for a merchant account. Only available in sandbox environments.
|
|
200
|
+
|
|
201
|
+
:param conditions:
|
|
202
|
+
:param outcome:
|
|
203
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
204
|
+
:param retries: Override the default retry configuration for this method
|
|
205
|
+
:param server_url: Override the default server URL for this method
|
|
206
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
207
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
208
|
+
"""
|
|
209
|
+
base_url = None
|
|
210
|
+
url_variables = None
|
|
211
|
+
if timeout_ms is None:
|
|
212
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
213
|
+
|
|
214
|
+
if server_url is not None:
|
|
215
|
+
base_url = server_url
|
|
216
|
+
else:
|
|
217
|
+
base_url = self._get_url(base_url, url_variables)
|
|
218
|
+
|
|
219
|
+
request = models.CreateThreeDsScenarioRequest(
|
|
220
|
+
merchant_account_id=merchant_account_id,
|
|
221
|
+
three_d_secure_scenario_create=models.ThreeDSecureScenarioCreate(
|
|
222
|
+
conditions=utils.get_pydantic_model(
|
|
223
|
+
conditions, models.ThreeDSecureScenarioConditions
|
|
224
|
+
),
|
|
225
|
+
outcome=utils.get_pydantic_model(
|
|
226
|
+
outcome, models.ThreeDSecureScenarioOutcome
|
|
227
|
+
),
|
|
228
|
+
),
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
req = self._build_request_async(
|
|
232
|
+
method="POST",
|
|
233
|
+
path="/three-ds-scenarios",
|
|
234
|
+
base_url=base_url,
|
|
235
|
+
url_variables=url_variables,
|
|
236
|
+
request=request,
|
|
237
|
+
request_body_required=True,
|
|
238
|
+
request_has_path_params=False,
|
|
239
|
+
request_has_query_params=True,
|
|
240
|
+
user_agent_header="user-agent",
|
|
241
|
+
accept_header_value="application/json",
|
|
242
|
+
http_headers=http_headers,
|
|
243
|
+
_globals=models.CreateThreeDsScenarioGlobals(
|
|
244
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
245
|
+
),
|
|
246
|
+
security=self.sdk_configuration.security,
|
|
247
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
248
|
+
request.three_d_secure_scenario_create,
|
|
249
|
+
False,
|
|
250
|
+
False,
|
|
251
|
+
"json",
|
|
252
|
+
models.ThreeDSecureScenarioCreate,
|
|
253
|
+
),
|
|
254
|
+
allow_empty_value=None,
|
|
255
|
+
timeout_ms=timeout_ms,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
if retries == UNSET:
|
|
259
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
260
|
+
retries = self.sdk_configuration.retry_config
|
|
261
|
+
|
|
262
|
+
retry_config = None
|
|
263
|
+
if isinstance(retries, utils.RetryConfig):
|
|
264
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
265
|
+
|
|
266
|
+
http_res = await self.do_request_async(
|
|
267
|
+
hook_ctx=HookContext(
|
|
268
|
+
config=self.sdk_configuration,
|
|
269
|
+
base_url=base_url or "",
|
|
270
|
+
operation_id="create_three_ds_scenario",
|
|
271
|
+
oauth2_scopes=None,
|
|
272
|
+
security_source=get_security_from_env(
|
|
273
|
+
self.sdk_configuration.security, models.Security
|
|
274
|
+
),
|
|
275
|
+
),
|
|
276
|
+
request=req,
|
|
277
|
+
error_status_codes=[
|
|
278
|
+
"400",
|
|
279
|
+
"401",
|
|
280
|
+
"403",
|
|
281
|
+
"404",
|
|
282
|
+
"405",
|
|
283
|
+
"409",
|
|
284
|
+
"422",
|
|
285
|
+
"425",
|
|
286
|
+
"429",
|
|
287
|
+
"4XX",
|
|
288
|
+
"500",
|
|
289
|
+
"502",
|
|
290
|
+
"504",
|
|
291
|
+
"5XX",
|
|
292
|
+
],
|
|
293
|
+
retry_config=retry_config,
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
response_data: Any = None
|
|
297
|
+
if utils.match_response(http_res, "201", "application/json"):
|
|
298
|
+
return unmarshal_json_response(models.ThreeDSecureScenario, http_res)
|
|
299
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
300
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
301
|
+
raise errors.Error400(response_data, http_res)
|
|
302
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
303
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
304
|
+
raise errors.Error401(response_data, http_res)
|
|
305
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
306
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
307
|
+
raise errors.Error403(response_data, http_res)
|
|
308
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
309
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
310
|
+
raise errors.Error404(response_data, http_res)
|
|
311
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
312
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
313
|
+
raise errors.Error405(response_data, http_res)
|
|
314
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
315
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
316
|
+
raise errors.Error409(response_data, http_res)
|
|
317
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
318
|
+
response_data = unmarshal_json_response(
|
|
319
|
+
errors.HTTPValidationErrorData, http_res
|
|
320
|
+
)
|
|
321
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
322
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
323
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
324
|
+
raise errors.Error425(response_data, http_res)
|
|
325
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
326
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
327
|
+
raise errors.Error429(response_data, http_res)
|
|
328
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
329
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
330
|
+
raise errors.Error500(response_data, http_res)
|
|
331
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
332
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
333
|
+
raise errors.Error502(response_data, http_res)
|
|
334
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
335
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
336
|
+
raise errors.Error504(response_data, http_res)
|
|
337
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
338
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
339
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
340
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
341
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
342
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
343
|
+
|
|
344
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
345
|
+
|
|
346
|
+
def list(
|
|
347
|
+
self,
|
|
348
|
+
*,
|
|
349
|
+
cursor: OptionalNullable[str] = UNSET,
|
|
350
|
+
limit: Optional[int] = 20,
|
|
351
|
+
merchant_account_id: Optional[str] = None,
|
|
352
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
353
|
+
server_url: Optional[str] = None,
|
|
354
|
+
timeout_ms: Optional[int] = None,
|
|
355
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
356
|
+
) -> Optional[models.GetThreeDsScenarioResponse]:
|
|
357
|
+
r"""List 3DS scenario
|
|
358
|
+
|
|
359
|
+
List all 3DS scenarios for a merchant account. Only available in sandbox environments.
|
|
360
|
+
|
|
361
|
+
:param cursor: A pointer to the page of results to return.
|
|
362
|
+
:param limit: The maximum number of items that are at returned.
|
|
363
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
364
|
+
:param retries: Override the default retry configuration for this method
|
|
365
|
+
:param server_url: Override the default server URL for this method
|
|
366
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
367
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
368
|
+
"""
|
|
369
|
+
base_url = None
|
|
370
|
+
url_variables = None
|
|
371
|
+
if timeout_ms is None:
|
|
372
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
373
|
+
|
|
374
|
+
if server_url is not None:
|
|
375
|
+
base_url = server_url
|
|
376
|
+
else:
|
|
377
|
+
base_url = self._get_url(base_url, url_variables)
|
|
378
|
+
|
|
379
|
+
request = models.GetThreeDsScenarioRequest(
|
|
380
|
+
cursor=cursor,
|
|
381
|
+
limit=limit,
|
|
382
|
+
merchant_account_id=merchant_account_id,
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
req = self._build_request(
|
|
386
|
+
method="GET",
|
|
387
|
+
path="/three-ds-scenarios",
|
|
388
|
+
base_url=base_url,
|
|
389
|
+
url_variables=url_variables,
|
|
390
|
+
request=request,
|
|
391
|
+
request_body_required=False,
|
|
392
|
+
request_has_path_params=False,
|
|
393
|
+
request_has_query_params=True,
|
|
394
|
+
user_agent_header="user-agent",
|
|
395
|
+
accept_header_value="application/json",
|
|
396
|
+
http_headers=http_headers,
|
|
397
|
+
_globals=models.GetThreeDsScenarioGlobals(
|
|
398
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
399
|
+
),
|
|
400
|
+
security=self.sdk_configuration.security,
|
|
401
|
+
allow_empty_value=None,
|
|
402
|
+
timeout_ms=timeout_ms,
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
if retries == UNSET:
|
|
406
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
407
|
+
retries = self.sdk_configuration.retry_config
|
|
408
|
+
else:
|
|
409
|
+
retries = utils.RetryConfig(
|
|
410
|
+
"backoff", utils.BackoffStrategy(200, 200, 1, 1000), True
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
retry_config = None
|
|
414
|
+
if isinstance(retries, utils.RetryConfig):
|
|
415
|
+
retry_config = (retries, ["5XX"])
|
|
416
|
+
|
|
417
|
+
http_res = self.do_request(
|
|
418
|
+
hook_ctx=HookContext(
|
|
419
|
+
config=self.sdk_configuration,
|
|
420
|
+
base_url=base_url or "",
|
|
421
|
+
operation_id="get_three_ds_scenario",
|
|
422
|
+
oauth2_scopes=None,
|
|
423
|
+
security_source=get_security_from_env(
|
|
424
|
+
self.sdk_configuration.security, models.Security
|
|
425
|
+
),
|
|
426
|
+
),
|
|
427
|
+
request=req,
|
|
428
|
+
error_status_codes=[
|
|
429
|
+
"400",
|
|
430
|
+
"401",
|
|
431
|
+
"403",
|
|
432
|
+
"404",
|
|
433
|
+
"405",
|
|
434
|
+
"409",
|
|
435
|
+
"422",
|
|
436
|
+
"425",
|
|
437
|
+
"429",
|
|
438
|
+
"4XX",
|
|
439
|
+
"500",
|
|
440
|
+
"502",
|
|
441
|
+
"504",
|
|
442
|
+
"5XX",
|
|
443
|
+
],
|
|
444
|
+
retry_config=retry_config,
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
def next_func() -> Optional[models.GetThreeDsScenarioResponse]:
|
|
448
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
449
|
+
next_cursor = JSONPath("$.next_cursor").parse(body)
|
|
450
|
+
|
|
451
|
+
if len(next_cursor) == 0:
|
|
452
|
+
return None
|
|
453
|
+
|
|
454
|
+
next_cursor = next_cursor[0]
|
|
455
|
+
if next_cursor is None or str(next_cursor).strip() == "":
|
|
456
|
+
return None
|
|
457
|
+
|
|
458
|
+
return self.list(
|
|
459
|
+
cursor=next_cursor,
|
|
460
|
+
limit=limit,
|
|
461
|
+
merchant_account_id=merchant_account_id,
|
|
462
|
+
retries=retries,
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
response_data: Any = None
|
|
466
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
467
|
+
return models.GetThreeDsScenarioResponse(
|
|
468
|
+
result=unmarshal_json_response(models.ThreeDSecureScenarios, http_res),
|
|
469
|
+
next=next_func,
|
|
470
|
+
)
|
|
471
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
472
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
473
|
+
raise errors.Error400(response_data, http_res)
|
|
474
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
475
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
476
|
+
raise errors.Error401(response_data, http_res)
|
|
477
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
478
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
479
|
+
raise errors.Error403(response_data, http_res)
|
|
480
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
481
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
482
|
+
raise errors.Error404(response_data, http_res)
|
|
483
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
484
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
485
|
+
raise errors.Error405(response_data, http_res)
|
|
486
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
487
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
488
|
+
raise errors.Error409(response_data, http_res)
|
|
489
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
490
|
+
response_data = unmarshal_json_response(
|
|
491
|
+
errors.HTTPValidationErrorData, http_res
|
|
492
|
+
)
|
|
493
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
494
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
495
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
496
|
+
raise errors.Error425(response_data, http_res)
|
|
497
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
498
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
499
|
+
raise errors.Error429(response_data, http_res)
|
|
500
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
501
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
502
|
+
raise errors.Error500(response_data, http_res)
|
|
503
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
504
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
505
|
+
raise errors.Error502(response_data, http_res)
|
|
506
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
507
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
508
|
+
raise errors.Error504(response_data, http_res)
|
|
509
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
510
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
511
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
512
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
513
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
514
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
515
|
+
|
|
516
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
517
|
+
|
|
518
|
+
async def list_async(
|
|
519
|
+
self,
|
|
520
|
+
*,
|
|
521
|
+
cursor: OptionalNullable[str] = UNSET,
|
|
522
|
+
limit: Optional[int] = 20,
|
|
523
|
+
merchant_account_id: Optional[str] = None,
|
|
524
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
525
|
+
server_url: Optional[str] = None,
|
|
526
|
+
timeout_ms: Optional[int] = None,
|
|
527
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
528
|
+
) -> Optional[models.GetThreeDsScenarioResponse]:
|
|
529
|
+
r"""List 3DS scenario
|
|
530
|
+
|
|
531
|
+
List all 3DS scenarios for a merchant account. Only available in sandbox environments.
|
|
532
|
+
|
|
533
|
+
:param cursor: A pointer to the page of results to return.
|
|
534
|
+
:param limit: The maximum number of items that are at returned.
|
|
535
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
536
|
+
:param retries: Override the default retry configuration for this method
|
|
537
|
+
:param server_url: Override the default server URL for this method
|
|
538
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
539
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
540
|
+
"""
|
|
541
|
+
base_url = None
|
|
542
|
+
url_variables = None
|
|
543
|
+
if timeout_ms is None:
|
|
544
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
545
|
+
|
|
546
|
+
if server_url is not None:
|
|
547
|
+
base_url = server_url
|
|
548
|
+
else:
|
|
549
|
+
base_url = self._get_url(base_url, url_variables)
|
|
550
|
+
|
|
551
|
+
request = models.GetThreeDsScenarioRequest(
|
|
552
|
+
cursor=cursor,
|
|
553
|
+
limit=limit,
|
|
554
|
+
merchant_account_id=merchant_account_id,
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
req = self._build_request_async(
|
|
558
|
+
method="GET",
|
|
559
|
+
path="/three-ds-scenarios",
|
|
560
|
+
base_url=base_url,
|
|
561
|
+
url_variables=url_variables,
|
|
562
|
+
request=request,
|
|
563
|
+
request_body_required=False,
|
|
564
|
+
request_has_path_params=False,
|
|
565
|
+
request_has_query_params=True,
|
|
566
|
+
user_agent_header="user-agent",
|
|
567
|
+
accept_header_value="application/json",
|
|
568
|
+
http_headers=http_headers,
|
|
569
|
+
_globals=models.GetThreeDsScenarioGlobals(
|
|
570
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
571
|
+
),
|
|
572
|
+
security=self.sdk_configuration.security,
|
|
573
|
+
allow_empty_value=None,
|
|
574
|
+
timeout_ms=timeout_ms,
|
|
575
|
+
)
|
|
576
|
+
|
|
577
|
+
if retries == UNSET:
|
|
578
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
579
|
+
retries = self.sdk_configuration.retry_config
|
|
580
|
+
else:
|
|
581
|
+
retries = utils.RetryConfig(
|
|
582
|
+
"backoff", utils.BackoffStrategy(200, 200, 1, 1000), True
|
|
583
|
+
)
|
|
584
|
+
|
|
585
|
+
retry_config = None
|
|
586
|
+
if isinstance(retries, utils.RetryConfig):
|
|
587
|
+
retry_config = (retries, ["5XX"])
|
|
588
|
+
|
|
589
|
+
http_res = await self.do_request_async(
|
|
590
|
+
hook_ctx=HookContext(
|
|
591
|
+
config=self.sdk_configuration,
|
|
592
|
+
base_url=base_url or "",
|
|
593
|
+
operation_id="get_three_ds_scenario",
|
|
594
|
+
oauth2_scopes=None,
|
|
595
|
+
security_source=get_security_from_env(
|
|
596
|
+
self.sdk_configuration.security, models.Security
|
|
597
|
+
),
|
|
598
|
+
),
|
|
599
|
+
request=req,
|
|
600
|
+
error_status_codes=[
|
|
601
|
+
"400",
|
|
602
|
+
"401",
|
|
603
|
+
"403",
|
|
604
|
+
"404",
|
|
605
|
+
"405",
|
|
606
|
+
"409",
|
|
607
|
+
"422",
|
|
608
|
+
"425",
|
|
609
|
+
"429",
|
|
610
|
+
"4XX",
|
|
611
|
+
"500",
|
|
612
|
+
"502",
|
|
613
|
+
"504",
|
|
614
|
+
"5XX",
|
|
615
|
+
],
|
|
616
|
+
retry_config=retry_config,
|
|
617
|
+
)
|
|
618
|
+
|
|
619
|
+
def next_func() -> Optional[models.GetThreeDsScenarioResponse]:
|
|
620
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
621
|
+
next_cursor = JSONPath("$.next_cursor").parse(body)
|
|
622
|
+
|
|
623
|
+
if len(next_cursor) == 0:
|
|
624
|
+
return None
|
|
625
|
+
|
|
626
|
+
next_cursor = next_cursor[0]
|
|
627
|
+
if next_cursor is None or str(next_cursor).strip() == "":
|
|
628
|
+
return None
|
|
629
|
+
|
|
630
|
+
return self.list(
|
|
631
|
+
cursor=next_cursor,
|
|
632
|
+
limit=limit,
|
|
633
|
+
merchant_account_id=merchant_account_id,
|
|
634
|
+
retries=retries,
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
response_data: Any = None
|
|
638
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
639
|
+
return models.GetThreeDsScenarioResponse(
|
|
640
|
+
result=unmarshal_json_response(models.ThreeDSecureScenarios, http_res),
|
|
641
|
+
next=next_func,
|
|
642
|
+
)
|
|
643
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
644
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
645
|
+
raise errors.Error400(response_data, http_res)
|
|
646
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
647
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
648
|
+
raise errors.Error401(response_data, http_res)
|
|
649
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
650
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
651
|
+
raise errors.Error403(response_data, http_res)
|
|
652
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
653
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
654
|
+
raise errors.Error404(response_data, http_res)
|
|
655
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
656
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
657
|
+
raise errors.Error405(response_data, http_res)
|
|
658
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
659
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
660
|
+
raise errors.Error409(response_data, http_res)
|
|
661
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
662
|
+
response_data = unmarshal_json_response(
|
|
663
|
+
errors.HTTPValidationErrorData, http_res
|
|
664
|
+
)
|
|
665
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
666
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
667
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
668
|
+
raise errors.Error425(response_data, http_res)
|
|
669
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
670
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
671
|
+
raise errors.Error429(response_data, http_res)
|
|
672
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
673
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
674
|
+
raise errors.Error500(response_data, http_res)
|
|
675
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
676
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
677
|
+
raise errors.Error502(response_data, http_res)
|
|
678
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
679
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
680
|
+
raise errors.Error504(response_data, http_res)
|
|
681
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
682
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
683
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
684
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
685
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
686
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
687
|
+
|
|
688
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
689
|
+
|
|
690
|
+
def update(
|
|
691
|
+
self,
|
|
692
|
+
*,
|
|
693
|
+
three_ds_scenario_id: str,
|
|
694
|
+
merchant_account_id: Optional[str] = None,
|
|
695
|
+
conditions: OptionalNullable[
|
|
696
|
+
Union[
|
|
697
|
+
models.ThreeDSecureScenarioConditions,
|
|
698
|
+
models.ThreeDSecureScenarioConditionsTypedDict,
|
|
699
|
+
]
|
|
700
|
+
] = UNSET,
|
|
701
|
+
outcome: OptionalNullable[
|
|
702
|
+
Union[
|
|
703
|
+
models.ThreeDSecureScenarioOutcome,
|
|
704
|
+
models.ThreeDSecureScenarioOutcomeTypedDict,
|
|
705
|
+
]
|
|
706
|
+
] = UNSET,
|
|
707
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
708
|
+
server_url: Optional[str] = None,
|
|
709
|
+
timeout_ms: Optional[int] = None,
|
|
710
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
711
|
+
) -> models.ThreeDSecureScenario:
|
|
712
|
+
r"""Update a 3DS scenario
|
|
713
|
+
|
|
714
|
+
Update a 3DS scenario. Only available in sandbox environments.
|
|
715
|
+
|
|
716
|
+
:param three_ds_scenario_id: The ID of the 3DS scenario
|
|
717
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
718
|
+
:param conditions: Conditions for the scenario.
|
|
719
|
+
:param outcome: Outcome for the scenario.
|
|
720
|
+
:param retries: Override the default retry configuration for this method
|
|
721
|
+
:param server_url: Override the default server URL for this method
|
|
722
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
723
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
724
|
+
"""
|
|
725
|
+
base_url = None
|
|
726
|
+
url_variables = None
|
|
727
|
+
if timeout_ms is None:
|
|
728
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
729
|
+
|
|
730
|
+
if server_url is not None:
|
|
731
|
+
base_url = server_url
|
|
732
|
+
else:
|
|
733
|
+
base_url = self._get_url(base_url, url_variables)
|
|
734
|
+
|
|
735
|
+
request = models.UpdateThreeDsScenarioRequest(
|
|
736
|
+
three_ds_scenario_id=three_ds_scenario_id,
|
|
737
|
+
merchant_account_id=merchant_account_id,
|
|
738
|
+
three_d_secure_scenario_update=models.ThreeDSecureScenarioUpdate(
|
|
739
|
+
conditions=utils.get_pydantic_model(
|
|
740
|
+
conditions, OptionalNullable[models.ThreeDSecureScenarioConditions]
|
|
741
|
+
),
|
|
742
|
+
outcome=utils.get_pydantic_model(
|
|
743
|
+
outcome, OptionalNullable[models.ThreeDSecureScenarioOutcome]
|
|
744
|
+
),
|
|
745
|
+
),
|
|
746
|
+
)
|
|
747
|
+
|
|
748
|
+
req = self._build_request(
|
|
749
|
+
method="PUT",
|
|
750
|
+
path="/three-ds-scenarios/{three_ds_scenario_id}",
|
|
751
|
+
base_url=base_url,
|
|
752
|
+
url_variables=url_variables,
|
|
753
|
+
request=request,
|
|
754
|
+
request_body_required=True,
|
|
755
|
+
request_has_path_params=True,
|
|
756
|
+
request_has_query_params=True,
|
|
757
|
+
user_agent_header="user-agent",
|
|
758
|
+
accept_header_value="application/json",
|
|
759
|
+
http_headers=http_headers,
|
|
760
|
+
_globals=models.UpdateThreeDsScenarioGlobals(
|
|
761
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
762
|
+
),
|
|
763
|
+
security=self.sdk_configuration.security,
|
|
764
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
765
|
+
request.three_d_secure_scenario_update,
|
|
766
|
+
False,
|
|
767
|
+
False,
|
|
768
|
+
"json",
|
|
769
|
+
models.ThreeDSecureScenarioUpdate,
|
|
770
|
+
),
|
|
771
|
+
allow_empty_value=None,
|
|
772
|
+
timeout_ms=timeout_ms,
|
|
773
|
+
)
|
|
774
|
+
|
|
775
|
+
if retries == UNSET:
|
|
776
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
777
|
+
retries = self.sdk_configuration.retry_config
|
|
778
|
+
|
|
779
|
+
retry_config = None
|
|
780
|
+
if isinstance(retries, utils.RetryConfig):
|
|
781
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
782
|
+
|
|
783
|
+
http_res = self.do_request(
|
|
784
|
+
hook_ctx=HookContext(
|
|
785
|
+
config=self.sdk_configuration,
|
|
786
|
+
base_url=base_url or "",
|
|
787
|
+
operation_id="update_three_ds_scenario",
|
|
788
|
+
oauth2_scopes=None,
|
|
789
|
+
security_source=get_security_from_env(
|
|
790
|
+
self.sdk_configuration.security, models.Security
|
|
791
|
+
),
|
|
792
|
+
),
|
|
793
|
+
request=req,
|
|
794
|
+
error_status_codes=[
|
|
795
|
+
"400",
|
|
796
|
+
"401",
|
|
797
|
+
"403",
|
|
798
|
+
"404",
|
|
799
|
+
"405",
|
|
800
|
+
"409",
|
|
801
|
+
"422",
|
|
802
|
+
"425",
|
|
803
|
+
"429",
|
|
804
|
+
"4XX",
|
|
805
|
+
"500",
|
|
806
|
+
"502",
|
|
807
|
+
"504",
|
|
808
|
+
"5XX",
|
|
809
|
+
],
|
|
810
|
+
retry_config=retry_config,
|
|
811
|
+
)
|
|
812
|
+
|
|
813
|
+
response_data: Any = None
|
|
814
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
815
|
+
return unmarshal_json_response(models.ThreeDSecureScenario, http_res)
|
|
816
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
817
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
818
|
+
raise errors.Error400(response_data, http_res)
|
|
819
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
820
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
821
|
+
raise errors.Error401(response_data, http_res)
|
|
822
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
823
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
824
|
+
raise errors.Error403(response_data, http_res)
|
|
825
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
826
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
827
|
+
raise errors.Error404(response_data, http_res)
|
|
828
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
829
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
830
|
+
raise errors.Error405(response_data, http_res)
|
|
831
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
832
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
833
|
+
raise errors.Error409(response_data, http_res)
|
|
834
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
835
|
+
response_data = unmarshal_json_response(
|
|
836
|
+
errors.HTTPValidationErrorData, http_res
|
|
837
|
+
)
|
|
838
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
839
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
840
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
841
|
+
raise errors.Error425(response_data, http_res)
|
|
842
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
843
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
844
|
+
raise errors.Error429(response_data, http_res)
|
|
845
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
846
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
847
|
+
raise errors.Error500(response_data, http_res)
|
|
848
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
849
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
850
|
+
raise errors.Error502(response_data, http_res)
|
|
851
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
852
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
853
|
+
raise errors.Error504(response_data, http_res)
|
|
854
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
855
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
856
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
857
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
858
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
859
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
860
|
+
|
|
861
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
862
|
+
|
|
863
|
+
async def update_async(
|
|
864
|
+
self,
|
|
865
|
+
*,
|
|
866
|
+
three_ds_scenario_id: str,
|
|
867
|
+
merchant_account_id: Optional[str] = None,
|
|
868
|
+
conditions: OptionalNullable[
|
|
869
|
+
Union[
|
|
870
|
+
models.ThreeDSecureScenarioConditions,
|
|
871
|
+
models.ThreeDSecureScenarioConditionsTypedDict,
|
|
872
|
+
]
|
|
873
|
+
] = UNSET,
|
|
874
|
+
outcome: OptionalNullable[
|
|
875
|
+
Union[
|
|
876
|
+
models.ThreeDSecureScenarioOutcome,
|
|
877
|
+
models.ThreeDSecureScenarioOutcomeTypedDict,
|
|
878
|
+
]
|
|
879
|
+
] = UNSET,
|
|
880
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
881
|
+
server_url: Optional[str] = None,
|
|
882
|
+
timeout_ms: Optional[int] = None,
|
|
883
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
884
|
+
) -> models.ThreeDSecureScenario:
|
|
885
|
+
r"""Update a 3DS scenario
|
|
886
|
+
|
|
887
|
+
Update a 3DS scenario. Only available in sandbox environments.
|
|
888
|
+
|
|
889
|
+
:param three_ds_scenario_id: The ID of the 3DS scenario
|
|
890
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
891
|
+
:param conditions: Conditions for the scenario.
|
|
892
|
+
:param outcome: Outcome for the scenario.
|
|
893
|
+
:param retries: Override the default retry configuration for this method
|
|
894
|
+
:param server_url: Override the default server URL for this method
|
|
895
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
896
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
897
|
+
"""
|
|
898
|
+
base_url = None
|
|
899
|
+
url_variables = None
|
|
900
|
+
if timeout_ms is None:
|
|
901
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
902
|
+
|
|
903
|
+
if server_url is not None:
|
|
904
|
+
base_url = server_url
|
|
905
|
+
else:
|
|
906
|
+
base_url = self._get_url(base_url, url_variables)
|
|
907
|
+
|
|
908
|
+
request = models.UpdateThreeDsScenarioRequest(
|
|
909
|
+
three_ds_scenario_id=three_ds_scenario_id,
|
|
910
|
+
merchant_account_id=merchant_account_id,
|
|
911
|
+
three_d_secure_scenario_update=models.ThreeDSecureScenarioUpdate(
|
|
912
|
+
conditions=utils.get_pydantic_model(
|
|
913
|
+
conditions, OptionalNullable[models.ThreeDSecureScenarioConditions]
|
|
914
|
+
),
|
|
915
|
+
outcome=utils.get_pydantic_model(
|
|
916
|
+
outcome, OptionalNullable[models.ThreeDSecureScenarioOutcome]
|
|
917
|
+
),
|
|
918
|
+
),
|
|
919
|
+
)
|
|
920
|
+
|
|
921
|
+
req = self._build_request_async(
|
|
922
|
+
method="PUT",
|
|
923
|
+
path="/three-ds-scenarios/{three_ds_scenario_id}",
|
|
924
|
+
base_url=base_url,
|
|
925
|
+
url_variables=url_variables,
|
|
926
|
+
request=request,
|
|
927
|
+
request_body_required=True,
|
|
928
|
+
request_has_path_params=True,
|
|
929
|
+
request_has_query_params=True,
|
|
930
|
+
user_agent_header="user-agent",
|
|
931
|
+
accept_header_value="application/json",
|
|
932
|
+
http_headers=http_headers,
|
|
933
|
+
_globals=models.UpdateThreeDsScenarioGlobals(
|
|
934
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
935
|
+
),
|
|
936
|
+
security=self.sdk_configuration.security,
|
|
937
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
938
|
+
request.three_d_secure_scenario_update,
|
|
939
|
+
False,
|
|
940
|
+
False,
|
|
941
|
+
"json",
|
|
942
|
+
models.ThreeDSecureScenarioUpdate,
|
|
943
|
+
),
|
|
944
|
+
allow_empty_value=None,
|
|
945
|
+
timeout_ms=timeout_ms,
|
|
946
|
+
)
|
|
947
|
+
|
|
948
|
+
if retries == UNSET:
|
|
949
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
950
|
+
retries = self.sdk_configuration.retry_config
|
|
951
|
+
|
|
952
|
+
retry_config = None
|
|
953
|
+
if isinstance(retries, utils.RetryConfig):
|
|
954
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
955
|
+
|
|
956
|
+
http_res = await self.do_request_async(
|
|
957
|
+
hook_ctx=HookContext(
|
|
958
|
+
config=self.sdk_configuration,
|
|
959
|
+
base_url=base_url or "",
|
|
960
|
+
operation_id="update_three_ds_scenario",
|
|
961
|
+
oauth2_scopes=None,
|
|
962
|
+
security_source=get_security_from_env(
|
|
963
|
+
self.sdk_configuration.security, models.Security
|
|
964
|
+
),
|
|
965
|
+
),
|
|
966
|
+
request=req,
|
|
967
|
+
error_status_codes=[
|
|
968
|
+
"400",
|
|
969
|
+
"401",
|
|
970
|
+
"403",
|
|
971
|
+
"404",
|
|
972
|
+
"405",
|
|
973
|
+
"409",
|
|
974
|
+
"422",
|
|
975
|
+
"425",
|
|
976
|
+
"429",
|
|
977
|
+
"4XX",
|
|
978
|
+
"500",
|
|
979
|
+
"502",
|
|
980
|
+
"504",
|
|
981
|
+
"5XX",
|
|
982
|
+
],
|
|
983
|
+
retry_config=retry_config,
|
|
984
|
+
)
|
|
985
|
+
|
|
986
|
+
response_data: Any = None
|
|
987
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
988
|
+
return unmarshal_json_response(models.ThreeDSecureScenario, http_res)
|
|
989
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
990
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
991
|
+
raise errors.Error400(response_data, http_res)
|
|
992
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
993
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
994
|
+
raise errors.Error401(response_data, http_res)
|
|
995
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
996
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
997
|
+
raise errors.Error403(response_data, http_res)
|
|
998
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
999
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
1000
|
+
raise errors.Error404(response_data, http_res)
|
|
1001
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
1002
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
1003
|
+
raise errors.Error405(response_data, http_res)
|
|
1004
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
1005
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
1006
|
+
raise errors.Error409(response_data, http_res)
|
|
1007
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1008
|
+
response_data = unmarshal_json_response(
|
|
1009
|
+
errors.HTTPValidationErrorData, http_res
|
|
1010
|
+
)
|
|
1011
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1012
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
1013
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
1014
|
+
raise errors.Error425(response_data, http_res)
|
|
1015
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
1016
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
1017
|
+
raise errors.Error429(response_data, http_res)
|
|
1018
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1019
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
1020
|
+
raise errors.Error500(response_data, http_res)
|
|
1021
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
1022
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
1023
|
+
raise errors.Error502(response_data, http_res)
|
|
1024
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
1025
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
1026
|
+
raise errors.Error504(response_data, http_res)
|
|
1027
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1028
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1029
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1030
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1031
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1032
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1033
|
+
|
|
1034
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1035
|
+
|
|
1036
|
+
def delete(
|
|
1037
|
+
self,
|
|
1038
|
+
*,
|
|
1039
|
+
three_ds_scenario_id: str,
|
|
1040
|
+
merchant_account_id: Optional[str] = None,
|
|
1041
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1042
|
+
server_url: Optional[str] = None,
|
|
1043
|
+
timeout_ms: Optional[int] = None,
|
|
1044
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1045
|
+
):
|
|
1046
|
+
r"""Delete a 3DS scenario
|
|
1047
|
+
|
|
1048
|
+
Removes a 3DS scenario from our system. Only available in sandbox environments.
|
|
1049
|
+
|
|
1050
|
+
:param three_ds_scenario_id: The ID of the 3DS scenario
|
|
1051
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
1052
|
+
:param retries: Override the default retry configuration for this method
|
|
1053
|
+
:param server_url: Override the default server URL for this method
|
|
1054
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1055
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1056
|
+
"""
|
|
1057
|
+
base_url = None
|
|
1058
|
+
url_variables = None
|
|
1059
|
+
if timeout_ms is None:
|
|
1060
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1061
|
+
|
|
1062
|
+
if server_url is not None:
|
|
1063
|
+
base_url = server_url
|
|
1064
|
+
else:
|
|
1065
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1066
|
+
|
|
1067
|
+
request = models.DeleteThreeDsScenarioRequest(
|
|
1068
|
+
three_ds_scenario_id=three_ds_scenario_id,
|
|
1069
|
+
merchant_account_id=merchant_account_id,
|
|
1070
|
+
)
|
|
1071
|
+
|
|
1072
|
+
req = self._build_request(
|
|
1073
|
+
method="DELETE",
|
|
1074
|
+
path="/three-ds-scenarios/{three_ds_scenario_id}",
|
|
1075
|
+
base_url=base_url,
|
|
1076
|
+
url_variables=url_variables,
|
|
1077
|
+
request=request,
|
|
1078
|
+
request_body_required=False,
|
|
1079
|
+
request_has_path_params=True,
|
|
1080
|
+
request_has_query_params=True,
|
|
1081
|
+
user_agent_header="user-agent",
|
|
1082
|
+
accept_header_value="application/json",
|
|
1083
|
+
http_headers=http_headers,
|
|
1084
|
+
_globals=models.DeleteThreeDsScenarioGlobals(
|
|
1085
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
1086
|
+
),
|
|
1087
|
+
security=self.sdk_configuration.security,
|
|
1088
|
+
allow_empty_value=None,
|
|
1089
|
+
timeout_ms=timeout_ms,
|
|
1090
|
+
)
|
|
1091
|
+
|
|
1092
|
+
if retries == UNSET:
|
|
1093
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1094
|
+
retries = self.sdk_configuration.retry_config
|
|
1095
|
+
|
|
1096
|
+
retry_config = None
|
|
1097
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1098
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1099
|
+
|
|
1100
|
+
http_res = self.do_request(
|
|
1101
|
+
hook_ctx=HookContext(
|
|
1102
|
+
config=self.sdk_configuration,
|
|
1103
|
+
base_url=base_url or "",
|
|
1104
|
+
operation_id="delete_three_ds_scenario",
|
|
1105
|
+
oauth2_scopes=None,
|
|
1106
|
+
security_source=get_security_from_env(
|
|
1107
|
+
self.sdk_configuration.security, models.Security
|
|
1108
|
+
),
|
|
1109
|
+
),
|
|
1110
|
+
request=req,
|
|
1111
|
+
error_status_codes=[
|
|
1112
|
+
"400",
|
|
1113
|
+
"401",
|
|
1114
|
+
"403",
|
|
1115
|
+
"404",
|
|
1116
|
+
"405",
|
|
1117
|
+
"409",
|
|
1118
|
+
"422",
|
|
1119
|
+
"425",
|
|
1120
|
+
"429",
|
|
1121
|
+
"4XX",
|
|
1122
|
+
"500",
|
|
1123
|
+
"502",
|
|
1124
|
+
"504",
|
|
1125
|
+
"5XX",
|
|
1126
|
+
],
|
|
1127
|
+
retry_config=retry_config,
|
|
1128
|
+
)
|
|
1129
|
+
|
|
1130
|
+
response_data: Any = None
|
|
1131
|
+
if utils.match_response(http_res, "204", "*"):
|
|
1132
|
+
return
|
|
1133
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1134
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
1135
|
+
raise errors.Error400(response_data, http_res)
|
|
1136
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1137
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
1138
|
+
raise errors.Error401(response_data, http_res)
|
|
1139
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1140
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
1141
|
+
raise errors.Error403(response_data, http_res)
|
|
1142
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1143
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
1144
|
+
raise errors.Error404(response_data, http_res)
|
|
1145
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
1146
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
1147
|
+
raise errors.Error405(response_data, http_res)
|
|
1148
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
1149
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
1150
|
+
raise errors.Error409(response_data, http_res)
|
|
1151
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1152
|
+
response_data = unmarshal_json_response(
|
|
1153
|
+
errors.HTTPValidationErrorData, http_res
|
|
1154
|
+
)
|
|
1155
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1156
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
1157
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
1158
|
+
raise errors.Error425(response_data, http_res)
|
|
1159
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
1160
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
1161
|
+
raise errors.Error429(response_data, http_res)
|
|
1162
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1163
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
1164
|
+
raise errors.Error500(response_data, http_res)
|
|
1165
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
1166
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
1167
|
+
raise errors.Error502(response_data, http_res)
|
|
1168
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
1169
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
1170
|
+
raise errors.Error504(response_data, http_res)
|
|
1171
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1172
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1173
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1174
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1175
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1176
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1177
|
+
|
|
1178
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1179
|
+
|
|
1180
|
+
async def delete_async(
|
|
1181
|
+
self,
|
|
1182
|
+
*,
|
|
1183
|
+
three_ds_scenario_id: str,
|
|
1184
|
+
merchant_account_id: Optional[str] = None,
|
|
1185
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1186
|
+
server_url: Optional[str] = None,
|
|
1187
|
+
timeout_ms: Optional[int] = None,
|
|
1188
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1189
|
+
):
|
|
1190
|
+
r"""Delete a 3DS scenario
|
|
1191
|
+
|
|
1192
|
+
Removes a 3DS scenario from our system. Only available in sandbox environments.
|
|
1193
|
+
|
|
1194
|
+
:param three_ds_scenario_id: The ID of the 3DS scenario
|
|
1195
|
+
:param merchant_account_id: The ID of the merchant account to use for this request.
|
|
1196
|
+
:param retries: Override the default retry configuration for this method
|
|
1197
|
+
:param server_url: Override the default server URL for this method
|
|
1198
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1199
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1200
|
+
"""
|
|
1201
|
+
base_url = None
|
|
1202
|
+
url_variables = None
|
|
1203
|
+
if timeout_ms is None:
|
|
1204
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1205
|
+
|
|
1206
|
+
if server_url is not None:
|
|
1207
|
+
base_url = server_url
|
|
1208
|
+
else:
|
|
1209
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1210
|
+
|
|
1211
|
+
request = models.DeleteThreeDsScenarioRequest(
|
|
1212
|
+
three_ds_scenario_id=three_ds_scenario_id,
|
|
1213
|
+
merchant_account_id=merchant_account_id,
|
|
1214
|
+
)
|
|
1215
|
+
|
|
1216
|
+
req = self._build_request_async(
|
|
1217
|
+
method="DELETE",
|
|
1218
|
+
path="/three-ds-scenarios/{three_ds_scenario_id}",
|
|
1219
|
+
base_url=base_url,
|
|
1220
|
+
url_variables=url_variables,
|
|
1221
|
+
request=request,
|
|
1222
|
+
request_body_required=False,
|
|
1223
|
+
request_has_path_params=True,
|
|
1224
|
+
request_has_query_params=True,
|
|
1225
|
+
user_agent_header="user-agent",
|
|
1226
|
+
accept_header_value="application/json",
|
|
1227
|
+
http_headers=http_headers,
|
|
1228
|
+
_globals=models.DeleteThreeDsScenarioGlobals(
|
|
1229
|
+
merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
|
|
1230
|
+
),
|
|
1231
|
+
security=self.sdk_configuration.security,
|
|
1232
|
+
allow_empty_value=None,
|
|
1233
|
+
timeout_ms=timeout_ms,
|
|
1234
|
+
)
|
|
1235
|
+
|
|
1236
|
+
if retries == UNSET:
|
|
1237
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1238
|
+
retries = self.sdk_configuration.retry_config
|
|
1239
|
+
|
|
1240
|
+
retry_config = None
|
|
1241
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1242
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1243
|
+
|
|
1244
|
+
http_res = await self.do_request_async(
|
|
1245
|
+
hook_ctx=HookContext(
|
|
1246
|
+
config=self.sdk_configuration,
|
|
1247
|
+
base_url=base_url or "",
|
|
1248
|
+
operation_id="delete_three_ds_scenario",
|
|
1249
|
+
oauth2_scopes=None,
|
|
1250
|
+
security_source=get_security_from_env(
|
|
1251
|
+
self.sdk_configuration.security, models.Security
|
|
1252
|
+
),
|
|
1253
|
+
),
|
|
1254
|
+
request=req,
|
|
1255
|
+
error_status_codes=[
|
|
1256
|
+
"400",
|
|
1257
|
+
"401",
|
|
1258
|
+
"403",
|
|
1259
|
+
"404",
|
|
1260
|
+
"405",
|
|
1261
|
+
"409",
|
|
1262
|
+
"422",
|
|
1263
|
+
"425",
|
|
1264
|
+
"429",
|
|
1265
|
+
"4XX",
|
|
1266
|
+
"500",
|
|
1267
|
+
"502",
|
|
1268
|
+
"504",
|
|
1269
|
+
"5XX",
|
|
1270
|
+
],
|
|
1271
|
+
retry_config=retry_config,
|
|
1272
|
+
)
|
|
1273
|
+
|
|
1274
|
+
response_data: Any = None
|
|
1275
|
+
if utils.match_response(http_res, "204", "*"):
|
|
1276
|
+
return
|
|
1277
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1278
|
+
response_data = unmarshal_json_response(errors.Error400Data, http_res)
|
|
1279
|
+
raise errors.Error400(response_data, http_res)
|
|
1280
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1281
|
+
response_data = unmarshal_json_response(errors.Error401Data, http_res)
|
|
1282
|
+
raise errors.Error401(response_data, http_res)
|
|
1283
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1284
|
+
response_data = unmarshal_json_response(errors.Error403Data, http_res)
|
|
1285
|
+
raise errors.Error403(response_data, http_res)
|
|
1286
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1287
|
+
response_data = unmarshal_json_response(errors.Error404Data, http_res)
|
|
1288
|
+
raise errors.Error404(response_data, http_res)
|
|
1289
|
+
if utils.match_response(http_res, "405", "application/json"):
|
|
1290
|
+
response_data = unmarshal_json_response(errors.Error405Data, http_res)
|
|
1291
|
+
raise errors.Error405(response_data, http_res)
|
|
1292
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
1293
|
+
response_data = unmarshal_json_response(errors.Error409Data, http_res)
|
|
1294
|
+
raise errors.Error409(response_data, http_res)
|
|
1295
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1296
|
+
response_data = unmarshal_json_response(
|
|
1297
|
+
errors.HTTPValidationErrorData, http_res
|
|
1298
|
+
)
|
|
1299
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1300
|
+
if utils.match_response(http_res, "425", "application/json"):
|
|
1301
|
+
response_data = unmarshal_json_response(errors.Error425Data, http_res)
|
|
1302
|
+
raise errors.Error425(response_data, http_res)
|
|
1303
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
1304
|
+
response_data = unmarshal_json_response(errors.Error429Data, http_res)
|
|
1305
|
+
raise errors.Error429(response_data, http_res)
|
|
1306
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1307
|
+
response_data = unmarshal_json_response(errors.Error500Data, http_res)
|
|
1308
|
+
raise errors.Error500(response_data, http_res)
|
|
1309
|
+
if utils.match_response(http_res, "502", "application/json"):
|
|
1310
|
+
response_data = unmarshal_json_response(errors.Error502Data, http_res)
|
|
1311
|
+
raise errors.Error502(response_data, http_res)
|
|
1312
|
+
if utils.match_response(http_res, "504", "application/json"):
|
|
1313
|
+
response_data = unmarshal_json_response(errors.Error504Data, http_res)
|
|
1314
|
+
raise errors.Error504(response_data, http_res)
|
|
1315
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1316
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1317
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1318
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1319
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1320
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1321
|
+
|
|
1322
|
+
raise errors.APIError("Unexpected response received", http_res)
|