moovio_sdk 0.3.8__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.
- moovio_sdk/__init__.py +17 -0
- moovio_sdk/_hooks/__init__.py +5 -0
- moovio_sdk/_hooks/registration.py +13 -0
- moovio_sdk/_hooks/sdkhooks.py +76 -0
- moovio_sdk/_hooks/types.py +106 -0
- moovio_sdk/_version.py +15 -0
- moovio_sdk/accounts.py +2461 -0
- moovio_sdk/adjustments.py +463 -0
- moovio_sdk/apple_pay.py +1417 -0
- moovio_sdk/authentication.py +531 -0
- moovio_sdk/avatars.py +231 -0
- moovio_sdk/bank_accounts.py +2445 -0
- moovio_sdk/basesdk.py +363 -0
- moovio_sdk/branding.py +1089 -0
- moovio_sdk/capabilities.py +1001 -0
- moovio_sdk/card_issuing.py +1351 -0
- moovio_sdk/cards.py +1469 -0
- moovio_sdk/disputes.py +2985 -0
- moovio_sdk/end_to_end_encryption.py +453 -0
- moovio_sdk/enriched_address.py +307 -0
- moovio_sdk/enriched_profile.py +235 -0
- moovio_sdk/fee_plans.py +1759 -0
- moovio_sdk/files.py +775 -0
- moovio_sdk/httpclient.py +136 -0
- moovio_sdk/industries.py +239 -0
- moovio_sdk/institutions.py +261 -0
- moovio_sdk/issuing_transactions.py +1228 -0
- moovio_sdk/models/__init__.py +4 -0
- moovio_sdk/models/components/__init__.py +1411 -0
- moovio_sdk/models/components/account.py +96 -0
- moovio_sdk/models/components/accountcapability.py +20 -0
- moovio_sdk/models/components/accountcountries.py +18 -0
- moovio_sdk/models/components/accountnameverification.py +28 -0
- moovio_sdk/models/components/accounttype.py +11 -0
- moovio_sdk/models/components/accountverificationstatus.py +19 -0
- moovio_sdk/models/components/achcreditsamedaypaymentmethod.py +38 -0
- moovio_sdk/models/components/achcreditstandardpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitcollectpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitfundpaymentmethod.py +38 -0
- moovio_sdk/models/components/achexception.py +20 -0
- moovio_sdk/models/components/achlocation.py +26 -0
- moovio_sdk/models/components/achparticipant.py +93 -0
- moovio_sdk/models/components/achpaymentdetails.py +30 -0
- moovio_sdk/models/components/achpaymentdetailserror.py +22 -0
- moovio_sdk/models/components/achpaymentsettings.py +16 -0
- moovio_sdk/models/components/achreturncode.py +51 -0
- moovio_sdk/models/components/achtransactiondetails.py +94 -0
- moovio_sdk/models/components/achtransactionstatus.py +15 -0
- moovio_sdk/models/components/addcapabilities.py +15 -0
- moovio_sdk/models/components/address.py +30 -0
- moovio_sdk/models/components/addresserror.py +32 -0
- moovio_sdk/models/components/addresssuggestion.py +34 -0
- moovio_sdk/models/components/addressupdate.py +32 -0
- moovio_sdk/models/components/adjustment.py +29 -0
- moovio_sdk/models/components/amount.py +26 -0
- moovio_sdk/models/components/amountdecimal.py +27 -0
- moovio_sdk/models/components/amountupdate.py +27 -0
- moovio_sdk/models/components/amountvalidationerror.py +17 -0
- moovio_sdk/models/components/applebillingcontact.py +53 -0
- moovio_sdk/models/components/applepayheader.py +41 -0
- moovio_sdk/models/components/applepaymerchantdomains.py +32 -0
- moovio_sdk/models/components/applepaypaymentmethod.py +33 -0
- moovio_sdk/models/components/applepayresponse.py +70 -0
- moovio_sdk/models/components/applicationscope.py +41 -0
- moovio_sdk/models/components/asynccreatedrefund.py +26 -0
- moovio_sdk/models/components/asynctransfer.py +18 -0
- moovio_sdk/models/components/authorizeduser.py +21 -0
- moovio_sdk/models/components/authtoken.py +36 -0
- moovio_sdk/models/components/authtokenrequest.py +46 -0
- moovio_sdk/models/components/bankaccount.py +98 -0
- moovio_sdk/models/components/bankaccountexception.py +96 -0
- moovio_sdk/models/components/bankaccountholdertype.py +11 -0
- moovio_sdk/models/components/bankaccountintegration.py +34 -0
- moovio_sdk/models/components/bankaccountpayload.py +21 -0
- moovio_sdk/models/components/bankaccountstatus.py +12 -0
- moovio_sdk/models/components/bankaccountstatusreason.py +23 -0
- moovio_sdk/models/components/bankaccounttype.py +13 -0
- moovio_sdk/models/components/bankaccountverification.py +30 -0
- moovio_sdk/models/components/bankaccountverificationcreated.py +21 -0
- moovio_sdk/models/components/bankaccountverificationmethod.py +9 -0
- moovio_sdk/models/components/bankaccountverificationstatus.py +13 -0
- moovio_sdk/models/components/bankaccountwaitfor.py +9 -0
- moovio_sdk/models/components/basicpaymentmethod.py +24 -0
- moovio_sdk/models/components/billablefee.py +54 -0
- moovio_sdk/models/components/birthdate.py +19 -0
- moovio_sdk/models/components/birthdateerror.py +20 -0
- moovio_sdk/models/components/birthdateupdate.py +20 -0
- moovio_sdk/models/components/birthdatevalidationerror.py +20 -0
- moovio_sdk/models/components/brandcolor.py +15 -0
- moovio_sdk/models/components/brandcolors.py +21 -0
- moovio_sdk/models/components/brandcolorvalidationerror.py +14 -0
- moovio_sdk/models/components/brandproperties.py +16 -0
- moovio_sdk/models/components/businessprofile.py +81 -0
- moovio_sdk/models/components/businesstype.py +19 -0
- moovio_sdk/models/components/calltoaction.py +19 -0
- moovio_sdk/models/components/cancellation.py +22 -0
- moovio_sdk/models/components/cancellationstatus.py +10 -0
- moovio_sdk/models/components/capabilitieserror.py +14 -0
- moovio_sdk/models/components/capability.py +56 -0
- moovio_sdk/models/components/capabilityid.py +18 -0
- moovio_sdk/models/components/capabilityrequirement.py +26 -0
- moovio_sdk/models/components/capabilitystatus.py +13 -0
- moovio_sdk/models/components/card.py +164 -0
- moovio_sdk/models/components/cardaccountupdater.py +28 -0
- moovio_sdk/models/components/cardacquiringdispute.py +26 -0
- moovio_sdk/models/components/cardacquiringmodel.py +11 -0
- moovio_sdk/models/components/cardacquiringrefund.py +42 -0
- moovio_sdk/models/components/cardaddress.py +32 -0
- moovio_sdk/models/components/cardbrand.py +14 -0
- moovio_sdk/models/components/cardexpiration.py +20 -0
- moovio_sdk/models/components/cardexpirationerror.py +17 -0
- moovio_sdk/models/components/cardissuingnetwork.py +12 -0
- moovio_sdk/models/components/cardpaymentdetails.py +23 -0
- moovio_sdk/models/components/cardpaymentdetailserror.py +17 -0
- moovio_sdk/models/components/cardpaymentpaymentmethod.py +33 -0
- moovio_sdk/models/components/cardpaymentsettings.py +23 -0
- moovio_sdk/models/components/cardtransactiondetails.py +94 -0
- moovio_sdk/models/components/cardtransactionfailurecode.py +32 -0
- moovio_sdk/models/components/cardtransactionstatus.py +15 -0
- moovio_sdk/models/components/cardtype.py +13 -0
- moovio_sdk/models/components/cardupdatereason.py +16 -0
- moovio_sdk/models/components/cardverification.py +38 -0
- moovio_sdk/models/components/cardverificationresult.py +12 -0
- moovio_sdk/models/components/cardvolumedistribution.py +29 -0
- moovio_sdk/models/components/cardvolumedistributionerror.py +32 -0
- moovio_sdk/models/components/collectionpaymentmethodtype.py +12 -0
- moovio_sdk/models/components/colorsvalidationerror.py +21 -0
- moovio_sdk/models/components/completebankaccountverification.py +15 -0
- moovio_sdk/models/components/completedmicrodeposits.py +14 -0
- moovio_sdk/models/components/completemicrodeposits.py +20 -0
- moovio_sdk/models/components/countrieserrors.py +14 -0
- moovio_sdk/models/components/createaccount.py +78 -0
- moovio_sdk/models/components/createaccounterror.py +44 -0
- moovio_sdk/models/components/createaccountsettings.py +40 -0
- moovio_sdk/models/components/createapplepaysession.py +21 -0
- moovio_sdk/models/components/createauthorizeduser.py +26 -0
- moovio_sdk/models/components/createauthorizedusererror.py +24 -0
- moovio_sdk/models/components/createauthorizeduserupdate.py +28 -0
- moovio_sdk/models/components/createbusinesserror.py +88 -0
- moovio_sdk/models/components/createbusinessprofile.py +69 -0
- moovio_sdk/models/components/createevidencefilemultipart.py +63 -0
- moovio_sdk/models/components/createevidencetext.py +20 -0
- moovio_sdk/models/components/createfeeplanagreement.py +14 -0
- moovio_sdk/models/components/createindividualerror.py +72 -0
- moovio_sdk/models/components/createindividualprofile.py +37 -0
- moovio_sdk/models/components/createpaymentlink.py +95 -0
- moovio_sdk/models/components/createprofile.py +22 -0
- moovio_sdk/models/components/createprofileerror.py +19 -0
- moovio_sdk/models/components/createrefund.py +26 -0
- moovio_sdk/models/components/createrefundresponse.py +18 -0
- moovio_sdk/models/components/createrepresentative.py +50 -0
- moovio_sdk/models/components/createreversal.py +15 -0
- moovio_sdk/models/components/createsweepconfig.py +41 -0
- moovio_sdk/models/components/createterminalapplication.py +42 -0
- moovio_sdk/models/components/createtransfer.py +49 -0
- moovio_sdk/models/components/createtransferdestination.py +37 -0
- moovio_sdk/models/components/createtransferdestinationach.py +26 -0
- moovio_sdk/models/components/createtransferdestinationcard.py +19 -0
- moovio_sdk/models/components/createtransferoptions.py +24 -0
- moovio_sdk/models/components/createtransfersource.py +48 -0
- moovio_sdk/models/components/createtransfersourceach.py +40 -0
- moovio_sdk/models/components/createtransfersourcecard.py +35 -0
- moovio_sdk/models/components/customersupport.py +33 -0
- moovio_sdk/models/components/customersupporterror.py +25 -0
- moovio_sdk/models/components/debitholdperiod.py +12 -0
- moovio_sdk/models/components/disbursementpaymentmethodtype.py +13 -0
- moovio_sdk/models/components/displayoptionserror.py +23 -0
- moovio_sdk/models/components/dispute.py +76 -0
- moovio_sdk/models/components/disputeevidenceresponse.py +49 -0
- moovio_sdk/models/components/disputephase.py +13 -0
- moovio_sdk/models/components/disputestatus.py +20 -0
- moovio_sdk/models/components/disputetransferdetails.py +16 -0
- moovio_sdk/models/components/document.py +37 -0
- moovio_sdk/models/components/documenttype.py +13 -0
- moovio_sdk/models/components/domesticpullfromcard.py +12 -0
- moovio_sdk/models/components/domesticpushtocard.py +13 -0
- moovio_sdk/models/components/e2eetoken.py +25 -0
- moovio_sdk/models/components/e2eetokenupdate.py +26 -0
- moovio_sdk/models/components/end2endencryptionerror.py +14 -0
- moovio_sdk/models/components/enrichedaddressresponse.py +15 -0
- moovio_sdk/models/components/enrichedbusinessprofile.py +37 -0
- moovio_sdk/models/components/enrichedbusinessresponse.py +18 -0
- moovio_sdk/models/components/enrichedindustries.py +15 -0
- moovio_sdk/models/components/enrichedindustry.py +32 -0
- moovio_sdk/models/components/enrichedindustrycodes.py +17 -0
- moovio_sdk/models/components/evidencetextresponse.py +28 -0
- moovio_sdk/models/components/evidencetype.py +15 -0
- moovio_sdk/models/components/evidenceuploadresponse.py +50 -0
- moovio_sdk/models/components/facilitatorfee.py +48 -0
- moovio_sdk/models/components/feecategory.py +16 -0
- moovio_sdk/models/components/feemodel.py +12 -0
- moovio_sdk/models/components/feeplan.py +43 -0
- moovio_sdk/models/components/feeplanagreement.py +51 -0
- moovio_sdk/models/components/feeplanagreementstatus.py +9 -0
- moovio_sdk/models/components/feeproperties.py +49 -0
- moovio_sdk/models/components/filedetails.py +55 -0
- moovio_sdk/models/components/filepurpose.py +15 -0
- moovio_sdk/models/components/filestatus.py +12 -0
- moovio_sdk/models/components/fileuploadrequestmultipart.py +69 -0
- moovio_sdk/models/components/financialinstitutions.py +18 -0
- moovio_sdk/models/components/fulfillmentdetails.py +24 -0
- moovio_sdk/models/components/fulfillmentdetailserror.py +20 -0
- moovio_sdk/models/components/fullissuedcard.py +92 -0
- moovio_sdk/models/components/generatedby.py +39 -0
- moovio_sdk/models/components/generatedbyaccountid.py +15 -0
- moovio_sdk/models/components/generatedbybankaccountid.py +17 -0
- moovio_sdk/models/components/generatedbycardid.py +15 -0
- moovio_sdk/models/components/generatedbydisputeid.py +15 -0
- moovio_sdk/models/components/generatedbytransferid.py +15 -0
- moovio_sdk/models/components/governmentid.py +40 -0
- moovio_sdk/models/components/governmentiderror.py +40 -0
- moovio_sdk/models/components/granttype.py +15 -0
- moovio_sdk/models/components/incurredfee.py +44 -0
- moovio_sdk/models/components/individualname.py +32 -0
- moovio_sdk/models/components/individualnameerror.py +24 -0
- moovio_sdk/models/components/individualnameupdate.py +32 -0
- moovio_sdk/models/components/individualprofile.py +45 -0
- moovio_sdk/models/components/industrycodes.py +20 -0
- moovio_sdk/models/components/issuedcard.py +78 -0
- moovio_sdk/models/components/issuedcardauthorization.py +53 -0
- moovio_sdk/models/components/issuedcardauthorizationevent.py +37 -0
- moovio_sdk/models/components/issuedcardauthorizationeventresult.py +12 -0
- moovio_sdk/models/components/issuedcardeventtype.py +15 -0
- moovio_sdk/models/components/issuedcardformfactor.py +10 -0
- moovio_sdk/models/components/issuedcardstate.py +19 -0
- moovio_sdk/models/components/issuedcardtransaction.py +42 -0
- moovio_sdk/models/components/issuingauthorizationstatus.py +14 -0
- moovio_sdk/models/components/issuingcontrols.py +25 -0
- moovio_sdk/models/components/issuingcontrolserror.py +22 -0
- moovio_sdk/models/components/issuingintervallimit.py +10 -0
- moovio_sdk/models/components/issuingmerchantdata.py +47 -0
- moovio_sdk/models/components/issuingvelocitylimit.py +21 -0
- moovio_sdk/models/components/issuingvelocitylimiterror.py +17 -0
- moovio_sdk/models/components/jsonwebkey.py +103 -0
- moovio_sdk/models/components/linkapplepay.py +54 -0
- moovio_sdk/models/components/linkapplepaymentdata.py +51 -0
- moovio_sdk/models/components/linkapplepaymentmethod.py +38 -0
- moovio_sdk/models/components/linkapplepaytoken.py +63 -0
- moovio_sdk/models/components/linkbankaccount.py +26 -0
- moovio_sdk/models/components/linkcard.py +54 -0
- moovio_sdk/models/components/linkcardwaitfor.py +8 -0
- moovio_sdk/models/components/linkedapplepaypaymentmethod.py +30 -0
- moovio_sdk/models/components/listfeesfetchrequest.py +19 -0
- moovio_sdk/models/components/manualtermsofservice.py +34 -0
- moovio_sdk/models/components/manualtermsofserviceupdate.py +41 -0
- moovio_sdk/models/components/microdepositstatus.py +8 -0
- moovio_sdk/models/components/mode.py +11 -0
- moovio_sdk/models/components/moovfeedetails.py +36 -0
- moovio_sdk/models/components/moovwalletpaymentmethod.py +31 -0
- moovio_sdk/models/components/mxauthorizationcode.py +26 -0
- moovio_sdk/models/components/mxpayload.py +46 -0
- moovio_sdk/models/components/occurrence.py +44 -0
- moovio_sdk/models/components/occurrencesresponse.py +80 -0
- moovio_sdk/models/components/occurrencestatus.py +12 -0
- moovio_sdk/models/components/onboardinginvite.py +91 -0
- moovio_sdk/models/components/onboardinginviterequest.py +57 -0
- moovio_sdk/models/components/onboardingpartneraccount.py +31 -0
- moovio_sdk/models/components/partnerpricing.py +46 -0
- moovio_sdk/models/components/partnerpricingagreement.py +56 -0
- moovio_sdk/models/components/patchaccount.py +138 -0
- moovio_sdk/models/components/patchaccounterror.py +38 -0
- moovio_sdk/models/components/patchbusiness.py +72 -0
- moovio_sdk/models/components/patchindividual.py +43 -0
- moovio_sdk/models/components/patchprofile.py +29 -0
- moovio_sdk/models/components/patchsweepconfig.py +147 -0
- moovio_sdk/models/components/patchtransfer.py +51 -0
- moovio_sdk/models/components/paymentdetailserror.py +35 -0
- moovio_sdk/models/components/paymentlink.py +125 -0
- moovio_sdk/models/components/paymentlinkcustomeroptions.py +31 -0
- moovio_sdk/models/components/paymentlinkdisplayoptions.py +39 -0
- moovio_sdk/models/components/paymentlinkdisplayoptionsupdate.py +42 -0
- moovio_sdk/models/components/paymentlinkpaymentdetails.py +40 -0
- moovio_sdk/models/components/paymentlinkpaymentdetailsupdate.py +41 -0
- moovio_sdk/models/components/paymentlinkpayoutdetails.py +32 -0
- moovio_sdk/models/components/paymentlinkpayoutdetailsupdate.py +33 -0
- moovio_sdk/models/components/paymentlinkstatus.py +11 -0
- moovio_sdk/models/components/paymentmethod.py +82 -0
- moovio_sdk/models/components/paymentmethodsbankaccount.py +65 -0
- moovio_sdk/models/components/paymentmethodscard.py +121 -0
- moovio_sdk/models/components/paymentmethodswallet.py +14 -0
- moovio_sdk/models/components/paymentmethodtype.py +19 -0
- moovio_sdk/models/components/payoutdetailserror.py +21 -0
- moovio_sdk/models/components/payoutrecipient.py +23 -0
- moovio_sdk/models/components/payoutrecipienterror.py +14 -0
- moovio_sdk/models/components/payoutrecipientupdate.py +24 -0
- moovio_sdk/models/components/phonenumber.py +18 -0
- moovio_sdk/models/components/phonenumbererror.py +18 -0
- moovio_sdk/models/components/plaidintegration.py +39 -0
- moovio_sdk/models/components/plaidlinkintegration.py +36 -0
- moovio_sdk/models/components/plaidlinkpayload.py +45 -0
- moovio_sdk/models/components/plaidpayload.py +42 -0
- moovio_sdk/models/components/primaryregulator.py +13 -0
- moovio_sdk/models/components/profile.py +27 -0
- moovio_sdk/models/components/pullfromcardpaymentmethod.py +33 -0
- moovio_sdk/models/components/pushtocardpaymentmethod.py +33 -0
- moovio_sdk/models/components/qrcode.py +16 -0
- moovio_sdk/models/components/receiptkind.py +10 -0
- moovio_sdk/models/components/receiptrequest.py +75 -0
- moovio_sdk/models/components/receiptresponse.py +95 -0
- moovio_sdk/models/components/recur.py +40 -0
- moovio_sdk/models/components/refundcarddetails.py +44 -0
- moovio_sdk/models/components/refundcardstatus.py +12 -0
- moovio_sdk/models/components/refundstatus.py +11 -0
- moovio_sdk/models/components/registerapplepaymerchantdomains.py +22 -0
- moovio_sdk/models/components/representative.py +71 -0
- moovio_sdk/models/components/representativeresponsibilities.py +42 -0
- moovio_sdk/models/components/representativeresponsibilitieserror.py +26 -0
- moovio_sdk/models/components/requestcard.py +44 -0
- moovio_sdk/models/components/requirementerror.py +24 -0
- moovio_sdk/models/components/requirementerrorcode.py +25 -0
- moovio_sdk/models/components/requirementid.py +71 -0
- moovio_sdk/models/components/returnpolicytype.py +11 -0
- moovio_sdk/models/components/reversal.py +23 -0
- moovio_sdk/models/components/reversedwithcancellation.py +14 -0
- moovio_sdk/models/components/reversedwithrefund.py +16 -0
- moovio_sdk/models/components/revoketokenrequest.py +40 -0
- moovio_sdk/models/components/rtpcreditpaymentmethod.py +38 -0
- moovio_sdk/models/components/rtpfailurecode.py +19 -0
- moovio_sdk/models/components/rtprejectioncode.py +25 -0
- moovio_sdk/models/components/rtptransactiondetails.py +56 -0
- moovio_sdk/models/components/rtptransactionstatus.py +13 -0
- moovio_sdk/models/components/runtransfer.py +34 -0
- moovio_sdk/models/components/schedulepaymentmethod.py +56 -0
- moovio_sdk/models/components/scheduleresponse.py +60 -0
- moovio_sdk/models/components/seccode.py +13 -0
- moovio_sdk/models/components/security.py +32 -0
- moovio_sdk/models/components/sentreceipt.py +27 -0
- moovio_sdk/models/components/settings.py +30 -0
- moovio_sdk/models/components/sourcedestinationoptions.py +20 -0
- moovio_sdk/models/components/sweep.py +80 -0
- moovio_sdk/models/components/sweepconfig.py +81 -0
- moovio_sdk/models/components/sweepconfigpaymentmethod.py +31 -0
- moovio_sdk/models/components/sweepconfigstatus.py +9 -0
- moovio_sdk/models/components/sweepstatus.py +13 -0
- moovio_sdk/models/components/taxid.py +25 -0
- moovio_sdk/models/components/taxidupdate.py +26 -0
- moovio_sdk/models/components/terminalapplication.py +55 -0
- moovio_sdk/models/components/terminalapplicationplatform.py +12 -0
- moovio_sdk/models/components/terminalapplicationstatus.py +13 -0
- moovio_sdk/models/components/termsofservice.py +26 -0
- moovio_sdk/models/components/termsofserviceerror.py +39 -0
- moovio_sdk/models/components/termsofservicetoken.py +17 -0
- moovio_sdk/models/components/termsofservicetokenupdate.py +18 -0
- moovio_sdk/models/components/tokentype.py +10 -0
- moovio_sdk/models/components/transactionsource.py +16 -0
- moovio_sdk/models/components/transfer.py +126 -0
- moovio_sdk/models/components/transferaccount.py +20 -0
- moovio_sdk/models/components/transferdestination.py +83 -0
- moovio_sdk/models/components/transferfailurereason.py +14 -0
- moovio_sdk/models/components/transferoptions.py +23 -0
- moovio_sdk/models/components/transferresponse.py +15 -0
- moovio_sdk/models/components/transfersource.py +80 -0
- moovio_sdk/models/components/transferstatus.py +16 -0
- moovio_sdk/models/components/transferwaitfor.py +8 -0
- moovio_sdk/models/components/underwriting.py +56 -0
- moovio_sdk/models/components/underwritingstatus.py +16 -0
- moovio_sdk/models/components/updateapplepaymerchantdomains.py +26 -0
- moovio_sdk/models/components/updatebrand.py +15 -0
- moovio_sdk/models/components/updatecard.py +51 -0
- moovio_sdk/models/components/updatecardaddress.py +32 -0
- moovio_sdk/models/components/updatecardexpiration.py +17 -0
- moovio_sdk/models/components/updatecolor.py +14 -0
- moovio_sdk/models/components/updatecolors.py +18 -0
- moovio_sdk/models/components/updateevidence.py +23 -0
- moovio_sdk/models/components/updateissuedcard.py +44 -0
- moovio_sdk/models/components/updatepaymentlink.py +98 -0
- moovio_sdk/models/components/updaterepresentative.py +224 -0
- moovio_sdk/models/components/updateunderwriting.py +43 -0
- moovio_sdk/models/components/upsertschedule.py +26 -0
- moovio_sdk/models/components/verification.py +54 -0
- moovio_sdk/models/components/verificationstatus.py +17 -0
- moovio_sdk/models/components/verificationstatusdetail.py +23 -0
- moovio_sdk/models/components/volumebycustomertype.py +21 -0
- moovio_sdk/models/components/volumebycustomertypeerror.py +22 -0
- moovio_sdk/models/components/wallet.py +27 -0
- moovio_sdk/models/components/walletavailablebalance.py +30 -0
- moovio_sdk/models/components/wallettransaction.py +114 -0
- moovio_sdk/models/components/wallettransactionsourcetype.py +13 -0
- moovio_sdk/models/components/wallettransactionstatus.py +11 -0
- moovio_sdk/models/components/wallettransactiontype.py +32 -0
- moovio_sdk/models/errors/__init__.py +155 -0
- moovio_sdk/models/errors/addcapabilitieserror.py +23 -0
- moovio_sdk/models/errors/apierror.py +22 -0
- moovio_sdk/models/errors/assigncountrieserror.py +20 -0
- moovio_sdk/models/errors/authtokenrequesterror.py +22 -0
- moovio_sdk/models/errors/bankaccountvalidationerror.py +30 -0
- moovio_sdk/models/errors/brandvalidationerror.py +23 -0
- moovio_sdk/models/errors/cardacquiringrefund.py +44 -0
- moovio_sdk/models/errors/createaccount.py +24 -0
- moovio_sdk/models/errors/createpaymentlinkerror.py +46 -0
- moovio_sdk/models/errors/createsweepconfigerror.py +40 -0
- moovio_sdk/models/errors/feeplanagreementerror.py +22 -0
- moovio_sdk/models/errors/fileuploadvalidationerror.py +35 -0
- moovio_sdk/models/errors/filevalidationerror.py +28 -0
- moovio_sdk/models/errors/genericerror.py +19 -0
- moovio_sdk/models/errors/linkapplepayerror.py +36 -0
- moovio_sdk/models/errors/linkcarderror.py +47 -0
- moovio_sdk/models/errors/microdepositvalidationerror.py +20 -0
- moovio_sdk/models/errors/onboardinginviteerror.py +34 -0
- moovio_sdk/models/errors/patchsweepconfigerror.py +38 -0
- moovio_sdk/models/errors/receiptvalidationerror.py +40 -0
- moovio_sdk/models/errors/refundvalidationerror.py +23 -0
- moovio_sdk/models/errors/representativevalidationerror.py +68 -0
- moovio_sdk/models/errors/requestcarderror.py +42 -0
- moovio_sdk/models/errors/reversalvalidationerror.py +20 -0
- moovio_sdk/models/errors/revoketokenrequesterror.py +22 -0
- moovio_sdk/models/errors/schedulevalidationerror.py +24 -0
- moovio_sdk/models/errors/terminalapplicationerror.py +30 -0
- moovio_sdk/models/errors/transfer.py +108 -0
- moovio_sdk/models/errors/transferoptionsvalidationerror.py +24 -0
- moovio_sdk/models/errors/transfervalidationerror.py +49 -0
- moovio_sdk/models/errors/updateaccount.py +24 -0
- moovio_sdk/models/errors/updatecarderror.py +43 -0
- moovio_sdk/models/errors/updateissuedcarderror.py +32 -0
- moovio_sdk/models/errors/updatepaymentlinkerror.py +36 -0
- moovio_sdk/models/errors/updateunderwritingerror.py +70 -0
- moovio_sdk/models/internal/__init__.py +6 -0
- moovio_sdk/models/internal/globals.py +40 -0
- moovio_sdk/models/operations/__init__.py +1824 -0
- moovio_sdk/models/operations/acceptdispute.py +71 -0
- moovio_sdk/models/operations/assignaccountcountries.py +75 -0
- moovio_sdk/models/operations/cancelschedule.py +67 -0
- moovio_sdk/models/operations/completebankaccountverification.py +85 -0
- moovio_sdk/models/operations/completemicrodeposits.py +87 -0
- moovio_sdk/models/operations/createaccesstoken.py +52 -0
- moovio_sdk/models/operations/createaccount.py +52 -0
- moovio_sdk/models/operations/createapplepaysession.py +81 -0
- moovio_sdk/models/operations/createbrand.py +75 -0
- moovio_sdk/models/operations/createcancellation.py +75 -0
- moovio_sdk/models/operations/createfeeplanagreements.py +80 -0
- moovio_sdk/models/operations/createonboardinginvite.py +52 -0
- moovio_sdk/models/operations/createpaymentlink.py +78 -0
- moovio_sdk/models/operations/createreceipts.py +52 -0
- moovio_sdk/models/operations/createrepresentative.py +80 -0
- moovio_sdk/models/operations/createreversal.py +98 -0
- moovio_sdk/models/operations/createschedule.py +78 -0
- moovio_sdk/models/operations/createsweepconfig.py +78 -0
- moovio_sdk/models/operations/createterminalapplication.py +54 -0
- moovio_sdk/models/operations/createtransfer.py +125 -0
- moovio_sdk/models/operations/createtransferoptions.py +52 -0
- moovio_sdk/models/operations/deletedisputeevidencefile.py +74 -0
- moovio_sdk/models/operations/deleterepresentative.py +71 -0
- moovio_sdk/models/operations/deleteterminalapplication.py +60 -0
- moovio_sdk/models/operations/disablebankaccount.py +67 -0
- moovio_sdk/models/operations/disablecapability.py +76 -0
- moovio_sdk/models/operations/disablecard.py +67 -0
- moovio_sdk/models/operations/disablepaymentlink.py +67 -0
- moovio_sdk/models/operations/disconnectaccount.py +60 -0
- moovio_sdk/models/operations/generateendtoendkey.py +60 -0
- moovio_sdk/models/operations/getaccount.py +64 -0
- moovio_sdk/models/operations/getaccountcountries.py +64 -0
- moovio_sdk/models/operations/getadjustment.py +71 -0
- moovio_sdk/models/operations/getapplepaymerchantdomains.py +68 -0
- moovio_sdk/models/operations/getavatar.py +66 -0
- moovio_sdk/models/operations/getbankaccount.py +71 -0
- moovio_sdk/models/operations/getbankaccountverification.py +73 -0
- moovio_sdk/models/operations/getbrand.py +64 -0
- moovio_sdk/models/operations/getcancellation.py +84 -0
- moovio_sdk/models/operations/getcapability.py +82 -0
- moovio_sdk/models/operations/getcard.py +71 -0
- moovio_sdk/models/operations/getdispute.py +71 -0
- moovio_sdk/models/operations/getdisputeevidence.py +80 -0
- moovio_sdk/models/operations/getdisputeevidencedata.py +90 -0
- moovio_sdk/models/operations/getenrichmentaddress.py +178 -0
- moovio_sdk/models/operations/getenrichmentprofile.py +64 -0
- moovio_sdk/models/operations/getfiledetails.py +71 -0
- moovio_sdk/models/operations/getfullissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcardauthorization.py +75 -0
- moovio_sdk/models/operations/getissuedcardtransaction.py +75 -0
- moovio_sdk/models/operations/getmerchantprocessingagreement.py +64 -0
- moovio_sdk/models/operations/getonboardinginvite.py +62 -0
- moovio_sdk/models/operations/getpaymentlink.py +71 -0
- moovio_sdk/models/operations/getpaymentlinkqrcode.py +84 -0
- moovio_sdk/models/operations/getpaymentmethod.py +71 -0
- moovio_sdk/models/operations/getrefund.py +84 -0
- moovio_sdk/models/operations/getrepresentative.py +75 -0
- moovio_sdk/models/operations/getscheduledoccurrence.py +92 -0
- moovio_sdk/models/operations/getschedules.py +71 -0
- moovio_sdk/models/operations/getsweep.py +78 -0
- moovio_sdk/models/operations/getsweepconfig.py +71 -0
- moovio_sdk/models/operations/getterminalapplication.py +66 -0
- moovio_sdk/models/operations/gettermsofservicetoken.py +75 -0
- moovio_sdk/models/operations/gettransfer.py +73 -0
- moovio_sdk/models/operations/getunderwriting.py +64 -0
- moovio_sdk/models/operations/getwallet.py +71 -0
- moovio_sdk/models/operations/getwallettransaction.py +80 -0
- moovio_sdk/models/operations/initiatebankaccountverification.py +89 -0
- moovio_sdk/models/operations/initiatemicrodeposits.py +67 -0
- moovio_sdk/models/operations/initiaterefund.py +131 -0
- moovio_sdk/models/operations/linkapplepaytoken.py +80 -0
- moovio_sdk/models/operations/linkbankaccount.py +96 -0
- moovio_sdk/models/operations/linkcard.py +96 -0
- moovio_sdk/models/operations/listaccounts.py +171 -0
- moovio_sdk/models/operations/listadjustments.py +78 -0
- moovio_sdk/models/operations/listbankaccounts.py +64 -0
- moovio_sdk/models/operations/listcapabilities.py +64 -0
- moovio_sdk/models/operations/listcards.py +64 -0
- moovio_sdk/models/operations/listdisputeevidence.py +73 -0
- moovio_sdk/models/operations/listdisputes.py +172 -0
- moovio_sdk/models/operations/listfeeplanagreements.py +101 -0
- moovio_sdk/models/operations/listfeeplans.py +78 -0
- moovio_sdk/models/operations/listfeesfetch.py +80 -0
- moovio_sdk/models/operations/listfiles.py +64 -0
- moovio_sdk/models/operations/listindustries.py +62 -0
- moovio_sdk/models/operations/listinstitutions.py +92 -0
- moovio_sdk/models/operations/listissuedcardauthorizationevents.py +94 -0
- moovio_sdk/models/operations/listissuedcardauthorizations.py +126 -0
- moovio_sdk/models/operations/listissuedcards.py +94 -0
- moovio_sdk/models/operations/listissuedcardtransactions.py +113 -0
- moovio_sdk/models/operations/listonboardinginvites.py +60 -0
- moovio_sdk/models/operations/listpartnerpricing.py +78 -0
- moovio_sdk/models/operations/listpartnerpricingagreements.py +101 -0
- moovio_sdk/models/operations/listpaymentlinks.py +64 -0
- moovio_sdk/models/operations/listpaymentmethods.py +98 -0
- moovio_sdk/models/operations/listreceipts.py +65 -0
- moovio_sdk/models/operations/listrefunds.py +75 -0
- moovio_sdk/models/operations/listrepresentatives.py +66 -0
- moovio_sdk/models/operations/listschedules.py +81 -0
- moovio_sdk/models/operations/listsweepconfigs.py +64 -0
- moovio_sdk/models/operations/listsweeps.py +108 -0
- moovio_sdk/models/operations/listterminalapplications.py +62 -0
- moovio_sdk/models/operations/listtransfers.py +145 -0
- moovio_sdk/models/operations/listwallets.py +64 -0
- moovio_sdk/models/operations/listwallettransactions.py +189 -0
- moovio_sdk/models/operations/ping.py +56 -0
- moovio_sdk/models/operations/registerapplepaymerchantdomains.py +80 -0
- moovio_sdk/models/operations/requestcapabilities.py +78 -0
- moovio_sdk/models/operations/requestcard.py +80 -0
- moovio_sdk/models/operations/retrievefees.py +117 -0
- moovio_sdk/models/operations/revokeaccesstoken.py +48 -0
- moovio_sdk/models/operations/revokeonboardinginvite.py +58 -0
- moovio_sdk/models/operations/submitdisputeevidence.py +71 -0
- moovio_sdk/models/operations/testendtoendtoken.py +56 -0
- moovio_sdk/models/operations/updateaccount.py +78 -0
- moovio_sdk/models/operations/updateapplepaymerchantdomains.py +78 -0
- moovio_sdk/models/operations/updatebrand.py +78 -0
- moovio_sdk/models/operations/updatecard.py +85 -0
- moovio_sdk/models/operations/updatedisputeevidence.py +92 -0
- moovio_sdk/models/operations/updateissuedcard.py +81 -0
- moovio_sdk/models/operations/updatepaymentlink.py +85 -0
- moovio_sdk/models/operations/updaterepresentative.py +89 -0
- moovio_sdk/models/operations/updateschedule.py +85 -0
- moovio_sdk/models/operations/updatesweepconfig.py +85 -0
- moovio_sdk/models/operations/updatetransfer.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencefile.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencetext.py +85 -0
- moovio_sdk/models/operations/uploadfile.py +80 -0
- moovio_sdk/models/operations/upsertbrand.py +75 -0
- moovio_sdk/models/operations/upsertunderwriting.py +78 -0
- moovio_sdk/onboarding.py +965 -0
- moovio_sdk/payment_links.py +1694 -0
- moovio_sdk/payment_methods.py +475 -0
- moovio_sdk/ping.py +233 -0
- moovio_sdk/py.typed +1 -0
- moovio_sdk/receipts.py +507 -0
- moovio_sdk/representatives.py +1513 -0
- moovio_sdk/scheduling.py +1565 -0
- moovio_sdk/sdk.py +242 -0
- moovio_sdk/sdkconfiguration.py +59 -0
- moovio_sdk/sweeps.py +1617 -0
- moovio_sdk/terminal_applications.py +1013 -0
- moovio_sdk/transfers.py +3040 -0
- moovio_sdk/types/__init__.py +21 -0
- moovio_sdk/types/basemodel.py +39 -0
- moovio_sdk/underwriting.py +581 -0
- moovio_sdk/utils/__init__.py +101 -0
- moovio_sdk/utils/annotations.py +55 -0
- moovio_sdk/utils/enums.py +34 -0
- moovio_sdk/utils/eventstreaming.py +238 -0
- moovio_sdk/utils/forms.py +202 -0
- moovio_sdk/utils/headers.py +136 -0
- moovio_sdk/utils/logger.py +27 -0
- moovio_sdk/utils/metadata.py +118 -0
- moovio_sdk/utils/queryparams.py +205 -0
- moovio_sdk/utils/requestbodies.py +66 -0
- moovio_sdk/utils/retries.py +217 -0
- moovio_sdk/utils/security.py +195 -0
- moovio_sdk/utils/serializers.py +215 -0
- moovio_sdk/utils/url.py +155 -0
- moovio_sdk/utils/values.py +137 -0
- moovio_sdk/wallet_transactions.py +558 -0
- moovio_sdk/wallets.py +465 -0
- moovio_sdk-0.3.8.dist-info/METADATA +1920 -0
- moovio_sdk-0.3.8.dist-info/RECORD +586 -0
- moovio_sdk-0.3.8.dist-info/WHEEL +4 -0
@@ -0,0 +1,2445 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from moovio_sdk import utils
|
5
|
+
from moovio_sdk._hooks import HookContext
|
6
|
+
from moovio_sdk.models import components, errors, operations
|
7
|
+
from moovio_sdk.types import OptionalNullable, UNSET
|
8
|
+
from moovio_sdk.utils import get_security_from_env
|
9
|
+
from typing import Any, List, Mapping, Optional, Union
|
10
|
+
|
11
|
+
|
12
|
+
class BankAccounts(BaseSDK):
|
13
|
+
def link(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
account_id: str,
|
17
|
+
link_bank_account: Union[
|
18
|
+
components.LinkBankAccount, components.LinkBankAccountTypedDict
|
19
|
+
],
|
20
|
+
x_wait_for: Optional[components.BankAccountWaitFor] = None,
|
21
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
22
|
+
server_url: Optional[str] = None,
|
23
|
+
timeout_ms: Optional[int] = None,
|
24
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
25
|
+
) -> operations.LinkBankAccountResponse:
|
26
|
+
r"""Link a bank account to an existing Moov account. Read our [bank accounts guide](https://docs.moov.io/guides/sources/bank-accounts/) to learn more.
|
27
|
+
|
28
|
+
It is strongly recommended that callers include the `X-Wait-For` header, set to `payment-method`, if the newly linked
|
29
|
+
bank-account is intended to be used right away. If this header is not included, the caller will need to poll the [List Payment
|
30
|
+
Methods](https://docs.moov.io/api/sources/payment-methods/list/)
|
31
|
+
endpoint to wait for the new payment methods to be available for use.
|
32
|
+
|
33
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
34
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
35
|
+
|
36
|
+
:param account_id:
|
37
|
+
:param link_bank_account:
|
38
|
+
:param x_wait_for: Optional header to wait for certain events, such as the creation of a payment method, to occur before returning a response. When this header is set to `payment-method`, the response will include any payment methods that were created for the newly linked card in the `paymentMethods` field. Otherwise, the `paymentMethods` field will be omitted from the response.
|
39
|
+
:param retries: Override the default retry configuration for this method
|
40
|
+
:param server_url: Override the default server URL for this method
|
41
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
42
|
+
:param http_headers: Additional headers to set or replace on requests.
|
43
|
+
"""
|
44
|
+
base_url = None
|
45
|
+
url_variables = None
|
46
|
+
if timeout_ms is None:
|
47
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
48
|
+
|
49
|
+
if server_url is not None:
|
50
|
+
base_url = server_url
|
51
|
+
else:
|
52
|
+
base_url = self._get_url(base_url, url_variables)
|
53
|
+
|
54
|
+
request = operations.LinkBankAccountRequest(
|
55
|
+
x_wait_for=x_wait_for,
|
56
|
+
account_id=account_id,
|
57
|
+
link_bank_account=utils.get_pydantic_model(
|
58
|
+
link_bank_account, components.LinkBankAccount
|
59
|
+
),
|
60
|
+
)
|
61
|
+
|
62
|
+
req = self._build_request(
|
63
|
+
method="POST",
|
64
|
+
path="/accounts/{accountID}/bank-accounts",
|
65
|
+
base_url=base_url,
|
66
|
+
url_variables=url_variables,
|
67
|
+
request=request,
|
68
|
+
request_body_required=True,
|
69
|
+
request_has_path_params=True,
|
70
|
+
request_has_query_params=True,
|
71
|
+
user_agent_header="user-agent",
|
72
|
+
accept_header_value="application/json",
|
73
|
+
http_headers=http_headers,
|
74
|
+
_globals=operations.LinkBankAccountGlobals(
|
75
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
76
|
+
),
|
77
|
+
security=self.sdk_configuration.security,
|
78
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
79
|
+
request.link_bank_account,
|
80
|
+
False,
|
81
|
+
False,
|
82
|
+
"json",
|
83
|
+
components.LinkBankAccount,
|
84
|
+
),
|
85
|
+
timeout_ms=timeout_ms,
|
86
|
+
)
|
87
|
+
|
88
|
+
if retries == UNSET:
|
89
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
90
|
+
retries = self.sdk_configuration.retry_config
|
91
|
+
|
92
|
+
retry_config = None
|
93
|
+
if isinstance(retries, utils.RetryConfig):
|
94
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
95
|
+
|
96
|
+
http_res = self.do_request(
|
97
|
+
hook_ctx=HookContext(
|
98
|
+
base_url=base_url or "",
|
99
|
+
operation_id="linkBankAccount",
|
100
|
+
oauth2_scopes=[],
|
101
|
+
security_source=get_security_from_env(
|
102
|
+
self.sdk_configuration.security, components.Security
|
103
|
+
),
|
104
|
+
),
|
105
|
+
request=req,
|
106
|
+
error_status_codes=[
|
107
|
+
"400",
|
108
|
+
"401",
|
109
|
+
"403",
|
110
|
+
"404",
|
111
|
+
"409",
|
112
|
+
"422",
|
113
|
+
"429",
|
114
|
+
"4XX",
|
115
|
+
"500",
|
116
|
+
"504",
|
117
|
+
"5XX",
|
118
|
+
],
|
119
|
+
retry_config=retry_config,
|
120
|
+
)
|
121
|
+
|
122
|
+
response_data: Any = None
|
123
|
+
if utils.match_response(http_res, "200", "application/json"):
|
124
|
+
return operations.LinkBankAccountResponse(
|
125
|
+
result=utils.unmarshal_json(http_res.text, components.BankAccount),
|
126
|
+
headers=utils.get_response_headers(http_res.headers),
|
127
|
+
)
|
128
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
129
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
130
|
+
raise errors.GenericError(data=response_data)
|
131
|
+
if utils.match_response(http_res, "422", "application/json"):
|
132
|
+
response_data = utils.unmarshal_json(
|
133
|
+
http_res.text, errors.BankAccountValidationErrorData
|
134
|
+
)
|
135
|
+
raise errors.BankAccountValidationError(data=response_data)
|
136
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
137
|
+
http_res_text = utils.stream_to_text(http_res)
|
138
|
+
raise errors.APIError(
|
139
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
140
|
+
)
|
141
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
142
|
+
http_res_text = utils.stream_to_text(http_res)
|
143
|
+
raise errors.APIError(
|
144
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
145
|
+
)
|
146
|
+
if utils.match_response(http_res, "4XX", "*"):
|
147
|
+
http_res_text = utils.stream_to_text(http_res)
|
148
|
+
raise errors.APIError(
|
149
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
150
|
+
)
|
151
|
+
if utils.match_response(http_res, "5XX", "*"):
|
152
|
+
http_res_text = utils.stream_to_text(http_res)
|
153
|
+
raise errors.APIError(
|
154
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
155
|
+
)
|
156
|
+
|
157
|
+
content_type = http_res.headers.get("Content-Type")
|
158
|
+
http_res_text = utils.stream_to_text(http_res)
|
159
|
+
raise errors.APIError(
|
160
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
161
|
+
http_res.status_code,
|
162
|
+
http_res_text,
|
163
|
+
http_res,
|
164
|
+
)
|
165
|
+
|
166
|
+
async def link_async(
|
167
|
+
self,
|
168
|
+
*,
|
169
|
+
account_id: str,
|
170
|
+
link_bank_account: Union[
|
171
|
+
components.LinkBankAccount, components.LinkBankAccountTypedDict
|
172
|
+
],
|
173
|
+
x_wait_for: Optional[components.BankAccountWaitFor] = None,
|
174
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
175
|
+
server_url: Optional[str] = None,
|
176
|
+
timeout_ms: Optional[int] = None,
|
177
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
178
|
+
) -> operations.LinkBankAccountResponse:
|
179
|
+
r"""Link a bank account to an existing Moov account. Read our [bank accounts guide](https://docs.moov.io/guides/sources/bank-accounts/) to learn more.
|
180
|
+
|
181
|
+
It is strongly recommended that callers include the `X-Wait-For` header, set to `payment-method`, if the newly linked
|
182
|
+
bank-account is intended to be used right away. If this header is not included, the caller will need to poll the [List Payment
|
183
|
+
Methods](https://docs.moov.io/api/sources/payment-methods/list/)
|
184
|
+
endpoint to wait for the new payment methods to be available for use.
|
185
|
+
|
186
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
187
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
188
|
+
|
189
|
+
:param account_id:
|
190
|
+
:param link_bank_account:
|
191
|
+
:param x_wait_for: Optional header to wait for certain events, such as the creation of a payment method, to occur before returning a response. When this header is set to `payment-method`, the response will include any payment methods that were created for the newly linked card in the `paymentMethods` field. Otherwise, the `paymentMethods` field will be omitted from the response.
|
192
|
+
:param retries: Override the default retry configuration for this method
|
193
|
+
:param server_url: Override the default server URL for this method
|
194
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
195
|
+
:param http_headers: Additional headers to set or replace on requests.
|
196
|
+
"""
|
197
|
+
base_url = None
|
198
|
+
url_variables = None
|
199
|
+
if timeout_ms is None:
|
200
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
201
|
+
|
202
|
+
if server_url is not None:
|
203
|
+
base_url = server_url
|
204
|
+
else:
|
205
|
+
base_url = self._get_url(base_url, url_variables)
|
206
|
+
|
207
|
+
request = operations.LinkBankAccountRequest(
|
208
|
+
x_wait_for=x_wait_for,
|
209
|
+
account_id=account_id,
|
210
|
+
link_bank_account=utils.get_pydantic_model(
|
211
|
+
link_bank_account, components.LinkBankAccount
|
212
|
+
),
|
213
|
+
)
|
214
|
+
|
215
|
+
req = self._build_request_async(
|
216
|
+
method="POST",
|
217
|
+
path="/accounts/{accountID}/bank-accounts",
|
218
|
+
base_url=base_url,
|
219
|
+
url_variables=url_variables,
|
220
|
+
request=request,
|
221
|
+
request_body_required=True,
|
222
|
+
request_has_path_params=True,
|
223
|
+
request_has_query_params=True,
|
224
|
+
user_agent_header="user-agent",
|
225
|
+
accept_header_value="application/json",
|
226
|
+
http_headers=http_headers,
|
227
|
+
_globals=operations.LinkBankAccountGlobals(
|
228
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
229
|
+
),
|
230
|
+
security=self.sdk_configuration.security,
|
231
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
232
|
+
request.link_bank_account,
|
233
|
+
False,
|
234
|
+
False,
|
235
|
+
"json",
|
236
|
+
components.LinkBankAccount,
|
237
|
+
),
|
238
|
+
timeout_ms=timeout_ms,
|
239
|
+
)
|
240
|
+
|
241
|
+
if retries == UNSET:
|
242
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
243
|
+
retries = self.sdk_configuration.retry_config
|
244
|
+
|
245
|
+
retry_config = None
|
246
|
+
if isinstance(retries, utils.RetryConfig):
|
247
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
248
|
+
|
249
|
+
http_res = await self.do_request_async(
|
250
|
+
hook_ctx=HookContext(
|
251
|
+
base_url=base_url or "",
|
252
|
+
operation_id="linkBankAccount",
|
253
|
+
oauth2_scopes=[],
|
254
|
+
security_source=get_security_from_env(
|
255
|
+
self.sdk_configuration.security, components.Security
|
256
|
+
),
|
257
|
+
),
|
258
|
+
request=req,
|
259
|
+
error_status_codes=[
|
260
|
+
"400",
|
261
|
+
"401",
|
262
|
+
"403",
|
263
|
+
"404",
|
264
|
+
"409",
|
265
|
+
"422",
|
266
|
+
"429",
|
267
|
+
"4XX",
|
268
|
+
"500",
|
269
|
+
"504",
|
270
|
+
"5XX",
|
271
|
+
],
|
272
|
+
retry_config=retry_config,
|
273
|
+
)
|
274
|
+
|
275
|
+
response_data: Any = None
|
276
|
+
if utils.match_response(http_res, "200", "application/json"):
|
277
|
+
return operations.LinkBankAccountResponse(
|
278
|
+
result=utils.unmarshal_json(http_res.text, components.BankAccount),
|
279
|
+
headers=utils.get_response_headers(http_res.headers),
|
280
|
+
)
|
281
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
282
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
283
|
+
raise errors.GenericError(data=response_data)
|
284
|
+
if utils.match_response(http_res, "422", "application/json"):
|
285
|
+
response_data = utils.unmarshal_json(
|
286
|
+
http_res.text, errors.BankAccountValidationErrorData
|
287
|
+
)
|
288
|
+
raise errors.BankAccountValidationError(data=response_data)
|
289
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
290
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
291
|
+
raise errors.APIError(
|
292
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
293
|
+
)
|
294
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
295
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
296
|
+
raise errors.APIError(
|
297
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
298
|
+
)
|
299
|
+
if utils.match_response(http_res, "4XX", "*"):
|
300
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
301
|
+
raise errors.APIError(
|
302
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
303
|
+
)
|
304
|
+
if utils.match_response(http_res, "5XX", "*"):
|
305
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
306
|
+
raise errors.APIError(
|
307
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
308
|
+
)
|
309
|
+
|
310
|
+
content_type = http_res.headers.get("Content-Type")
|
311
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
312
|
+
raise errors.APIError(
|
313
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
314
|
+
http_res.status_code,
|
315
|
+
http_res_text,
|
316
|
+
http_res,
|
317
|
+
)
|
318
|
+
|
319
|
+
def list(
|
320
|
+
self,
|
321
|
+
*,
|
322
|
+
account_id: str,
|
323
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
324
|
+
server_url: Optional[str] = None,
|
325
|
+
timeout_ms: Optional[int] = None,
|
326
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
327
|
+
) -> operations.ListBankAccountsResponse:
|
328
|
+
r"""List all the bank accounts associated with a particular Moov account.
|
329
|
+
|
330
|
+
Read our [bank accounts guide](https://docs.moov.io/guides/sources/bank-accounts/) to learn more.
|
331
|
+
|
332
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
333
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.read` scope.
|
334
|
+
|
335
|
+
:param account_id:
|
336
|
+
:param retries: Override the default retry configuration for this method
|
337
|
+
:param server_url: Override the default server URL for this method
|
338
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
339
|
+
:param http_headers: Additional headers to set or replace on requests.
|
340
|
+
"""
|
341
|
+
base_url = None
|
342
|
+
url_variables = None
|
343
|
+
if timeout_ms is None:
|
344
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
345
|
+
|
346
|
+
if server_url is not None:
|
347
|
+
base_url = server_url
|
348
|
+
else:
|
349
|
+
base_url = self._get_url(base_url, url_variables)
|
350
|
+
|
351
|
+
request = operations.ListBankAccountsRequest(
|
352
|
+
account_id=account_id,
|
353
|
+
)
|
354
|
+
|
355
|
+
req = self._build_request(
|
356
|
+
method="GET",
|
357
|
+
path="/accounts/{accountID}/bank-accounts",
|
358
|
+
base_url=base_url,
|
359
|
+
url_variables=url_variables,
|
360
|
+
request=request,
|
361
|
+
request_body_required=False,
|
362
|
+
request_has_path_params=True,
|
363
|
+
request_has_query_params=True,
|
364
|
+
user_agent_header="user-agent",
|
365
|
+
accept_header_value="application/json",
|
366
|
+
http_headers=http_headers,
|
367
|
+
_globals=operations.ListBankAccountsGlobals(
|
368
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
369
|
+
),
|
370
|
+
security=self.sdk_configuration.security,
|
371
|
+
timeout_ms=timeout_ms,
|
372
|
+
)
|
373
|
+
|
374
|
+
if retries == UNSET:
|
375
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
376
|
+
retries = self.sdk_configuration.retry_config
|
377
|
+
|
378
|
+
retry_config = None
|
379
|
+
if isinstance(retries, utils.RetryConfig):
|
380
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
381
|
+
|
382
|
+
http_res = self.do_request(
|
383
|
+
hook_ctx=HookContext(
|
384
|
+
base_url=base_url or "",
|
385
|
+
operation_id="listBankAccounts",
|
386
|
+
oauth2_scopes=[],
|
387
|
+
security_source=get_security_from_env(
|
388
|
+
self.sdk_configuration.security, components.Security
|
389
|
+
),
|
390
|
+
),
|
391
|
+
request=req,
|
392
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
393
|
+
retry_config=retry_config,
|
394
|
+
)
|
395
|
+
|
396
|
+
if utils.match_response(http_res, "200", "application/json"):
|
397
|
+
return operations.ListBankAccountsResponse(
|
398
|
+
result=utils.unmarshal_json(
|
399
|
+
http_res.text, List[components.BankAccount]
|
400
|
+
),
|
401
|
+
headers=utils.get_response_headers(http_res.headers),
|
402
|
+
)
|
403
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
404
|
+
http_res_text = utils.stream_to_text(http_res)
|
405
|
+
raise errors.APIError(
|
406
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
407
|
+
)
|
408
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
409
|
+
http_res_text = utils.stream_to_text(http_res)
|
410
|
+
raise errors.APIError(
|
411
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
412
|
+
)
|
413
|
+
if utils.match_response(http_res, "4XX", "*"):
|
414
|
+
http_res_text = utils.stream_to_text(http_res)
|
415
|
+
raise errors.APIError(
|
416
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
417
|
+
)
|
418
|
+
if utils.match_response(http_res, "5XX", "*"):
|
419
|
+
http_res_text = utils.stream_to_text(http_res)
|
420
|
+
raise errors.APIError(
|
421
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
422
|
+
)
|
423
|
+
|
424
|
+
content_type = http_res.headers.get("Content-Type")
|
425
|
+
http_res_text = utils.stream_to_text(http_res)
|
426
|
+
raise errors.APIError(
|
427
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
428
|
+
http_res.status_code,
|
429
|
+
http_res_text,
|
430
|
+
http_res,
|
431
|
+
)
|
432
|
+
|
433
|
+
async def list_async(
|
434
|
+
self,
|
435
|
+
*,
|
436
|
+
account_id: str,
|
437
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
438
|
+
server_url: Optional[str] = None,
|
439
|
+
timeout_ms: Optional[int] = None,
|
440
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
441
|
+
) -> operations.ListBankAccountsResponse:
|
442
|
+
r"""List all the bank accounts associated with a particular Moov account.
|
443
|
+
|
444
|
+
Read our [bank accounts guide](https://docs.moov.io/guides/sources/bank-accounts/) to learn more.
|
445
|
+
|
446
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
447
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.read` scope.
|
448
|
+
|
449
|
+
:param account_id:
|
450
|
+
:param retries: Override the default retry configuration for this method
|
451
|
+
:param server_url: Override the default server URL for this method
|
452
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
453
|
+
:param http_headers: Additional headers to set or replace on requests.
|
454
|
+
"""
|
455
|
+
base_url = None
|
456
|
+
url_variables = None
|
457
|
+
if timeout_ms is None:
|
458
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
459
|
+
|
460
|
+
if server_url is not None:
|
461
|
+
base_url = server_url
|
462
|
+
else:
|
463
|
+
base_url = self._get_url(base_url, url_variables)
|
464
|
+
|
465
|
+
request = operations.ListBankAccountsRequest(
|
466
|
+
account_id=account_id,
|
467
|
+
)
|
468
|
+
|
469
|
+
req = self._build_request_async(
|
470
|
+
method="GET",
|
471
|
+
path="/accounts/{accountID}/bank-accounts",
|
472
|
+
base_url=base_url,
|
473
|
+
url_variables=url_variables,
|
474
|
+
request=request,
|
475
|
+
request_body_required=False,
|
476
|
+
request_has_path_params=True,
|
477
|
+
request_has_query_params=True,
|
478
|
+
user_agent_header="user-agent",
|
479
|
+
accept_header_value="application/json",
|
480
|
+
http_headers=http_headers,
|
481
|
+
_globals=operations.ListBankAccountsGlobals(
|
482
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
483
|
+
),
|
484
|
+
security=self.sdk_configuration.security,
|
485
|
+
timeout_ms=timeout_ms,
|
486
|
+
)
|
487
|
+
|
488
|
+
if retries == UNSET:
|
489
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
490
|
+
retries = self.sdk_configuration.retry_config
|
491
|
+
|
492
|
+
retry_config = None
|
493
|
+
if isinstance(retries, utils.RetryConfig):
|
494
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
495
|
+
|
496
|
+
http_res = await self.do_request_async(
|
497
|
+
hook_ctx=HookContext(
|
498
|
+
base_url=base_url or "",
|
499
|
+
operation_id="listBankAccounts",
|
500
|
+
oauth2_scopes=[],
|
501
|
+
security_source=get_security_from_env(
|
502
|
+
self.sdk_configuration.security, components.Security
|
503
|
+
),
|
504
|
+
),
|
505
|
+
request=req,
|
506
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
507
|
+
retry_config=retry_config,
|
508
|
+
)
|
509
|
+
|
510
|
+
if utils.match_response(http_res, "200", "application/json"):
|
511
|
+
return operations.ListBankAccountsResponse(
|
512
|
+
result=utils.unmarshal_json(
|
513
|
+
http_res.text, List[components.BankAccount]
|
514
|
+
),
|
515
|
+
headers=utils.get_response_headers(http_res.headers),
|
516
|
+
)
|
517
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
518
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
519
|
+
raise errors.APIError(
|
520
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
521
|
+
)
|
522
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
523
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
524
|
+
raise errors.APIError(
|
525
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
526
|
+
)
|
527
|
+
if utils.match_response(http_res, "4XX", "*"):
|
528
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
529
|
+
raise errors.APIError(
|
530
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
531
|
+
)
|
532
|
+
if utils.match_response(http_res, "5XX", "*"):
|
533
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
534
|
+
raise errors.APIError(
|
535
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
536
|
+
)
|
537
|
+
|
538
|
+
content_type = http_res.headers.get("Content-Type")
|
539
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
540
|
+
raise errors.APIError(
|
541
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
542
|
+
http_res.status_code,
|
543
|
+
http_res_text,
|
544
|
+
http_res,
|
545
|
+
)
|
546
|
+
|
547
|
+
def get(
|
548
|
+
self,
|
549
|
+
*,
|
550
|
+
account_id: str,
|
551
|
+
bank_account_id: str,
|
552
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
553
|
+
server_url: Optional[str] = None,
|
554
|
+
timeout_ms: Optional[int] = None,
|
555
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
556
|
+
) -> operations.GetBankAccountResponse:
|
557
|
+
r"""Retrieve bank account details (i.e. routing number or account type) associated with a specific Moov account.
|
558
|
+
|
559
|
+
Read our [bank accounts guide](https://docs.moov.io/guides/sources/bank-accounts/) to learn more.
|
560
|
+
|
561
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
562
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.read` scope.
|
563
|
+
|
564
|
+
:param account_id:
|
565
|
+
:param bank_account_id:
|
566
|
+
:param retries: Override the default retry configuration for this method
|
567
|
+
:param server_url: Override the default server URL for this method
|
568
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
569
|
+
:param http_headers: Additional headers to set or replace on requests.
|
570
|
+
"""
|
571
|
+
base_url = None
|
572
|
+
url_variables = None
|
573
|
+
if timeout_ms is None:
|
574
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
575
|
+
|
576
|
+
if server_url is not None:
|
577
|
+
base_url = server_url
|
578
|
+
else:
|
579
|
+
base_url = self._get_url(base_url, url_variables)
|
580
|
+
|
581
|
+
request = operations.GetBankAccountRequest(
|
582
|
+
account_id=account_id,
|
583
|
+
bank_account_id=bank_account_id,
|
584
|
+
)
|
585
|
+
|
586
|
+
req = self._build_request(
|
587
|
+
method="GET",
|
588
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}",
|
589
|
+
base_url=base_url,
|
590
|
+
url_variables=url_variables,
|
591
|
+
request=request,
|
592
|
+
request_body_required=False,
|
593
|
+
request_has_path_params=True,
|
594
|
+
request_has_query_params=True,
|
595
|
+
user_agent_header="user-agent",
|
596
|
+
accept_header_value="application/json",
|
597
|
+
http_headers=http_headers,
|
598
|
+
_globals=operations.GetBankAccountGlobals(
|
599
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
600
|
+
),
|
601
|
+
security=self.sdk_configuration.security,
|
602
|
+
timeout_ms=timeout_ms,
|
603
|
+
)
|
604
|
+
|
605
|
+
if retries == UNSET:
|
606
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
607
|
+
retries = self.sdk_configuration.retry_config
|
608
|
+
|
609
|
+
retry_config = None
|
610
|
+
if isinstance(retries, utils.RetryConfig):
|
611
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
612
|
+
|
613
|
+
http_res = self.do_request(
|
614
|
+
hook_ctx=HookContext(
|
615
|
+
base_url=base_url or "",
|
616
|
+
operation_id="getBankAccount",
|
617
|
+
oauth2_scopes=[],
|
618
|
+
security_source=get_security_from_env(
|
619
|
+
self.sdk_configuration.security, components.Security
|
620
|
+
),
|
621
|
+
),
|
622
|
+
request=req,
|
623
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
624
|
+
retry_config=retry_config,
|
625
|
+
)
|
626
|
+
|
627
|
+
if utils.match_response(http_res, "200", "application/json"):
|
628
|
+
return operations.GetBankAccountResponse(
|
629
|
+
result=utils.unmarshal_json(http_res.text, components.BankAccount),
|
630
|
+
headers=utils.get_response_headers(http_res.headers),
|
631
|
+
)
|
632
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
633
|
+
http_res_text = utils.stream_to_text(http_res)
|
634
|
+
raise errors.APIError(
|
635
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
636
|
+
)
|
637
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
638
|
+
http_res_text = utils.stream_to_text(http_res)
|
639
|
+
raise errors.APIError(
|
640
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
641
|
+
)
|
642
|
+
if utils.match_response(http_res, "4XX", "*"):
|
643
|
+
http_res_text = utils.stream_to_text(http_res)
|
644
|
+
raise errors.APIError(
|
645
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
646
|
+
)
|
647
|
+
if utils.match_response(http_res, "5XX", "*"):
|
648
|
+
http_res_text = utils.stream_to_text(http_res)
|
649
|
+
raise errors.APIError(
|
650
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
651
|
+
)
|
652
|
+
|
653
|
+
content_type = http_res.headers.get("Content-Type")
|
654
|
+
http_res_text = utils.stream_to_text(http_res)
|
655
|
+
raise errors.APIError(
|
656
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
657
|
+
http_res.status_code,
|
658
|
+
http_res_text,
|
659
|
+
http_res,
|
660
|
+
)
|
661
|
+
|
662
|
+
async def get_async(
|
663
|
+
self,
|
664
|
+
*,
|
665
|
+
account_id: str,
|
666
|
+
bank_account_id: str,
|
667
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
668
|
+
server_url: Optional[str] = None,
|
669
|
+
timeout_ms: Optional[int] = None,
|
670
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
671
|
+
) -> operations.GetBankAccountResponse:
|
672
|
+
r"""Retrieve bank account details (i.e. routing number or account type) associated with a specific Moov account.
|
673
|
+
|
674
|
+
Read our [bank accounts guide](https://docs.moov.io/guides/sources/bank-accounts/) to learn more.
|
675
|
+
|
676
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
677
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.read` scope.
|
678
|
+
|
679
|
+
:param account_id:
|
680
|
+
:param bank_account_id:
|
681
|
+
:param retries: Override the default retry configuration for this method
|
682
|
+
:param server_url: Override the default server URL for this method
|
683
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
684
|
+
:param http_headers: Additional headers to set or replace on requests.
|
685
|
+
"""
|
686
|
+
base_url = None
|
687
|
+
url_variables = None
|
688
|
+
if timeout_ms is None:
|
689
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
690
|
+
|
691
|
+
if server_url is not None:
|
692
|
+
base_url = server_url
|
693
|
+
else:
|
694
|
+
base_url = self._get_url(base_url, url_variables)
|
695
|
+
|
696
|
+
request = operations.GetBankAccountRequest(
|
697
|
+
account_id=account_id,
|
698
|
+
bank_account_id=bank_account_id,
|
699
|
+
)
|
700
|
+
|
701
|
+
req = self._build_request_async(
|
702
|
+
method="GET",
|
703
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}",
|
704
|
+
base_url=base_url,
|
705
|
+
url_variables=url_variables,
|
706
|
+
request=request,
|
707
|
+
request_body_required=False,
|
708
|
+
request_has_path_params=True,
|
709
|
+
request_has_query_params=True,
|
710
|
+
user_agent_header="user-agent",
|
711
|
+
accept_header_value="application/json",
|
712
|
+
http_headers=http_headers,
|
713
|
+
_globals=operations.GetBankAccountGlobals(
|
714
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
715
|
+
),
|
716
|
+
security=self.sdk_configuration.security,
|
717
|
+
timeout_ms=timeout_ms,
|
718
|
+
)
|
719
|
+
|
720
|
+
if retries == UNSET:
|
721
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
722
|
+
retries = self.sdk_configuration.retry_config
|
723
|
+
|
724
|
+
retry_config = None
|
725
|
+
if isinstance(retries, utils.RetryConfig):
|
726
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
727
|
+
|
728
|
+
http_res = await self.do_request_async(
|
729
|
+
hook_ctx=HookContext(
|
730
|
+
base_url=base_url or "",
|
731
|
+
operation_id="getBankAccount",
|
732
|
+
oauth2_scopes=[],
|
733
|
+
security_source=get_security_from_env(
|
734
|
+
self.sdk_configuration.security, components.Security
|
735
|
+
),
|
736
|
+
),
|
737
|
+
request=req,
|
738
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
739
|
+
retry_config=retry_config,
|
740
|
+
)
|
741
|
+
|
742
|
+
if utils.match_response(http_res, "200", "application/json"):
|
743
|
+
return operations.GetBankAccountResponse(
|
744
|
+
result=utils.unmarshal_json(http_res.text, components.BankAccount),
|
745
|
+
headers=utils.get_response_headers(http_res.headers),
|
746
|
+
)
|
747
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
748
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
749
|
+
raise errors.APIError(
|
750
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
751
|
+
)
|
752
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
753
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
754
|
+
raise errors.APIError(
|
755
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
756
|
+
)
|
757
|
+
if utils.match_response(http_res, "4XX", "*"):
|
758
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
759
|
+
raise errors.APIError(
|
760
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
761
|
+
)
|
762
|
+
if utils.match_response(http_res, "5XX", "*"):
|
763
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
764
|
+
raise errors.APIError(
|
765
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
766
|
+
)
|
767
|
+
|
768
|
+
content_type = http_res.headers.get("Content-Type")
|
769
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
770
|
+
raise errors.APIError(
|
771
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
772
|
+
http_res.status_code,
|
773
|
+
http_res_text,
|
774
|
+
http_res,
|
775
|
+
)
|
776
|
+
|
777
|
+
def disable(
|
778
|
+
self,
|
779
|
+
*,
|
780
|
+
account_id: str,
|
781
|
+
bank_account_id: str,
|
782
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
783
|
+
server_url: Optional[str] = None,
|
784
|
+
timeout_ms: Optional[int] = None,
|
785
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
786
|
+
) -> operations.DisableBankAccountResponse:
|
787
|
+
r"""Discontinue using a specified bank account linked to a Moov account.
|
788
|
+
|
789
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
790
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
791
|
+
|
792
|
+
:param account_id:
|
793
|
+
:param bank_account_id:
|
794
|
+
:param retries: Override the default retry configuration for this method
|
795
|
+
:param server_url: Override the default server URL for this method
|
796
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
797
|
+
:param http_headers: Additional headers to set or replace on requests.
|
798
|
+
"""
|
799
|
+
base_url = None
|
800
|
+
url_variables = None
|
801
|
+
if timeout_ms is None:
|
802
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
803
|
+
|
804
|
+
if server_url is not None:
|
805
|
+
base_url = server_url
|
806
|
+
else:
|
807
|
+
base_url = self._get_url(base_url, url_variables)
|
808
|
+
|
809
|
+
request = operations.DisableBankAccountRequest(
|
810
|
+
account_id=account_id,
|
811
|
+
bank_account_id=bank_account_id,
|
812
|
+
)
|
813
|
+
|
814
|
+
req = self._build_request(
|
815
|
+
method="DELETE",
|
816
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}",
|
817
|
+
base_url=base_url,
|
818
|
+
url_variables=url_variables,
|
819
|
+
request=request,
|
820
|
+
request_body_required=False,
|
821
|
+
request_has_path_params=True,
|
822
|
+
request_has_query_params=True,
|
823
|
+
user_agent_header="user-agent",
|
824
|
+
accept_header_value="application/json",
|
825
|
+
http_headers=http_headers,
|
826
|
+
_globals=operations.DisableBankAccountGlobals(
|
827
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
828
|
+
),
|
829
|
+
security=self.sdk_configuration.security,
|
830
|
+
timeout_ms=timeout_ms,
|
831
|
+
)
|
832
|
+
|
833
|
+
if retries == UNSET:
|
834
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
835
|
+
retries = self.sdk_configuration.retry_config
|
836
|
+
|
837
|
+
retry_config = None
|
838
|
+
if isinstance(retries, utils.RetryConfig):
|
839
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
840
|
+
|
841
|
+
http_res = self.do_request(
|
842
|
+
hook_ctx=HookContext(
|
843
|
+
base_url=base_url or "",
|
844
|
+
operation_id="disableBankAccount",
|
845
|
+
oauth2_scopes=[],
|
846
|
+
security_source=get_security_from_env(
|
847
|
+
self.sdk_configuration.security, components.Security
|
848
|
+
),
|
849
|
+
),
|
850
|
+
request=req,
|
851
|
+
error_status_codes=[
|
852
|
+
"400",
|
853
|
+
"401",
|
854
|
+
"403",
|
855
|
+
"404",
|
856
|
+
"409",
|
857
|
+
"429",
|
858
|
+
"4XX",
|
859
|
+
"500",
|
860
|
+
"504",
|
861
|
+
"5XX",
|
862
|
+
],
|
863
|
+
retry_config=retry_config,
|
864
|
+
)
|
865
|
+
|
866
|
+
response_data: Any = None
|
867
|
+
if utils.match_response(http_res, "204", "*"):
|
868
|
+
return operations.DisableBankAccountResponse(
|
869
|
+
headers=utils.get_response_headers(http_res.headers)
|
870
|
+
)
|
871
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
872
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
873
|
+
raise errors.GenericError(data=response_data)
|
874
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
875
|
+
http_res_text = utils.stream_to_text(http_res)
|
876
|
+
raise errors.APIError(
|
877
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
878
|
+
)
|
879
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
880
|
+
http_res_text = utils.stream_to_text(http_res)
|
881
|
+
raise errors.APIError(
|
882
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
883
|
+
)
|
884
|
+
if utils.match_response(http_res, "4XX", "*"):
|
885
|
+
http_res_text = utils.stream_to_text(http_res)
|
886
|
+
raise errors.APIError(
|
887
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
888
|
+
)
|
889
|
+
if utils.match_response(http_res, "5XX", "*"):
|
890
|
+
http_res_text = utils.stream_to_text(http_res)
|
891
|
+
raise errors.APIError(
|
892
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
893
|
+
)
|
894
|
+
|
895
|
+
content_type = http_res.headers.get("Content-Type")
|
896
|
+
http_res_text = utils.stream_to_text(http_res)
|
897
|
+
raise errors.APIError(
|
898
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
899
|
+
http_res.status_code,
|
900
|
+
http_res_text,
|
901
|
+
http_res,
|
902
|
+
)
|
903
|
+
|
904
|
+
async def disable_async(
|
905
|
+
self,
|
906
|
+
*,
|
907
|
+
account_id: str,
|
908
|
+
bank_account_id: str,
|
909
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
910
|
+
server_url: Optional[str] = None,
|
911
|
+
timeout_ms: Optional[int] = None,
|
912
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
913
|
+
) -> operations.DisableBankAccountResponse:
|
914
|
+
r"""Discontinue using a specified bank account linked to a Moov account.
|
915
|
+
|
916
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
917
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
918
|
+
|
919
|
+
:param account_id:
|
920
|
+
:param bank_account_id:
|
921
|
+
:param retries: Override the default retry configuration for this method
|
922
|
+
:param server_url: Override the default server URL for this method
|
923
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
924
|
+
:param http_headers: Additional headers to set or replace on requests.
|
925
|
+
"""
|
926
|
+
base_url = None
|
927
|
+
url_variables = None
|
928
|
+
if timeout_ms is None:
|
929
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
930
|
+
|
931
|
+
if server_url is not None:
|
932
|
+
base_url = server_url
|
933
|
+
else:
|
934
|
+
base_url = self._get_url(base_url, url_variables)
|
935
|
+
|
936
|
+
request = operations.DisableBankAccountRequest(
|
937
|
+
account_id=account_id,
|
938
|
+
bank_account_id=bank_account_id,
|
939
|
+
)
|
940
|
+
|
941
|
+
req = self._build_request_async(
|
942
|
+
method="DELETE",
|
943
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}",
|
944
|
+
base_url=base_url,
|
945
|
+
url_variables=url_variables,
|
946
|
+
request=request,
|
947
|
+
request_body_required=False,
|
948
|
+
request_has_path_params=True,
|
949
|
+
request_has_query_params=True,
|
950
|
+
user_agent_header="user-agent",
|
951
|
+
accept_header_value="application/json",
|
952
|
+
http_headers=http_headers,
|
953
|
+
_globals=operations.DisableBankAccountGlobals(
|
954
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
955
|
+
),
|
956
|
+
security=self.sdk_configuration.security,
|
957
|
+
timeout_ms=timeout_ms,
|
958
|
+
)
|
959
|
+
|
960
|
+
if retries == UNSET:
|
961
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
962
|
+
retries = self.sdk_configuration.retry_config
|
963
|
+
|
964
|
+
retry_config = None
|
965
|
+
if isinstance(retries, utils.RetryConfig):
|
966
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
967
|
+
|
968
|
+
http_res = await self.do_request_async(
|
969
|
+
hook_ctx=HookContext(
|
970
|
+
base_url=base_url or "",
|
971
|
+
operation_id="disableBankAccount",
|
972
|
+
oauth2_scopes=[],
|
973
|
+
security_source=get_security_from_env(
|
974
|
+
self.sdk_configuration.security, components.Security
|
975
|
+
),
|
976
|
+
),
|
977
|
+
request=req,
|
978
|
+
error_status_codes=[
|
979
|
+
"400",
|
980
|
+
"401",
|
981
|
+
"403",
|
982
|
+
"404",
|
983
|
+
"409",
|
984
|
+
"429",
|
985
|
+
"4XX",
|
986
|
+
"500",
|
987
|
+
"504",
|
988
|
+
"5XX",
|
989
|
+
],
|
990
|
+
retry_config=retry_config,
|
991
|
+
)
|
992
|
+
|
993
|
+
response_data: Any = None
|
994
|
+
if utils.match_response(http_res, "204", "*"):
|
995
|
+
return operations.DisableBankAccountResponse(
|
996
|
+
headers=utils.get_response_headers(http_res.headers)
|
997
|
+
)
|
998
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
999
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1000
|
+
raise errors.GenericError(data=response_data)
|
1001
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1002
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1003
|
+
raise errors.APIError(
|
1004
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1005
|
+
)
|
1006
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1007
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1008
|
+
raise errors.APIError(
|
1009
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1010
|
+
)
|
1011
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1012
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1013
|
+
raise errors.APIError(
|
1014
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1015
|
+
)
|
1016
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1017
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1018
|
+
raise errors.APIError(
|
1019
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1020
|
+
)
|
1021
|
+
|
1022
|
+
content_type = http_res.headers.get("Content-Type")
|
1023
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1024
|
+
raise errors.APIError(
|
1025
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1026
|
+
http_res.status_code,
|
1027
|
+
http_res_text,
|
1028
|
+
http_res,
|
1029
|
+
)
|
1030
|
+
|
1031
|
+
def initiate_micro_deposits(
|
1032
|
+
self,
|
1033
|
+
*,
|
1034
|
+
account_id: str,
|
1035
|
+
bank_account_id: str,
|
1036
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1037
|
+
server_url: Optional[str] = None,
|
1038
|
+
timeout_ms: Optional[int] = None,
|
1039
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1040
|
+
) -> operations.InitiateMicroDepositsResponse:
|
1041
|
+
r"""Micro-deposits help confirm bank account ownership, helping reduce fraud and the risk of unauthorized activity.
|
1042
|
+
Use this method to initiate the micro-deposit verification, sending two small credit transfers to the bank account
|
1043
|
+
you want to confirm.
|
1044
|
+
|
1045
|
+
If you request micro-deposits before 4:15PM ET, they will appear that same day. If you request micro-deposits any
|
1046
|
+
time after 4:15PM ET, they will appear the next banking day. When the two credits are initiated, Moov simultaneously
|
1047
|
+
initiates a debit to recoup the micro-deposits.
|
1048
|
+
|
1049
|
+
Micro-deposits initiated for a `sandbox` bank account will always be `$0.00` / `$0.00` and instantly verifiable once initiated.
|
1050
|
+
|
1051
|
+
You can simulate micro-deposit verification in test mode. See our [test mode](https://docs.moov.io/guides/get-started/test-mode/#micro-deposits)
|
1052
|
+
guide for more information.
|
1053
|
+
|
1054
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1055
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
1056
|
+
|
1057
|
+
:param account_id:
|
1058
|
+
:param bank_account_id:
|
1059
|
+
:param retries: Override the default retry configuration for this method
|
1060
|
+
:param server_url: Override the default server URL for this method
|
1061
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1062
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1063
|
+
"""
|
1064
|
+
base_url = None
|
1065
|
+
url_variables = None
|
1066
|
+
if timeout_ms is None:
|
1067
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1068
|
+
|
1069
|
+
if server_url is not None:
|
1070
|
+
base_url = server_url
|
1071
|
+
else:
|
1072
|
+
base_url = self._get_url(base_url, url_variables)
|
1073
|
+
|
1074
|
+
request = operations.InitiateMicroDepositsRequest(
|
1075
|
+
account_id=account_id,
|
1076
|
+
bank_account_id=bank_account_id,
|
1077
|
+
)
|
1078
|
+
|
1079
|
+
req = self._build_request(
|
1080
|
+
method="POST",
|
1081
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/micro-deposits",
|
1082
|
+
base_url=base_url,
|
1083
|
+
url_variables=url_variables,
|
1084
|
+
request=request,
|
1085
|
+
request_body_required=False,
|
1086
|
+
request_has_path_params=True,
|
1087
|
+
request_has_query_params=True,
|
1088
|
+
user_agent_header="user-agent",
|
1089
|
+
accept_header_value="application/json",
|
1090
|
+
http_headers=http_headers,
|
1091
|
+
_globals=operations.InitiateMicroDepositsGlobals(
|
1092
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1093
|
+
),
|
1094
|
+
security=self.sdk_configuration.security,
|
1095
|
+
timeout_ms=timeout_ms,
|
1096
|
+
)
|
1097
|
+
|
1098
|
+
if retries == UNSET:
|
1099
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1100
|
+
retries = self.sdk_configuration.retry_config
|
1101
|
+
|
1102
|
+
retry_config = None
|
1103
|
+
if isinstance(retries, utils.RetryConfig):
|
1104
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1105
|
+
|
1106
|
+
http_res = self.do_request(
|
1107
|
+
hook_ctx=HookContext(
|
1108
|
+
base_url=base_url or "",
|
1109
|
+
operation_id="initiateMicroDeposits",
|
1110
|
+
oauth2_scopes=[],
|
1111
|
+
security_source=get_security_from_env(
|
1112
|
+
self.sdk_configuration.security, components.Security
|
1113
|
+
),
|
1114
|
+
),
|
1115
|
+
request=req,
|
1116
|
+
error_status_codes=[
|
1117
|
+
"400",
|
1118
|
+
"401",
|
1119
|
+
"403",
|
1120
|
+
"404",
|
1121
|
+
"409",
|
1122
|
+
"429",
|
1123
|
+
"4XX",
|
1124
|
+
"500",
|
1125
|
+
"504",
|
1126
|
+
"5XX",
|
1127
|
+
],
|
1128
|
+
retry_config=retry_config,
|
1129
|
+
)
|
1130
|
+
|
1131
|
+
response_data: Any = None
|
1132
|
+
if utils.match_response(http_res, "204", "*"):
|
1133
|
+
return operations.InitiateMicroDepositsResponse(
|
1134
|
+
headers=utils.get_response_headers(http_res.headers)
|
1135
|
+
)
|
1136
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1137
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1138
|
+
raise errors.GenericError(data=response_data)
|
1139
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1140
|
+
http_res_text = utils.stream_to_text(http_res)
|
1141
|
+
raise errors.APIError(
|
1142
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1143
|
+
)
|
1144
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1145
|
+
http_res_text = utils.stream_to_text(http_res)
|
1146
|
+
raise errors.APIError(
|
1147
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1148
|
+
)
|
1149
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1150
|
+
http_res_text = utils.stream_to_text(http_res)
|
1151
|
+
raise errors.APIError(
|
1152
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1153
|
+
)
|
1154
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1155
|
+
http_res_text = utils.stream_to_text(http_res)
|
1156
|
+
raise errors.APIError(
|
1157
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1158
|
+
)
|
1159
|
+
|
1160
|
+
content_type = http_res.headers.get("Content-Type")
|
1161
|
+
http_res_text = utils.stream_to_text(http_res)
|
1162
|
+
raise errors.APIError(
|
1163
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1164
|
+
http_res.status_code,
|
1165
|
+
http_res_text,
|
1166
|
+
http_res,
|
1167
|
+
)
|
1168
|
+
|
1169
|
+
async def initiate_micro_deposits_async(
|
1170
|
+
self,
|
1171
|
+
*,
|
1172
|
+
account_id: str,
|
1173
|
+
bank_account_id: str,
|
1174
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1175
|
+
server_url: Optional[str] = None,
|
1176
|
+
timeout_ms: Optional[int] = None,
|
1177
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1178
|
+
) -> operations.InitiateMicroDepositsResponse:
|
1179
|
+
r"""Micro-deposits help confirm bank account ownership, helping reduce fraud and the risk of unauthorized activity.
|
1180
|
+
Use this method to initiate the micro-deposit verification, sending two small credit transfers to the bank account
|
1181
|
+
you want to confirm.
|
1182
|
+
|
1183
|
+
If you request micro-deposits before 4:15PM ET, they will appear that same day. If you request micro-deposits any
|
1184
|
+
time after 4:15PM ET, they will appear the next banking day. When the two credits are initiated, Moov simultaneously
|
1185
|
+
initiates a debit to recoup the micro-deposits.
|
1186
|
+
|
1187
|
+
Micro-deposits initiated for a `sandbox` bank account will always be `$0.00` / `$0.00` and instantly verifiable once initiated.
|
1188
|
+
|
1189
|
+
You can simulate micro-deposit verification in test mode. See our [test mode](https://docs.moov.io/guides/get-started/test-mode/#micro-deposits)
|
1190
|
+
guide for more information.
|
1191
|
+
|
1192
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1193
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
1194
|
+
|
1195
|
+
:param account_id:
|
1196
|
+
:param bank_account_id:
|
1197
|
+
:param retries: Override the default retry configuration for this method
|
1198
|
+
:param server_url: Override the default server URL for this method
|
1199
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1200
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1201
|
+
"""
|
1202
|
+
base_url = None
|
1203
|
+
url_variables = None
|
1204
|
+
if timeout_ms is None:
|
1205
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1206
|
+
|
1207
|
+
if server_url is not None:
|
1208
|
+
base_url = server_url
|
1209
|
+
else:
|
1210
|
+
base_url = self._get_url(base_url, url_variables)
|
1211
|
+
|
1212
|
+
request = operations.InitiateMicroDepositsRequest(
|
1213
|
+
account_id=account_id,
|
1214
|
+
bank_account_id=bank_account_id,
|
1215
|
+
)
|
1216
|
+
|
1217
|
+
req = self._build_request_async(
|
1218
|
+
method="POST",
|
1219
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/micro-deposits",
|
1220
|
+
base_url=base_url,
|
1221
|
+
url_variables=url_variables,
|
1222
|
+
request=request,
|
1223
|
+
request_body_required=False,
|
1224
|
+
request_has_path_params=True,
|
1225
|
+
request_has_query_params=True,
|
1226
|
+
user_agent_header="user-agent",
|
1227
|
+
accept_header_value="application/json",
|
1228
|
+
http_headers=http_headers,
|
1229
|
+
_globals=operations.InitiateMicroDepositsGlobals(
|
1230
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1231
|
+
),
|
1232
|
+
security=self.sdk_configuration.security,
|
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
|
+
base_url=base_url or "",
|
1247
|
+
operation_id="initiateMicroDeposits",
|
1248
|
+
oauth2_scopes=[],
|
1249
|
+
security_source=get_security_from_env(
|
1250
|
+
self.sdk_configuration.security, components.Security
|
1251
|
+
),
|
1252
|
+
),
|
1253
|
+
request=req,
|
1254
|
+
error_status_codes=[
|
1255
|
+
"400",
|
1256
|
+
"401",
|
1257
|
+
"403",
|
1258
|
+
"404",
|
1259
|
+
"409",
|
1260
|
+
"429",
|
1261
|
+
"4XX",
|
1262
|
+
"500",
|
1263
|
+
"504",
|
1264
|
+
"5XX",
|
1265
|
+
],
|
1266
|
+
retry_config=retry_config,
|
1267
|
+
)
|
1268
|
+
|
1269
|
+
response_data: Any = None
|
1270
|
+
if utils.match_response(http_res, "204", "*"):
|
1271
|
+
return operations.InitiateMicroDepositsResponse(
|
1272
|
+
headers=utils.get_response_headers(http_res.headers)
|
1273
|
+
)
|
1274
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1275
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1276
|
+
raise errors.GenericError(data=response_data)
|
1277
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1278
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1279
|
+
raise errors.APIError(
|
1280
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1281
|
+
)
|
1282
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1283
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1284
|
+
raise errors.APIError(
|
1285
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1286
|
+
)
|
1287
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1288
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1289
|
+
raise errors.APIError(
|
1290
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1291
|
+
)
|
1292
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1293
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1294
|
+
raise errors.APIError(
|
1295
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1296
|
+
)
|
1297
|
+
|
1298
|
+
content_type = http_res.headers.get("Content-Type")
|
1299
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1300
|
+
raise errors.APIError(
|
1301
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1302
|
+
http_res.status_code,
|
1303
|
+
http_res_text,
|
1304
|
+
http_res,
|
1305
|
+
)
|
1306
|
+
|
1307
|
+
def complete_micro_deposits(
|
1308
|
+
self,
|
1309
|
+
*,
|
1310
|
+
account_id: str,
|
1311
|
+
bank_account_id: str,
|
1312
|
+
amounts: List[int],
|
1313
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1314
|
+
server_url: Optional[str] = None,
|
1315
|
+
timeout_ms: Optional[int] = None,
|
1316
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1317
|
+
) -> operations.CompleteMicroDepositsResponse:
|
1318
|
+
r"""Complete the micro-deposit validation process by passing the amounts of the two transfers within three tries.
|
1319
|
+
|
1320
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1321
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
1322
|
+
|
1323
|
+
:param account_id:
|
1324
|
+
:param bank_account_id:
|
1325
|
+
:param amounts: Two positive integers, in cents, equal to the values of the micro-deposits sent to the bank account.
|
1326
|
+
:param retries: Override the default retry configuration for this method
|
1327
|
+
:param server_url: Override the default server URL for this method
|
1328
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1329
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1330
|
+
"""
|
1331
|
+
base_url = None
|
1332
|
+
url_variables = None
|
1333
|
+
if timeout_ms is None:
|
1334
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1335
|
+
|
1336
|
+
if server_url is not None:
|
1337
|
+
base_url = server_url
|
1338
|
+
else:
|
1339
|
+
base_url = self._get_url(base_url, url_variables)
|
1340
|
+
|
1341
|
+
request = operations.CompleteMicroDepositsRequest(
|
1342
|
+
account_id=account_id,
|
1343
|
+
bank_account_id=bank_account_id,
|
1344
|
+
complete_micro_deposits=components.CompleteMicroDeposits(
|
1345
|
+
amounts=amounts,
|
1346
|
+
),
|
1347
|
+
)
|
1348
|
+
|
1349
|
+
req = self._build_request(
|
1350
|
+
method="PUT",
|
1351
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/micro-deposits",
|
1352
|
+
base_url=base_url,
|
1353
|
+
url_variables=url_variables,
|
1354
|
+
request=request,
|
1355
|
+
request_body_required=True,
|
1356
|
+
request_has_path_params=True,
|
1357
|
+
request_has_query_params=True,
|
1358
|
+
user_agent_header="user-agent",
|
1359
|
+
accept_header_value="application/json",
|
1360
|
+
http_headers=http_headers,
|
1361
|
+
_globals=operations.CompleteMicroDepositsGlobals(
|
1362
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1363
|
+
),
|
1364
|
+
security=self.sdk_configuration.security,
|
1365
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1366
|
+
request.complete_micro_deposits,
|
1367
|
+
False,
|
1368
|
+
False,
|
1369
|
+
"json",
|
1370
|
+
components.CompleteMicroDeposits,
|
1371
|
+
),
|
1372
|
+
timeout_ms=timeout_ms,
|
1373
|
+
)
|
1374
|
+
|
1375
|
+
if retries == UNSET:
|
1376
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1377
|
+
retries = self.sdk_configuration.retry_config
|
1378
|
+
|
1379
|
+
retry_config = None
|
1380
|
+
if isinstance(retries, utils.RetryConfig):
|
1381
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1382
|
+
|
1383
|
+
http_res = self.do_request(
|
1384
|
+
hook_ctx=HookContext(
|
1385
|
+
base_url=base_url or "",
|
1386
|
+
operation_id="completeMicroDeposits",
|
1387
|
+
oauth2_scopes=[],
|
1388
|
+
security_source=get_security_from_env(
|
1389
|
+
self.sdk_configuration.security, components.Security
|
1390
|
+
),
|
1391
|
+
),
|
1392
|
+
request=req,
|
1393
|
+
error_status_codes=[
|
1394
|
+
"400",
|
1395
|
+
"401",
|
1396
|
+
"403",
|
1397
|
+
"404",
|
1398
|
+
"409",
|
1399
|
+
"422",
|
1400
|
+
"429",
|
1401
|
+
"4XX",
|
1402
|
+
"500",
|
1403
|
+
"504",
|
1404
|
+
"5XX",
|
1405
|
+
],
|
1406
|
+
retry_config=retry_config,
|
1407
|
+
)
|
1408
|
+
|
1409
|
+
response_data: Any = None
|
1410
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1411
|
+
return operations.CompleteMicroDepositsResponse(
|
1412
|
+
result=utils.unmarshal_json(
|
1413
|
+
http_res.text, components.CompletedMicroDeposits
|
1414
|
+
),
|
1415
|
+
headers=utils.get_response_headers(http_res.headers),
|
1416
|
+
)
|
1417
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1418
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1419
|
+
raise errors.GenericError(data=response_data)
|
1420
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1421
|
+
response_data = utils.unmarshal_json(
|
1422
|
+
http_res.text, errors.MicroDepositValidationErrorData
|
1423
|
+
)
|
1424
|
+
raise errors.MicroDepositValidationError(data=response_data)
|
1425
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1426
|
+
http_res_text = utils.stream_to_text(http_res)
|
1427
|
+
raise errors.APIError(
|
1428
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1429
|
+
)
|
1430
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1431
|
+
http_res_text = utils.stream_to_text(http_res)
|
1432
|
+
raise errors.APIError(
|
1433
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1434
|
+
)
|
1435
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1436
|
+
http_res_text = utils.stream_to_text(http_res)
|
1437
|
+
raise errors.APIError(
|
1438
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1439
|
+
)
|
1440
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1441
|
+
http_res_text = utils.stream_to_text(http_res)
|
1442
|
+
raise errors.APIError(
|
1443
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1444
|
+
)
|
1445
|
+
|
1446
|
+
content_type = http_res.headers.get("Content-Type")
|
1447
|
+
http_res_text = utils.stream_to_text(http_res)
|
1448
|
+
raise errors.APIError(
|
1449
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1450
|
+
http_res.status_code,
|
1451
|
+
http_res_text,
|
1452
|
+
http_res,
|
1453
|
+
)
|
1454
|
+
|
1455
|
+
async def complete_micro_deposits_async(
|
1456
|
+
self,
|
1457
|
+
*,
|
1458
|
+
account_id: str,
|
1459
|
+
bank_account_id: str,
|
1460
|
+
amounts: List[int],
|
1461
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1462
|
+
server_url: Optional[str] = None,
|
1463
|
+
timeout_ms: Optional[int] = None,
|
1464
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1465
|
+
) -> operations.CompleteMicroDepositsResponse:
|
1466
|
+
r"""Complete the micro-deposit validation process by passing the amounts of the two transfers within three tries.
|
1467
|
+
|
1468
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1469
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
1470
|
+
|
1471
|
+
:param account_id:
|
1472
|
+
:param bank_account_id:
|
1473
|
+
:param amounts: Two positive integers, in cents, equal to the values of the micro-deposits sent to the bank account.
|
1474
|
+
:param retries: Override the default retry configuration for this method
|
1475
|
+
:param server_url: Override the default server URL for this method
|
1476
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1477
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1478
|
+
"""
|
1479
|
+
base_url = None
|
1480
|
+
url_variables = None
|
1481
|
+
if timeout_ms is None:
|
1482
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1483
|
+
|
1484
|
+
if server_url is not None:
|
1485
|
+
base_url = server_url
|
1486
|
+
else:
|
1487
|
+
base_url = self._get_url(base_url, url_variables)
|
1488
|
+
|
1489
|
+
request = operations.CompleteMicroDepositsRequest(
|
1490
|
+
account_id=account_id,
|
1491
|
+
bank_account_id=bank_account_id,
|
1492
|
+
complete_micro_deposits=components.CompleteMicroDeposits(
|
1493
|
+
amounts=amounts,
|
1494
|
+
),
|
1495
|
+
)
|
1496
|
+
|
1497
|
+
req = self._build_request_async(
|
1498
|
+
method="PUT",
|
1499
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/micro-deposits",
|
1500
|
+
base_url=base_url,
|
1501
|
+
url_variables=url_variables,
|
1502
|
+
request=request,
|
1503
|
+
request_body_required=True,
|
1504
|
+
request_has_path_params=True,
|
1505
|
+
request_has_query_params=True,
|
1506
|
+
user_agent_header="user-agent",
|
1507
|
+
accept_header_value="application/json",
|
1508
|
+
http_headers=http_headers,
|
1509
|
+
_globals=operations.CompleteMicroDepositsGlobals(
|
1510
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1511
|
+
),
|
1512
|
+
security=self.sdk_configuration.security,
|
1513
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1514
|
+
request.complete_micro_deposits,
|
1515
|
+
False,
|
1516
|
+
False,
|
1517
|
+
"json",
|
1518
|
+
components.CompleteMicroDeposits,
|
1519
|
+
),
|
1520
|
+
timeout_ms=timeout_ms,
|
1521
|
+
)
|
1522
|
+
|
1523
|
+
if retries == UNSET:
|
1524
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1525
|
+
retries = self.sdk_configuration.retry_config
|
1526
|
+
|
1527
|
+
retry_config = None
|
1528
|
+
if isinstance(retries, utils.RetryConfig):
|
1529
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1530
|
+
|
1531
|
+
http_res = await self.do_request_async(
|
1532
|
+
hook_ctx=HookContext(
|
1533
|
+
base_url=base_url or "",
|
1534
|
+
operation_id="completeMicroDeposits",
|
1535
|
+
oauth2_scopes=[],
|
1536
|
+
security_source=get_security_from_env(
|
1537
|
+
self.sdk_configuration.security, components.Security
|
1538
|
+
),
|
1539
|
+
),
|
1540
|
+
request=req,
|
1541
|
+
error_status_codes=[
|
1542
|
+
"400",
|
1543
|
+
"401",
|
1544
|
+
"403",
|
1545
|
+
"404",
|
1546
|
+
"409",
|
1547
|
+
"422",
|
1548
|
+
"429",
|
1549
|
+
"4XX",
|
1550
|
+
"500",
|
1551
|
+
"504",
|
1552
|
+
"5XX",
|
1553
|
+
],
|
1554
|
+
retry_config=retry_config,
|
1555
|
+
)
|
1556
|
+
|
1557
|
+
response_data: Any = None
|
1558
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1559
|
+
return operations.CompleteMicroDepositsResponse(
|
1560
|
+
result=utils.unmarshal_json(
|
1561
|
+
http_res.text, components.CompletedMicroDeposits
|
1562
|
+
),
|
1563
|
+
headers=utils.get_response_headers(http_res.headers),
|
1564
|
+
)
|
1565
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1566
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1567
|
+
raise errors.GenericError(data=response_data)
|
1568
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1569
|
+
response_data = utils.unmarshal_json(
|
1570
|
+
http_res.text, errors.MicroDepositValidationErrorData
|
1571
|
+
)
|
1572
|
+
raise errors.MicroDepositValidationError(data=response_data)
|
1573
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1574
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1575
|
+
raise errors.APIError(
|
1576
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1577
|
+
)
|
1578
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1579
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1580
|
+
raise errors.APIError(
|
1581
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1582
|
+
)
|
1583
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1584
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1585
|
+
raise errors.APIError(
|
1586
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1587
|
+
)
|
1588
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1589
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1590
|
+
raise errors.APIError(
|
1591
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1592
|
+
)
|
1593
|
+
|
1594
|
+
content_type = http_res.headers.get("Content-Type")
|
1595
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1596
|
+
raise errors.APIError(
|
1597
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1598
|
+
http_res.status_code,
|
1599
|
+
http_res_text,
|
1600
|
+
http_res,
|
1601
|
+
)
|
1602
|
+
|
1603
|
+
def get_verification(
|
1604
|
+
self,
|
1605
|
+
*,
|
1606
|
+
account_id: str,
|
1607
|
+
bank_account_id: str,
|
1608
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1609
|
+
server_url: Optional[str] = None,
|
1610
|
+
timeout_ms: Optional[int] = None,
|
1611
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1612
|
+
) -> operations.GetBankAccountVerificationResponse:
|
1613
|
+
r"""Retrieve the current status and details of an instant verification, including whether the verification method was instant or same-day
|
1614
|
+
ACH. This helps track the verification process in real-time and provides details in case of exceptions.
|
1615
|
+
|
1616
|
+
The status will indicate the following:
|
1617
|
+
|
1618
|
+
- `new`: Verification initiated, credit pending to the payment network
|
1619
|
+
- `sent-credit`: Credit sent, available for verification
|
1620
|
+
- `failed`: Verification failed, description provided, user needs to add a new bank account
|
1621
|
+
- `expired`: Verification expired after 14 days, initiate another verification
|
1622
|
+
- `max-attempts-exceeded`: Five incorrect code attempts exhausted, initiate another verification
|
1623
|
+
|
1624
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1625
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.read` scope.
|
1626
|
+
|
1627
|
+
:param account_id:
|
1628
|
+
:param bank_account_id:
|
1629
|
+
:param retries: Override the default retry configuration for this method
|
1630
|
+
:param server_url: Override the default server URL for this method
|
1631
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1632
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1633
|
+
"""
|
1634
|
+
base_url = None
|
1635
|
+
url_variables = None
|
1636
|
+
if timeout_ms is None:
|
1637
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1638
|
+
|
1639
|
+
if server_url is not None:
|
1640
|
+
base_url = server_url
|
1641
|
+
else:
|
1642
|
+
base_url = self._get_url(base_url, url_variables)
|
1643
|
+
|
1644
|
+
request = operations.GetBankAccountVerificationRequest(
|
1645
|
+
account_id=account_id,
|
1646
|
+
bank_account_id=bank_account_id,
|
1647
|
+
)
|
1648
|
+
|
1649
|
+
req = self._build_request(
|
1650
|
+
method="GET",
|
1651
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/verify",
|
1652
|
+
base_url=base_url,
|
1653
|
+
url_variables=url_variables,
|
1654
|
+
request=request,
|
1655
|
+
request_body_required=False,
|
1656
|
+
request_has_path_params=True,
|
1657
|
+
request_has_query_params=True,
|
1658
|
+
user_agent_header="user-agent",
|
1659
|
+
accept_header_value="application/json",
|
1660
|
+
http_headers=http_headers,
|
1661
|
+
_globals=operations.GetBankAccountVerificationGlobals(
|
1662
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1663
|
+
),
|
1664
|
+
security=self.sdk_configuration.security,
|
1665
|
+
timeout_ms=timeout_ms,
|
1666
|
+
)
|
1667
|
+
|
1668
|
+
if retries == UNSET:
|
1669
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1670
|
+
retries = self.sdk_configuration.retry_config
|
1671
|
+
|
1672
|
+
retry_config = None
|
1673
|
+
if isinstance(retries, utils.RetryConfig):
|
1674
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1675
|
+
|
1676
|
+
http_res = self.do_request(
|
1677
|
+
hook_ctx=HookContext(
|
1678
|
+
base_url=base_url or "",
|
1679
|
+
operation_id="getBankAccountVerification",
|
1680
|
+
oauth2_scopes=[],
|
1681
|
+
security_source=get_security_from_env(
|
1682
|
+
self.sdk_configuration.security, components.Security
|
1683
|
+
),
|
1684
|
+
),
|
1685
|
+
request=req,
|
1686
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
1687
|
+
retry_config=retry_config,
|
1688
|
+
)
|
1689
|
+
|
1690
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1691
|
+
return operations.GetBankAccountVerificationResponse(
|
1692
|
+
result=utils.unmarshal_json(
|
1693
|
+
http_res.text, components.BankAccountVerification
|
1694
|
+
),
|
1695
|
+
headers=utils.get_response_headers(http_res.headers),
|
1696
|
+
)
|
1697
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1698
|
+
http_res_text = utils.stream_to_text(http_res)
|
1699
|
+
raise errors.APIError(
|
1700
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1701
|
+
)
|
1702
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1703
|
+
http_res_text = utils.stream_to_text(http_res)
|
1704
|
+
raise errors.APIError(
|
1705
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1706
|
+
)
|
1707
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1708
|
+
http_res_text = utils.stream_to_text(http_res)
|
1709
|
+
raise errors.APIError(
|
1710
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1711
|
+
)
|
1712
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1713
|
+
http_res_text = utils.stream_to_text(http_res)
|
1714
|
+
raise errors.APIError(
|
1715
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1716
|
+
)
|
1717
|
+
|
1718
|
+
content_type = http_res.headers.get("Content-Type")
|
1719
|
+
http_res_text = utils.stream_to_text(http_res)
|
1720
|
+
raise errors.APIError(
|
1721
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1722
|
+
http_res.status_code,
|
1723
|
+
http_res_text,
|
1724
|
+
http_res,
|
1725
|
+
)
|
1726
|
+
|
1727
|
+
async def get_verification_async(
|
1728
|
+
self,
|
1729
|
+
*,
|
1730
|
+
account_id: str,
|
1731
|
+
bank_account_id: str,
|
1732
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1733
|
+
server_url: Optional[str] = None,
|
1734
|
+
timeout_ms: Optional[int] = None,
|
1735
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1736
|
+
) -> operations.GetBankAccountVerificationResponse:
|
1737
|
+
r"""Retrieve the current status and details of an instant verification, including whether the verification method was instant or same-day
|
1738
|
+
ACH. This helps track the verification process in real-time and provides details in case of exceptions.
|
1739
|
+
|
1740
|
+
The status will indicate the following:
|
1741
|
+
|
1742
|
+
- `new`: Verification initiated, credit pending to the payment network
|
1743
|
+
- `sent-credit`: Credit sent, available for verification
|
1744
|
+
- `failed`: Verification failed, description provided, user needs to add a new bank account
|
1745
|
+
- `expired`: Verification expired after 14 days, initiate another verification
|
1746
|
+
- `max-attempts-exceeded`: Five incorrect code attempts exhausted, initiate another verification
|
1747
|
+
|
1748
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1749
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.read` scope.
|
1750
|
+
|
1751
|
+
:param account_id:
|
1752
|
+
:param bank_account_id:
|
1753
|
+
:param retries: Override the default retry configuration for this method
|
1754
|
+
:param server_url: Override the default server URL for this method
|
1755
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1756
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1757
|
+
"""
|
1758
|
+
base_url = None
|
1759
|
+
url_variables = None
|
1760
|
+
if timeout_ms is None:
|
1761
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1762
|
+
|
1763
|
+
if server_url is not None:
|
1764
|
+
base_url = server_url
|
1765
|
+
else:
|
1766
|
+
base_url = self._get_url(base_url, url_variables)
|
1767
|
+
|
1768
|
+
request = operations.GetBankAccountVerificationRequest(
|
1769
|
+
account_id=account_id,
|
1770
|
+
bank_account_id=bank_account_id,
|
1771
|
+
)
|
1772
|
+
|
1773
|
+
req = self._build_request_async(
|
1774
|
+
method="GET",
|
1775
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/verify",
|
1776
|
+
base_url=base_url,
|
1777
|
+
url_variables=url_variables,
|
1778
|
+
request=request,
|
1779
|
+
request_body_required=False,
|
1780
|
+
request_has_path_params=True,
|
1781
|
+
request_has_query_params=True,
|
1782
|
+
user_agent_header="user-agent",
|
1783
|
+
accept_header_value="application/json",
|
1784
|
+
http_headers=http_headers,
|
1785
|
+
_globals=operations.GetBankAccountVerificationGlobals(
|
1786
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1787
|
+
),
|
1788
|
+
security=self.sdk_configuration.security,
|
1789
|
+
timeout_ms=timeout_ms,
|
1790
|
+
)
|
1791
|
+
|
1792
|
+
if retries == UNSET:
|
1793
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1794
|
+
retries = self.sdk_configuration.retry_config
|
1795
|
+
|
1796
|
+
retry_config = None
|
1797
|
+
if isinstance(retries, utils.RetryConfig):
|
1798
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1799
|
+
|
1800
|
+
http_res = await self.do_request_async(
|
1801
|
+
hook_ctx=HookContext(
|
1802
|
+
base_url=base_url or "",
|
1803
|
+
operation_id="getBankAccountVerification",
|
1804
|
+
oauth2_scopes=[],
|
1805
|
+
security_source=get_security_from_env(
|
1806
|
+
self.sdk_configuration.security, components.Security
|
1807
|
+
),
|
1808
|
+
),
|
1809
|
+
request=req,
|
1810
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
1811
|
+
retry_config=retry_config,
|
1812
|
+
)
|
1813
|
+
|
1814
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1815
|
+
return operations.GetBankAccountVerificationResponse(
|
1816
|
+
result=utils.unmarshal_json(
|
1817
|
+
http_res.text, components.BankAccountVerification
|
1818
|
+
),
|
1819
|
+
headers=utils.get_response_headers(http_res.headers),
|
1820
|
+
)
|
1821
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1822
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1823
|
+
raise errors.APIError(
|
1824
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1825
|
+
)
|
1826
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1827
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1828
|
+
raise errors.APIError(
|
1829
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1830
|
+
)
|
1831
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1832
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1833
|
+
raise errors.APIError(
|
1834
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1835
|
+
)
|
1836
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1837
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1838
|
+
raise errors.APIError(
|
1839
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1840
|
+
)
|
1841
|
+
|
1842
|
+
content_type = http_res.headers.get("Content-Type")
|
1843
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1844
|
+
raise errors.APIError(
|
1845
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1846
|
+
http_res.status_code,
|
1847
|
+
http_res_text,
|
1848
|
+
http_res,
|
1849
|
+
)
|
1850
|
+
|
1851
|
+
def initiate_verification(
|
1852
|
+
self,
|
1853
|
+
*,
|
1854
|
+
account_id: str,
|
1855
|
+
bank_account_id: str,
|
1856
|
+
x_wait_for: Optional[components.BankAccountWaitFor] = None,
|
1857
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1858
|
+
server_url: Optional[str] = None,
|
1859
|
+
timeout_ms: Optional[int] = None,
|
1860
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1861
|
+
) -> operations.InitiateBankAccountVerificationResponse:
|
1862
|
+
r"""Instant micro-deposit verification offers a quick and efficient way to verify bank account ownership.
|
1863
|
+
|
1864
|
+
Send a $0.01 credit with a unique verification code via RTP or same-day ACH, depending on the receiving bank's capabilities. This
|
1865
|
+
feature provides a faster alternative to traditional methods, allowing verification in a single session.
|
1866
|
+
|
1867
|
+
It is recommended to use the `X-Wait-For: rail-response` header to synchronously receive the outcome of the instant credit in the
|
1868
|
+
response payload.
|
1869
|
+
|
1870
|
+
Possible verification methods:
|
1871
|
+
- `instant`: Real-time verification credit sent via RTP
|
1872
|
+
- `ach`: Verification credit sent via same-day ACH
|
1873
|
+
|
1874
|
+
Possible statuses:
|
1875
|
+
- `new`: Verification initiated, credit pending
|
1876
|
+
- `sent-credit`: Credit sent, available for verification in the external bank account
|
1877
|
+
- `failed`: Verification failed due to credit rejection/return, details in `exceptionDetails`
|
1878
|
+
|
1879
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1880
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
1881
|
+
|
1882
|
+
:param account_id:
|
1883
|
+
:param bank_account_id:
|
1884
|
+
:param x_wait_for: Optional header to wait for certain events, such as the rail response, to occur before returning a response. When this header is set to `rail-response`, the endpoint will wait for a sent-credit or failed status from the payment rail.
|
1885
|
+
:param retries: Override the default retry configuration for this method
|
1886
|
+
:param server_url: Override the default server URL for this method
|
1887
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1888
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1889
|
+
"""
|
1890
|
+
base_url = None
|
1891
|
+
url_variables = None
|
1892
|
+
if timeout_ms is None:
|
1893
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1894
|
+
|
1895
|
+
if server_url is not None:
|
1896
|
+
base_url = server_url
|
1897
|
+
else:
|
1898
|
+
base_url = self._get_url(base_url, url_variables)
|
1899
|
+
|
1900
|
+
request = operations.InitiateBankAccountVerificationRequest(
|
1901
|
+
x_wait_for=x_wait_for,
|
1902
|
+
account_id=account_id,
|
1903
|
+
bank_account_id=bank_account_id,
|
1904
|
+
)
|
1905
|
+
|
1906
|
+
req = self._build_request(
|
1907
|
+
method="POST",
|
1908
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/verify",
|
1909
|
+
base_url=base_url,
|
1910
|
+
url_variables=url_variables,
|
1911
|
+
request=request,
|
1912
|
+
request_body_required=False,
|
1913
|
+
request_has_path_params=True,
|
1914
|
+
request_has_query_params=True,
|
1915
|
+
user_agent_header="user-agent",
|
1916
|
+
accept_header_value="application/json",
|
1917
|
+
http_headers=http_headers,
|
1918
|
+
_globals=operations.InitiateBankAccountVerificationGlobals(
|
1919
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1920
|
+
),
|
1921
|
+
security=self.sdk_configuration.security,
|
1922
|
+
timeout_ms=timeout_ms,
|
1923
|
+
)
|
1924
|
+
|
1925
|
+
if retries == UNSET:
|
1926
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1927
|
+
retries = self.sdk_configuration.retry_config
|
1928
|
+
|
1929
|
+
retry_config = None
|
1930
|
+
if isinstance(retries, utils.RetryConfig):
|
1931
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1932
|
+
|
1933
|
+
http_res = self.do_request(
|
1934
|
+
hook_ctx=HookContext(
|
1935
|
+
base_url=base_url or "",
|
1936
|
+
operation_id="initiateBankAccountVerification",
|
1937
|
+
oauth2_scopes=[],
|
1938
|
+
security_source=get_security_from_env(
|
1939
|
+
self.sdk_configuration.security, components.Security
|
1940
|
+
),
|
1941
|
+
),
|
1942
|
+
request=req,
|
1943
|
+
error_status_codes=[
|
1944
|
+
"400",
|
1945
|
+
"401",
|
1946
|
+
"403",
|
1947
|
+
"404",
|
1948
|
+
"409",
|
1949
|
+
"429",
|
1950
|
+
"4XX",
|
1951
|
+
"500",
|
1952
|
+
"504",
|
1953
|
+
"5XX",
|
1954
|
+
],
|
1955
|
+
retry_config=retry_config,
|
1956
|
+
)
|
1957
|
+
|
1958
|
+
response_data: Any = None
|
1959
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1960
|
+
return operations.InitiateBankAccountVerificationResponse(
|
1961
|
+
result=utils.unmarshal_json(
|
1962
|
+
http_res.text, components.BankAccountVerificationCreated
|
1963
|
+
),
|
1964
|
+
headers=utils.get_response_headers(http_res.headers),
|
1965
|
+
)
|
1966
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1967
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1968
|
+
raise errors.GenericError(data=response_data)
|
1969
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1970
|
+
http_res_text = utils.stream_to_text(http_res)
|
1971
|
+
raise errors.APIError(
|
1972
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1973
|
+
)
|
1974
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1975
|
+
http_res_text = utils.stream_to_text(http_res)
|
1976
|
+
raise errors.APIError(
|
1977
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1978
|
+
)
|
1979
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1980
|
+
http_res_text = utils.stream_to_text(http_res)
|
1981
|
+
raise errors.APIError(
|
1982
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1983
|
+
)
|
1984
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1985
|
+
http_res_text = utils.stream_to_text(http_res)
|
1986
|
+
raise errors.APIError(
|
1987
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1988
|
+
)
|
1989
|
+
|
1990
|
+
content_type = http_res.headers.get("Content-Type")
|
1991
|
+
http_res_text = utils.stream_to_text(http_res)
|
1992
|
+
raise errors.APIError(
|
1993
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1994
|
+
http_res.status_code,
|
1995
|
+
http_res_text,
|
1996
|
+
http_res,
|
1997
|
+
)
|
1998
|
+
|
1999
|
+
async def initiate_verification_async(
|
2000
|
+
self,
|
2001
|
+
*,
|
2002
|
+
account_id: str,
|
2003
|
+
bank_account_id: str,
|
2004
|
+
x_wait_for: Optional[components.BankAccountWaitFor] = None,
|
2005
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
2006
|
+
server_url: Optional[str] = None,
|
2007
|
+
timeout_ms: Optional[int] = None,
|
2008
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
2009
|
+
) -> operations.InitiateBankAccountVerificationResponse:
|
2010
|
+
r"""Instant micro-deposit verification offers a quick and efficient way to verify bank account ownership.
|
2011
|
+
|
2012
|
+
Send a $0.01 credit with a unique verification code via RTP or same-day ACH, depending on the receiving bank's capabilities. This
|
2013
|
+
feature provides a faster alternative to traditional methods, allowing verification in a single session.
|
2014
|
+
|
2015
|
+
It is recommended to use the `X-Wait-For: rail-response` header to synchronously receive the outcome of the instant credit in the
|
2016
|
+
response payload.
|
2017
|
+
|
2018
|
+
Possible verification methods:
|
2019
|
+
- `instant`: Real-time verification credit sent via RTP
|
2020
|
+
- `ach`: Verification credit sent via same-day ACH
|
2021
|
+
|
2022
|
+
Possible statuses:
|
2023
|
+
- `new`: Verification initiated, credit pending
|
2024
|
+
- `sent-credit`: Credit sent, available for verification in the external bank account
|
2025
|
+
- `failed`: Verification failed due to credit rejection/return, details in `exceptionDetails`
|
2026
|
+
|
2027
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
2028
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
2029
|
+
|
2030
|
+
:param account_id:
|
2031
|
+
:param bank_account_id:
|
2032
|
+
:param x_wait_for: Optional header to wait for certain events, such as the rail response, to occur before returning a response. When this header is set to `rail-response`, the endpoint will wait for a sent-credit or failed status from the payment rail.
|
2033
|
+
:param retries: Override the default retry configuration for this method
|
2034
|
+
:param server_url: Override the default server URL for this method
|
2035
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
2036
|
+
:param http_headers: Additional headers to set or replace on requests.
|
2037
|
+
"""
|
2038
|
+
base_url = None
|
2039
|
+
url_variables = None
|
2040
|
+
if timeout_ms is None:
|
2041
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
2042
|
+
|
2043
|
+
if server_url is not None:
|
2044
|
+
base_url = server_url
|
2045
|
+
else:
|
2046
|
+
base_url = self._get_url(base_url, url_variables)
|
2047
|
+
|
2048
|
+
request = operations.InitiateBankAccountVerificationRequest(
|
2049
|
+
x_wait_for=x_wait_for,
|
2050
|
+
account_id=account_id,
|
2051
|
+
bank_account_id=bank_account_id,
|
2052
|
+
)
|
2053
|
+
|
2054
|
+
req = self._build_request_async(
|
2055
|
+
method="POST",
|
2056
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/verify",
|
2057
|
+
base_url=base_url,
|
2058
|
+
url_variables=url_variables,
|
2059
|
+
request=request,
|
2060
|
+
request_body_required=False,
|
2061
|
+
request_has_path_params=True,
|
2062
|
+
request_has_query_params=True,
|
2063
|
+
user_agent_header="user-agent",
|
2064
|
+
accept_header_value="application/json",
|
2065
|
+
http_headers=http_headers,
|
2066
|
+
_globals=operations.InitiateBankAccountVerificationGlobals(
|
2067
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
2068
|
+
),
|
2069
|
+
security=self.sdk_configuration.security,
|
2070
|
+
timeout_ms=timeout_ms,
|
2071
|
+
)
|
2072
|
+
|
2073
|
+
if retries == UNSET:
|
2074
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
2075
|
+
retries = self.sdk_configuration.retry_config
|
2076
|
+
|
2077
|
+
retry_config = None
|
2078
|
+
if isinstance(retries, utils.RetryConfig):
|
2079
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
2080
|
+
|
2081
|
+
http_res = await self.do_request_async(
|
2082
|
+
hook_ctx=HookContext(
|
2083
|
+
base_url=base_url or "",
|
2084
|
+
operation_id="initiateBankAccountVerification",
|
2085
|
+
oauth2_scopes=[],
|
2086
|
+
security_source=get_security_from_env(
|
2087
|
+
self.sdk_configuration.security, components.Security
|
2088
|
+
),
|
2089
|
+
),
|
2090
|
+
request=req,
|
2091
|
+
error_status_codes=[
|
2092
|
+
"400",
|
2093
|
+
"401",
|
2094
|
+
"403",
|
2095
|
+
"404",
|
2096
|
+
"409",
|
2097
|
+
"429",
|
2098
|
+
"4XX",
|
2099
|
+
"500",
|
2100
|
+
"504",
|
2101
|
+
"5XX",
|
2102
|
+
],
|
2103
|
+
retry_config=retry_config,
|
2104
|
+
)
|
2105
|
+
|
2106
|
+
response_data: Any = None
|
2107
|
+
if utils.match_response(http_res, "200", "application/json"):
|
2108
|
+
return operations.InitiateBankAccountVerificationResponse(
|
2109
|
+
result=utils.unmarshal_json(
|
2110
|
+
http_res.text, components.BankAccountVerificationCreated
|
2111
|
+
),
|
2112
|
+
headers=utils.get_response_headers(http_res.headers),
|
2113
|
+
)
|
2114
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
2115
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
2116
|
+
raise errors.GenericError(data=response_data)
|
2117
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
2118
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2119
|
+
raise errors.APIError(
|
2120
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2121
|
+
)
|
2122
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
2123
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2124
|
+
raise errors.APIError(
|
2125
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2126
|
+
)
|
2127
|
+
if utils.match_response(http_res, "4XX", "*"):
|
2128
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2129
|
+
raise errors.APIError(
|
2130
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2131
|
+
)
|
2132
|
+
if utils.match_response(http_res, "5XX", "*"):
|
2133
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2134
|
+
raise errors.APIError(
|
2135
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2136
|
+
)
|
2137
|
+
|
2138
|
+
content_type = http_res.headers.get("Content-Type")
|
2139
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2140
|
+
raise errors.APIError(
|
2141
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
2142
|
+
http_res.status_code,
|
2143
|
+
http_res_text,
|
2144
|
+
http_res,
|
2145
|
+
)
|
2146
|
+
|
2147
|
+
def complete_verification(
|
2148
|
+
self,
|
2149
|
+
*,
|
2150
|
+
account_id: str,
|
2151
|
+
bank_account_id: str,
|
2152
|
+
code: str,
|
2153
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
2154
|
+
server_url: Optional[str] = None,
|
2155
|
+
timeout_ms: Optional[int] = None,
|
2156
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
2157
|
+
) -> operations.CompleteBankAccountVerificationResponse:
|
2158
|
+
r"""Finalize the instant micro-deposit verification by submitting the verification code displayed in the user's bank account.
|
2159
|
+
|
2160
|
+
Upon successful verification, the bank account status will be updated to `verified` and eligible for ACH debit transactions.
|
2161
|
+
|
2162
|
+
The following formats are accepted:
|
2163
|
+
- `MV0000`
|
2164
|
+
- `mv0000`
|
2165
|
+
- `0000`
|
2166
|
+
|
2167
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
2168
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
2169
|
+
|
2170
|
+
:param account_id:
|
2171
|
+
:param bank_account_id:
|
2172
|
+
:param code: Code provided by user from their bank account transactions
|
2173
|
+
:param retries: Override the default retry configuration for this method
|
2174
|
+
:param server_url: Override the default server URL for this method
|
2175
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
2176
|
+
:param http_headers: Additional headers to set or replace on requests.
|
2177
|
+
"""
|
2178
|
+
base_url = None
|
2179
|
+
url_variables = None
|
2180
|
+
if timeout_ms is None:
|
2181
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
2182
|
+
|
2183
|
+
if server_url is not None:
|
2184
|
+
base_url = server_url
|
2185
|
+
else:
|
2186
|
+
base_url = self._get_url(base_url, url_variables)
|
2187
|
+
|
2188
|
+
request = operations.CompleteBankAccountVerificationRequest(
|
2189
|
+
account_id=account_id,
|
2190
|
+
bank_account_id=bank_account_id,
|
2191
|
+
complete_bank_account_verification=components.CompleteBankAccountVerification(
|
2192
|
+
code=code,
|
2193
|
+
),
|
2194
|
+
)
|
2195
|
+
|
2196
|
+
req = self._build_request(
|
2197
|
+
method="PUT",
|
2198
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/verify",
|
2199
|
+
base_url=base_url,
|
2200
|
+
url_variables=url_variables,
|
2201
|
+
request=request,
|
2202
|
+
request_body_required=True,
|
2203
|
+
request_has_path_params=True,
|
2204
|
+
request_has_query_params=True,
|
2205
|
+
user_agent_header="user-agent",
|
2206
|
+
accept_header_value="application/json",
|
2207
|
+
http_headers=http_headers,
|
2208
|
+
_globals=operations.CompleteBankAccountVerificationGlobals(
|
2209
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
2210
|
+
),
|
2211
|
+
security=self.sdk_configuration.security,
|
2212
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
2213
|
+
request.complete_bank_account_verification,
|
2214
|
+
False,
|
2215
|
+
False,
|
2216
|
+
"json",
|
2217
|
+
components.CompleteBankAccountVerification,
|
2218
|
+
),
|
2219
|
+
timeout_ms=timeout_ms,
|
2220
|
+
)
|
2221
|
+
|
2222
|
+
if retries == UNSET:
|
2223
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
2224
|
+
retries = self.sdk_configuration.retry_config
|
2225
|
+
|
2226
|
+
retry_config = None
|
2227
|
+
if isinstance(retries, utils.RetryConfig):
|
2228
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
2229
|
+
|
2230
|
+
http_res = self.do_request(
|
2231
|
+
hook_ctx=HookContext(
|
2232
|
+
base_url=base_url or "",
|
2233
|
+
operation_id="completeBankAccountVerification",
|
2234
|
+
oauth2_scopes=[],
|
2235
|
+
security_source=get_security_from_env(
|
2236
|
+
self.sdk_configuration.security, components.Security
|
2237
|
+
),
|
2238
|
+
),
|
2239
|
+
request=req,
|
2240
|
+
error_status_codes=[
|
2241
|
+
"400",
|
2242
|
+
"401",
|
2243
|
+
"403",
|
2244
|
+
"404",
|
2245
|
+
"409",
|
2246
|
+
"422",
|
2247
|
+
"429",
|
2248
|
+
"4XX",
|
2249
|
+
"500",
|
2250
|
+
"504",
|
2251
|
+
"5XX",
|
2252
|
+
],
|
2253
|
+
retry_config=retry_config,
|
2254
|
+
)
|
2255
|
+
|
2256
|
+
response_data: Any = None
|
2257
|
+
if utils.match_response(http_res, "200", "application/json"):
|
2258
|
+
return operations.CompleteBankAccountVerificationResponse(
|
2259
|
+
result=utils.unmarshal_json(
|
2260
|
+
http_res.text, components.BankAccountVerification
|
2261
|
+
),
|
2262
|
+
headers=utils.get_response_headers(http_res.headers),
|
2263
|
+
)
|
2264
|
+
if utils.match_response(http_res, ["400", "409", "422"], "application/json"):
|
2265
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
2266
|
+
raise errors.GenericError(data=response_data)
|
2267
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
2268
|
+
http_res_text = utils.stream_to_text(http_res)
|
2269
|
+
raise errors.APIError(
|
2270
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2271
|
+
)
|
2272
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
2273
|
+
http_res_text = utils.stream_to_text(http_res)
|
2274
|
+
raise errors.APIError(
|
2275
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2276
|
+
)
|
2277
|
+
if utils.match_response(http_res, "4XX", "*"):
|
2278
|
+
http_res_text = utils.stream_to_text(http_res)
|
2279
|
+
raise errors.APIError(
|
2280
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2281
|
+
)
|
2282
|
+
if utils.match_response(http_res, "5XX", "*"):
|
2283
|
+
http_res_text = utils.stream_to_text(http_res)
|
2284
|
+
raise errors.APIError(
|
2285
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2286
|
+
)
|
2287
|
+
|
2288
|
+
content_type = http_res.headers.get("Content-Type")
|
2289
|
+
http_res_text = utils.stream_to_text(http_res)
|
2290
|
+
raise errors.APIError(
|
2291
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
2292
|
+
http_res.status_code,
|
2293
|
+
http_res_text,
|
2294
|
+
http_res,
|
2295
|
+
)
|
2296
|
+
|
2297
|
+
async def complete_verification_async(
|
2298
|
+
self,
|
2299
|
+
*,
|
2300
|
+
account_id: str,
|
2301
|
+
bank_account_id: str,
|
2302
|
+
code: str,
|
2303
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
2304
|
+
server_url: Optional[str] = None,
|
2305
|
+
timeout_ms: Optional[int] = None,
|
2306
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
2307
|
+
) -> operations.CompleteBankAccountVerificationResponse:
|
2308
|
+
r"""Finalize the instant micro-deposit verification by submitting the verification code displayed in the user's bank account.
|
2309
|
+
|
2310
|
+
Upon successful verification, the bank account status will be updated to `verified` and eligible for ACH debit transactions.
|
2311
|
+
|
2312
|
+
The following formats are accepted:
|
2313
|
+
- `MV0000`
|
2314
|
+
- `mv0000`
|
2315
|
+
- `0000`
|
2316
|
+
|
2317
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
2318
|
+
you'll need to specify the `/accounts/{accountID}/bank-accounts.write` scope.
|
2319
|
+
|
2320
|
+
:param account_id:
|
2321
|
+
:param bank_account_id:
|
2322
|
+
:param code: Code provided by user from their bank account transactions
|
2323
|
+
:param retries: Override the default retry configuration for this method
|
2324
|
+
:param server_url: Override the default server URL for this method
|
2325
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
2326
|
+
:param http_headers: Additional headers to set or replace on requests.
|
2327
|
+
"""
|
2328
|
+
base_url = None
|
2329
|
+
url_variables = None
|
2330
|
+
if timeout_ms is None:
|
2331
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
2332
|
+
|
2333
|
+
if server_url is not None:
|
2334
|
+
base_url = server_url
|
2335
|
+
else:
|
2336
|
+
base_url = self._get_url(base_url, url_variables)
|
2337
|
+
|
2338
|
+
request = operations.CompleteBankAccountVerificationRequest(
|
2339
|
+
account_id=account_id,
|
2340
|
+
bank_account_id=bank_account_id,
|
2341
|
+
complete_bank_account_verification=components.CompleteBankAccountVerification(
|
2342
|
+
code=code,
|
2343
|
+
),
|
2344
|
+
)
|
2345
|
+
|
2346
|
+
req = self._build_request_async(
|
2347
|
+
method="PUT",
|
2348
|
+
path="/accounts/{accountID}/bank-accounts/{bankAccountID}/verify",
|
2349
|
+
base_url=base_url,
|
2350
|
+
url_variables=url_variables,
|
2351
|
+
request=request,
|
2352
|
+
request_body_required=True,
|
2353
|
+
request_has_path_params=True,
|
2354
|
+
request_has_query_params=True,
|
2355
|
+
user_agent_header="user-agent",
|
2356
|
+
accept_header_value="application/json",
|
2357
|
+
http_headers=http_headers,
|
2358
|
+
_globals=operations.CompleteBankAccountVerificationGlobals(
|
2359
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
2360
|
+
),
|
2361
|
+
security=self.sdk_configuration.security,
|
2362
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
2363
|
+
request.complete_bank_account_verification,
|
2364
|
+
False,
|
2365
|
+
False,
|
2366
|
+
"json",
|
2367
|
+
components.CompleteBankAccountVerification,
|
2368
|
+
),
|
2369
|
+
timeout_ms=timeout_ms,
|
2370
|
+
)
|
2371
|
+
|
2372
|
+
if retries == UNSET:
|
2373
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
2374
|
+
retries = self.sdk_configuration.retry_config
|
2375
|
+
|
2376
|
+
retry_config = None
|
2377
|
+
if isinstance(retries, utils.RetryConfig):
|
2378
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
2379
|
+
|
2380
|
+
http_res = await self.do_request_async(
|
2381
|
+
hook_ctx=HookContext(
|
2382
|
+
base_url=base_url or "",
|
2383
|
+
operation_id="completeBankAccountVerification",
|
2384
|
+
oauth2_scopes=[],
|
2385
|
+
security_source=get_security_from_env(
|
2386
|
+
self.sdk_configuration.security, components.Security
|
2387
|
+
),
|
2388
|
+
),
|
2389
|
+
request=req,
|
2390
|
+
error_status_codes=[
|
2391
|
+
"400",
|
2392
|
+
"401",
|
2393
|
+
"403",
|
2394
|
+
"404",
|
2395
|
+
"409",
|
2396
|
+
"422",
|
2397
|
+
"429",
|
2398
|
+
"4XX",
|
2399
|
+
"500",
|
2400
|
+
"504",
|
2401
|
+
"5XX",
|
2402
|
+
],
|
2403
|
+
retry_config=retry_config,
|
2404
|
+
)
|
2405
|
+
|
2406
|
+
response_data: Any = None
|
2407
|
+
if utils.match_response(http_res, "200", "application/json"):
|
2408
|
+
return operations.CompleteBankAccountVerificationResponse(
|
2409
|
+
result=utils.unmarshal_json(
|
2410
|
+
http_res.text, components.BankAccountVerification
|
2411
|
+
),
|
2412
|
+
headers=utils.get_response_headers(http_res.headers),
|
2413
|
+
)
|
2414
|
+
if utils.match_response(http_res, ["400", "409", "422"], "application/json"):
|
2415
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
2416
|
+
raise errors.GenericError(data=response_data)
|
2417
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
2418
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2419
|
+
raise errors.APIError(
|
2420
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2421
|
+
)
|
2422
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
2423
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2424
|
+
raise errors.APIError(
|
2425
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2426
|
+
)
|
2427
|
+
if utils.match_response(http_res, "4XX", "*"):
|
2428
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2429
|
+
raise errors.APIError(
|
2430
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2431
|
+
)
|
2432
|
+
if utils.match_response(http_res, "5XX", "*"):
|
2433
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2434
|
+
raise errors.APIError(
|
2435
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
2436
|
+
)
|
2437
|
+
|
2438
|
+
content_type = http_res.headers.get("Content-Type")
|
2439
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
2440
|
+
raise errors.APIError(
|
2441
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
2442
|
+
http_res.status_code,
|
2443
|
+
http_res_text,
|
2444
|
+
http_res,
|
2445
|
+
)
|