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
moovio_sdk/cards.py
ADDED
@@ -0,0 +1,1469 @@
|
|
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 Cards(BaseSDK):
|
13
|
+
def link(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
account_id: str,
|
17
|
+
card_number: str,
|
18
|
+
card_cvv: str,
|
19
|
+
expiration: Union[
|
20
|
+
components.CardExpiration, components.CardExpirationTypedDict
|
21
|
+
],
|
22
|
+
billing_address: Union[components.CardAddress, components.CardAddressTypedDict],
|
23
|
+
x_wait_for: Optional[components.LinkCardWaitFor] = None,
|
24
|
+
e2ee: Optional[
|
25
|
+
Union[components.E2EEToken, components.E2EETokenTypedDict]
|
26
|
+
] = None,
|
27
|
+
holder_name: Optional[str] = None,
|
28
|
+
card_on_file: Optional[bool] = None,
|
29
|
+
merchant_account_id: Optional[str] = None,
|
30
|
+
verify_name: Optional[bool] = None,
|
31
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
32
|
+
server_url: Optional[str] = None,
|
33
|
+
timeout_ms: Optional[int] = None,
|
34
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
35
|
+
) -> operations.LinkCardResponse:
|
36
|
+
r"""Link a card to an existing Moov account.
|
37
|
+
|
38
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/#link-a-card) to learn more.
|
39
|
+
|
40
|
+
Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.
|
41
|
+
|
42
|
+
During card linking, the provided data will be verified by submitting a $0 authorization (account verification) request.
|
43
|
+
If `merchantAccountID` is provided, the authorization request will contain that account's statement descriptor and address.
|
44
|
+
Otherwise, the platform account's profile will be used. If no statement descriptor has been set, the authorization will
|
45
|
+
use the account's name instead.
|
46
|
+
|
47
|
+
It is strongly recommended that callers include the `X-Wait-For` header, set to `payment-method`, if the newly linked
|
48
|
+
card is intended to be used right away. If this header is not included, the caller will need to poll the [List Payment
|
49
|
+
Methods](https://docs.moov.io/api/sources/payment-methods/list/)
|
50
|
+
endpoint to wait for the new payment methods to be available for use.
|
51
|
+
|
52
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
53
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
54
|
+
|
55
|
+
:param account_id:
|
56
|
+
:param card_number:
|
57
|
+
:param card_cvv:
|
58
|
+
:param expiration: The expiration date of the card or token.
|
59
|
+
:param billing_address:
|
60
|
+
: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.
|
61
|
+
:param e2ee: Wraps a compact-serialized JSON Web Encryption (JWE) token used for secure transmission of sensitive data (e.g., PCI information) through intermediaries. This token is encrypted using the public key from /end-to-end-keys and wraps an AES key. For details and examples, refer to our [GitHub repository](https://github.com/moovfinancial/moov-go/blob/main/examples/e2ee/e2ee_test.go).
|
62
|
+
:param holder_name:
|
63
|
+
:param card_on_file:
|
64
|
+
:param merchant_account_id:
|
65
|
+
:param verify_name:
|
66
|
+
:param retries: Override the default retry configuration for this method
|
67
|
+
:param server_url: Override the default server URL for this method
|
68
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
69
|
+
:param http_headers: Additional headers to set or replace on requests.
|
70
|
+
"""
|
71
|
+
base_url = None
|
72
|
+
url_variables = None
|
73
|
+
if timeout_ms is None:
|
74
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
75
|
+
|
76
|
+
if server_url is not None:
|
77
|
+
base_url = server_url
|
78
|
+
else:
|
79
|
+
base_url = self._get_url(base_url, url_variables)
|
80
|
+
|
81
|
+
request = operations.LinkCardRequest(
|
82
|
+
x_wait_for=x_wait_for,
|
83
|
+
account_id=account_id,
|
84
|
+
link_card=components.LinkCard(
|
85
|
+
e2ee=utils.get_pydantic_model(e2ee, Optional[components.E2EEToken]),
|
86
|
+
card_number=card_number,
|
87
|
+
card_cvv=card_cvv,
|
88
|
+
expiration=utils.get_pydantic_model(
|
89
|
+
expiration, components.CardExpiration
|
90
|
+
),
|
91
|
+
holder_name=holder_name,
|
92
|
+
billing_address=utils.get_pydantic_model(
|
93
|
+
billing_address, components.CardAddress
|
94
|
+
),
|
95
|
+
card_on_file=card_on_file,
|
96
|
+
merchant_account_id=merchant_account_id,
|
97
|
+
verify_name=verify_name,
|
98
|
+
),
|
99
|
+
)
|
100
|
+
|
101
|
+
req = self._build_request(
|
102
|
+
method="POST",
|
103
|
+
path="/accounts/{accountID}/cards",
|
104
|
+
base_url=base_url,
|
105
|
+
url_variables=url_variables,
|
106
|
+
request=request,
|
107
|
+
request_body_required=True,
|
108
|
+
request_has_path_params=True,
|
109
|
+
request_has_query_params=True,
|
110
|
+
user_agent_header="user-agent",
|
111
|
+
accept_header_value="application/json",
|
112
|
+
http_headers=http_headers,
|
113
|
+
_globals=operations.LinkCardGlobals(
|
114
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
115
|
+
),
|
116
|
+
security=self.sdk_configuration.security,
|
117
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
118
|
+
request.link_card, False, False, "json", components.LinkCard
|
119
|
+
),
|
120
|
+
timeout_ms=timeout_ms,
|
121
|
+
)
|
122
|
+
|
123
|
+
if retries == UNSET:
|
124
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
125
|
+
retries = self.sdk_configuration.retry_config
|
126
|
+
|
127
|
+
retry_config = None
|
128
|
+
if isinstance(retries, utils.RetryConfig):
|
129
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
130
|
+
|
131
|
+
http_res = self.do_request(
|
132
|
+
hook_ctx=HookContext(
|
133
|
+
base_url=base_url or "",
|
134
|
+
operation_id="linkCard",
|
135
|
+
oauth2_scopes=[],
|
136
|
+
security_source=get_security_from_env(
|
137
|
+
self.sdk_configuration.security, components.Security
|
138
|
+
),
|
139
|
+
),
|
140
|
+
request=req,
|
141
|
+
error_status_codes=[
|
142
|
+
"400",
|
143
|
+
"401",
|
144
|
+
"403",
|
145
|
+
"404",
|
146
|
+
"409",
|
147
|
+
"422",
|
148
|
+
"429",
|
149
|
+
"4XX",
|
150
|
+
"500",
|
151
|
+
"504",
|
152
|
+
"5XX",
|
153
|
+
],
|
154
|
+
retry_config=retry_config,
|
155
|
+
)
|
156
|
+
|
157
|
+
response_data: Any = None
|
158
|
+
if utils.match_response(http_res, "200", "application/json"):
|
159
|
+
return operations.LinkCardResponse(
|
160
|
+
result=utils.unmarshal_json(http_res.text, components.Card),
|
161
|
+
headers=utils.get_response_headers(http_res.headers),
|
162
|
+
)
|
163
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
164
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
165
|
+
raise errors.GenericError(data=response_data)
|
166
|
+
if utils.match_response(http_res, "422", "application/json"):
|
167
|
+
response_data = utils.unmarshal_json(
|
168
|
+
http_res.text, errors.LinkCardErrorData
|
169
|
+
)
|
170
|
+
raise errors.LinkCardError(data=response_data)
|
171
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
172
|
+
http_res_text = utils.stream_to_text(http_res)
|
173
|
+
raise errors.APIError(
|
174
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
175
|
+
)
|
176
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
177
|
+
http_res_text = utils.stream_to_text(http_res)
|
178
|
+
raise errors.APIError(
|
179
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
180
|
+
)
|
181
|
+
if utils.match_response(http_res, "4XX", "*"):
|
182
|
+
http_res_text = utils.stream_to_text(http_res)
|
183
|
+
raise errors.APIError(
|
184
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
185
|
+
)
|
186
|
+
if utils.match_response(http_res, "5XX", "*"):
|
187
|
+
http_res_text = utils.stream_to_text(http_res)
|
188
|
+
raise errors.APIError(
|
189
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
190
|
+
)
|
191
|
+
|
192
|
+
content_type = http_res.headers.get("Content-Type")
|
193
|
+
http_res_text = utils.stream_to_text(http_res)
|
194
|
+
raise errors.APIError(
|
195
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
196
|
+
http_res.status_code,
|
197
|
+
http_res_text,
|
198
|
+
http_res,
|
199
|
+
)
|
200
|
+
|
201
|
+
async def link_async(
|
202
|
+
self,
|
203
|
+
*,
|
204
|
+
account_id: str,
|
205
|
+
card_number: str,
|
206
|
+
card_cvv: str,
|
207
|
+
expiration: Union[
|
208
|
+
components.CardExpiration, components.CardExpirationTypedDict
|
209
|
+
],
|
210
|
+
billing_address: Union[components.CardAddress, components.CardAddressTypedDict],
|
211
|
+
x_wait_for: Optional[components.LinkCardWaitFor] = None,
|
212
|
+
e2ee: Optional[
|
213
|
+
Union[components.E2EEToken, components.E2EETokenTypedDict]
|
214
|
+
] = None,
|
215
|
+
holder_name: Optional[str] = None,
|
216
|
+
card_on_file: Optional[bool] = None,
|
217
|
+
merchant_account_id: Optional[str] = None,
|
218
|
+
verify_name: Optional[bool] = None,
|
219
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
220
|
+
server_url: Optional[str] = None,
|
221
|
+
timeout_ms: Optional[int] = None,
|
222
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
223
|
+
) -> operations.LinkCardResponse:
|
224
|
+
r"""Link a card to an existing Moov account.
|
225
|
+
|
226
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/#link-a-card) to learn more.
|
227
|
+
|
228
|
+
Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.
|
229
|
+
|
230
|
+
During card linking, the provided data will be verified by submitting a $0 authorization (account verification) request.
|
231
|
+
If `merchantAccountID` is provided, the authorization request will contain that account's statement descriptor and address.
|
232
|
+
Otherwise, the platform account's profile will be used. If no statement descriptor has been set, the authorization will
|
233
|
+
use the account's name instead.
|
234
|
+
|
235
|
+
It is strongly recommended that callers include the `X-Wait-For` header, set to `payment-method`, if the newly linked
|
236
|
+
card is intended to be used right away. If this header is not included, the caller will need to poll the [List Payment
|
237
|
+
Methods](https://docs.moov.io/api/sources/payment-methods/list/)
|
238
|
+
endpoint to wait for the new payment methods to be available for use.
|
239
|
+
|
240
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
241
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
242
|
+
|
243
|
+
:param account_id:
|
244
|
+
:param card_number:
|
245
|
+
:param card_cvv:
|
246
|
+
:param expiration: The expiration date of the card or token.
|
247
|
+
:param billing_address:
|
248
|
+
: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.
|
249
|
+
:param e2ee: Wraps a compact-serialized JSON Web Encryption (JWE) token used for secure transmission of sensitive data (e.g., PCI information) through intermediaries. This token is encrypted using the public key from /end-to-end-keys and wraps an AES key. For details and examples, refer to our [GitHub repository](https://github.com/moovfinancial/moov-go/blob/main/examples/e2ee/e2ee_test.go).
|
250
|
+
:param holder_name:
|
251
|
+
:param card_on_file:
|
252
|
+
:param merchant_account_id:
|
253
|
+
:param verify_name:
|
254
|
+
:param retries: Override the default retry configuration for this method
|
255
|
+
:param server_url: Override the default server URL for this method
|
256
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
257
|
+
:param http_headers: Additional headers to set or replace on requests.
|
258
|
+
"""
|
259
|
+
base_url = None
|
260
|
+
url_variables = None
|
261
|
+
if timeout_ms is None:
|
262
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
263
|
+
|
264
|
+
if server_url is not None:
|
265
|
+
base_url = server_url
|
266
|
+
else:
|
267
|
+
base_url = self._get_url(base_url, url_variables)
|
268
|
+
|
269
|
+
request = operations.LinkCardRequest(
|
270
|
+
x_wait_for=x_wait_for,
|
271
|
+
account_id=account_id,
|
272
|
+
link_card=components.LinkCard(
|
273
|
+
e2ee=utils.get_pydantic_model(e2ee, Optional[components.E2EEToken]),
|
274
|
+
card_number=card_number,
|
275
|
+
card_cvv=card_cvv,
|
276
|
+
expiration=utils.get_pydantic_model(
|
277
|
+
expiration, components.CardExpiration
|
278
|
+
),
|
279
|
+
holder_name=holder_name,
|
280
|
+
billing_address=utils.get_pydantic_model(
|
281
|
+
billing_address, components.CardAddress
|
282
|
+
),
|
283
|
+
card_on_file=card_on_file,
|
284
|
+
merchant_account_id=merchant_account_id,
|
285
|
+
verify_name=verify_name,
|
286
|
+
),
|
287
|
+
)
|
288
|
+
|
289
|
+
req = self._build_request_async(
|
290
|
+
method="POST",
|
291
|
+
path="/accounts/{accountID}/cards",
|
292
|
+
base_url=base_url,
|
293
|
+
url_variables=url_variables,
|
294
|
+
request=request,
|
295
|
+
request_body_required=True,
|
296
|
+
request_has_path_params=True,
|
297
|
+
request_has_query_params=True,
|
298
|
+
user_agent_header="user-agent",
|
299
|
+
accept_header_value="application/json",
|
300
|
+
http_headers=http_headers,
|
301
|
+
_globals=operations.LinkCardGlobals(
|
302
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
303
|
+
),
|
304
|
+
security=self.sdk_configuration.security,
|
305
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
306
|
+
request.link_card, False, False, "json", components.LinkCard
|
307
|
+
),
|
308
|
+
timeout_ms=timeout_ms,
|
309
|
+
)
|
310
|
+
|
311
|
+
if retries == UNSET:
|
312
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
313
|
+
retries = self.sdk_configuration.retry_config
|
314
|
+
|
315
|
+
retry_config = None
|
316
|
+
if isinstance(retries, utils.RetryConfig):
|
317
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
318
|
+
|
319
|
+
http_res = await self.do_request_async(
|
320
|
+
hook_ctx=HookContext(
|
321
|
+
base_url=base_url or "",
|
322
|
+
operation_id="linkCard",
|
323
|
+
oauth2_scopes=[],
|
324
|
+
security_source=get_security_from_env(
|
325
|
+
self.sdk_configuration.security, components.Security
|
326
|
+
),
|
327
|
+
),
|
328
|
+
request=req,
|
329
|
+
error_status_codes=[
|
330
|
+
"400",
|
331
|
+
"401",
|
332
|
+
"403",
|
333
|
+
"404",
|
334
|
+
"409",
|
335
|
+
"422",
|
336
|
+
"429",
|
337
|
+
"4XX",
|
338
|
+
"500",
|
339
|
+
"504",
|
340
|
+
"5XX",
|
341
|
+
],
|
342
|
+
retry_config=retry_config,
|
343
|
+
)
|
344
|
+
|
345
|
+
response_data: Any = None
|
346
|
+
if utils.match_response(http_res, "200", "application/json"):
|
347
|
+
return operations.LinkCardResponse(
|
348
|
+
result=utils.unmarshal_json(http_res.text, components.Card),
|
349
|
+
headers=utils.get_response_headers(http_res.headers),
|
350
|
+
)
|
351
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
352
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
353
|
+
raise errors.GenericError(data=response_data)
|
354
|
+
if utils.match_response(http_res, "422", "application/json"):
|
355
|
+
response_data = utils.unmarshal_json(
|
356
|
+
http_res.text, errors.LinkCardErrorData
|
357
|
+
)
|
358
|
+
raise errors.LinkCardError(data=response_data)
|
359
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
360
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
361
|
+
raise errors.APIError(
|
362
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
363
|
+
)
|
364
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
365
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
366
|
+
raise errors.APIError(
|
367
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
368
|
+
)
|
369
|
+
if utils.match_response(http_res, "4XX", "*"):
|
370
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
371
|
+
raise errors.APIError(
|
372
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
373
|
+
)
|
374
|
+
if utils.match_response(http_res, "5XX", "*"):
|
375
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
376
|
+
raise errors.APIError(
|
377
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
378
|
+
)
|
379
|
+
|
380
|
+
content_type = http_res.headers.get("Content-Type")
|
381
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
382
|
+
raise errors.APIError(
|
383
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
384
|
+
http_res.status_code,
|
385
|
+
http_res_text,
|
386
|
+
http_res,
|
387
|
+
)
|
388
|
+
|
389
|
+
def list(
|
390
|
+
self,
|
391
|
+
*,
|
392
|
+
account_id: str,
|
393
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
394
|
+
server_url: Optional[str] = None,
|
395
|
+
timeout_ms: Optional[int] = None,
|
396
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
397
|
+
) -> operations.ListCardsResponse:
|
398
|
+
r"""List all the active cards associated with a Moov account.
|
399
|
+
|
400
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/) to learn more.
|
401
|
+
|
402
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
403
|
+
you'll need to specify the `/accounts/{accountID}/cards.read` scope.
|
404
|
+
|
405
|
+
:param account_id:
|
406
|
+
:param retries: Override the default retry configuration for this method
|
407
|
+
:param server_url: Override the default server URL for this method
|
408
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
409
|
+
:param http_headers: Additional headers to set or replace on requests.
|
410
|
+
"""
|
411
|
+
base_url = None
|
412
|
+
url_variables = None
|
413
|
+
if timeout_ms is None:
|
414
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
415
|
+
|
416
|
+
if server_url is not None:
|
417
|
+
base_url = server_url
|
418
|
+
else:
|
419
|
+
base_url = self._get_url(base_url, url_variables)
|
420
|
+
|
421
|
+
request = operations.ListCardsRequest(
|
422
|
+
account_id=account_id,
|
423
|
+
)
|
424
|
+
|
425
|
+
req = self._build_request(
|
426
|
+
method="GET",
|
427
|
+
path="/accounts/{accountID}/cards",
|
428
|
+
base_url=base_url,
|
429
|
+
url_variables=url_variables,
|
430
|
+
request=request,
|
431
|
+
request_body_required=False,
|
432
|
+
request_has_path_params=True,
|
433
|
+
request_has_query_params=True,
|
434
|
+
user_agent_header="user-agent",
|
435
|
+
accept_header_value="application/json",
|
436
|
+
http_headers=http_headers,
|
437
|
+
_globals=operations.ListCardsGlobals(
|
438
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
439
|
+
),
|
440
|
+
security=self.sdk_configuration.security,
|
441
|
+
timeout_ms=timeout_ms,
|
442
|
+
)
|
443
|
+
|
444
|
+
if retries == UNSET:
|
445
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
446
|
+
retries = self.sdk_configuration.retry_config
|
447
|
+
|
448
|
+
retry_config = None
|
449
|
+
if isinstance(retries, utils.RetryConfig):
|
450
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
451
|
+
|
452
|
+
http_res = self.do_request(
|
453
|
+
hook_ctx=HookContext(
|
454
|
+
base_url=base_url or "",
|
455
|
+
operation_id="listCards",
|
456
|
+
oauth2_scopes=[],
|
457
|
+
security_source=get_security_from_env(
|
458
|
+
self.sdk_configuration.security, components.Security
|
459
|
+
),
|
460
|
+
),
|
461
|
+
request=req,
|
462
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
463
|
+
retry_config=retry_config,
|
464
|
+
)
|
465
|
+
|
466
|
+
if utils.match_response(http_res, "200", "application/json"):
|
467
|
+
return operations.ListCardsResponse(
|
468
|
+
result=utils.unmarshal_json(http_res.text, List[components.Card]),
|
469
|
+
headers=utils.get_response_headers(http_res.headers),
|
470
|
+
)
|
471
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
472
|
+
http_res_text = utils.stream_to_text(http_res)
|
473
|
+
raise errors.APIError(
|
474
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
475
|
+
)
|
476
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
477
|
+
http_res_text = utils.stream_to_text(http_res)
|
478
|
+
raise errors.APIError(
|
479
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
480
|
+
)
|
481
|
+
if utils.match_response(http_res, "4XX", "*"):
|
482
|
+
http_res_text = utils.stream_to_text(http_res)
|
483
|
+
raise errors.APIError(
|
484
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
485
|
+
)
|
486
|
+
if utils.match_response(http_res, "5XX", "*"):
|
487
|
+
http_res_text = utils.stream_to_text(http_res)
|
488
|
+
raise errors.APIError(
|
489
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
490
|
+
)
|
491
|
+
|
492
|
+
content_type = http_res.headers.get("Content-Type")
|
493
|
+
http_res_text = utils.stream_to_text(http_res)
|
494
|
+
raise errors.APIError(
|
495
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
496
|
+
http_res.status_code,
|
497
|
+
http_res_text,
|
498
|
+
http_res,
|
499
|
+
)
|
500
|
+
|
501
|
+
async def list_async(
|
502
|
+
self,
|
503
|
+
*,
|
504
|
+
account_id: str,
|
505
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
506
|
+
server_url: Optional[str] = None,
|
507
|
+
timeout_ms: Optional[int] = None,
|
508
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
509
|
+
) -> operations.ListCardsResponse:
|
510
|
+
r"""List all the active cards associated with a Moov account.
|
511
|
+
|
512
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/) to learn more.
|
513
|
+
|
514
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
515
|
+
you'll need to specify the `/accounts/{accountID}/cards.read` scope.
|
516
|
+
|
517
|
+
:param account_id:
|
518
|
+
:param retries: Override the default retry configuration for this method
|
519
|
+
:param server_url: Override the default server URL for this method
|
520
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
521
|
+
:param http_headers: Additional headers to set or replace on requests.
|
522
|
+
"""
|
523
|
+
base_url = None
|
524
|
+
url_variables = None
|
525
|
+
if timeout_ms is None:
|
526
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
527
|
+
|
528
|
+
if server_url is not None:
|
529
|
+
base_url = server_url
|
530
|
+
else:
|
531
|
+
base_url = self._get_url(base_url, url_variables)
|
532
|
+
|
533
|
+
request = operations.ListCardsRequest(
|
534
|
+
account_id=account_id,
|
535
|
+
)
|
536
|
+
|
537
|
+
req = self._build_request_async(
|
538
|
+
method="GET",
|
539
|
+
path="/accounts/{accountID}/cards",
|
540
|
+
base_url=base_url,
|
541
|
+
url_variables=url_variables,
|
542
|
+
request=request,
|
543
|
+
request_body_required=False,
|
544
|
+
request_has_path_params=True,
|
545
|
+
request_has_query_params=True,
|
546
|
+
user_agent_header="user-agent",
|
547
|
+
accept_header_value="application/json",
|
548
|
+
http_headers=http_headers,
|
549
|
+
_globals=operations.ListCardsGlobals(
|
550
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
551
|
+
),
|
552
|
+
security=self.sdk_configuration.security,
|
553
|
+
timeout_ms=timeout_ms,
|
554
|
+
)
|
555
|
+
|
556
|
+
if retries == UNSET:
|
557
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
558
|
+
retries = self.sdk_configuration.retry_config
|
559
|
+
|
560
|
+
retry_config = None
|
561
|
+
if isinstance(retries, utils.RetryConfig):
|
562
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
563
|
+
|
564
|
+
http_res = await self.do_request_async(
|
565
|
+
hook_ctx=HookContext(
|
566
|
+
base_url=base_url or "",
|
567
|
+
operation_id="listCards",
|
568
|
+
oauth2_scopes=[],
|
569
|
+
security_source=get_security_from_env(
|
570
|
+
self.sdk_configuration.security, components.Security
|
571
|
+
),
|
572
|
+
),
|
573
|
+
request=req,
|
574
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
575
|
+
retry_config=retry_config,
|
576
|
+
)
|
577
|
+
|
578
|
+
if utils.match_response(http_res, "200", "application/json"):
|
579
|
+
return operations.ListCardsResponse(
|
580
|
+
result=utils.unmarshal_json(http_res.text, List[components.Card]),
|
581
|
+
headers=utils.get_response_headers(http_res.headers),
|
582
|
+
)
|
583
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
584
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
585
|
+
raise errors.APIError(
|
586
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
587
|
+
)
|
588
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
589
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
590
|
+
raise errors.APIError(
|
591
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
592
|
+
)
|
593
|
+
if utils.match_response(http_res, "4XX", "*"):
|
594
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
595
|
+
raise errors.APIError(
|
596
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
597
|
+
)
|
598
|
+
if utils.match_response(http_res, "5XX", "*"):
|
599
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
600
|
+
raise errors.APIError(
|
601
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
602
|
+
)
|
603
|
+
|
604
|
+
content_type = http_res.headers.get("Content-Type")
|
605
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
606
|
+
raise errors.APIError(
|
607
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
608
|
+
http_res.status_code,
|
609
|
+
http_res_text,
|
610
|
+
http_res,
|
611
|
+
)
|
612
|
+
|
613
|
+
def get(
|
614
|
+
self,
|
615
|
+
*,
|
616
|
+
account_id: str,
|
617
|
+
card_id: str,
|
618
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
619
|
+
server_url: Optional[str] = None,
|
620
|
+
timeout_ms: Optional[int] = None,
|
621
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
622
|
+
) -> operations.GetCardResponse:
|
623
|
+
r"""Fetch a specific card associated with a Moov account.
|
624
|
+
|
625
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/) to learn more.
|
626
|
+
|
627
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
628
|
+
you'll need to specify the `/accounts/{accountID}/cards.read` scope.
|
629
|
+
|
630
|
+
:param account_id:
|
631
|
+
:param card_id:
|
632
|
+
:param retries: Override the default retry configuration for this method
|
633
|
+
:param server_url: Override the default server URL for this method
|
634
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
635
|
+
:param http_headers: Additional headers to set or replace on requests.
|
636
|
+
"""
|
637
|
+
base_url = None
|
638
|
+
url_variables = None
|
639
|
+
if timeout_ms is None:
|
640
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
641
|
+
|
642
|
+
if server_url is not None:
|
643
|
+
base_url = server_url
|
644
|
+
else:
|
645
|
+
base_url = self._get_url(base_url, url_variables)
|
646
|
+
|
647
|
+
request = operations.GetCardRequest(
|
648
|
+
account_id=account_id,
|
649
|
+
card_id=card_id,
|
650
|
+
)
|
651
|
+
|
652
|
+
req = self._build_request(
|
653
|
+
method="GET",
|
654
|
+
path="/accounts/{accountID}/cards/{cardID}",
|
655
|
+
base_url=base_url,
|
656
|
+
url_variables=url_variables,
|
657
|
+
request=request,
|
658
|
+
request_body_required=False,
|
659
|
+
request_has_path_params=True,
|
660
|
+
request_has_query_params=True,
|
661
|
+
user_agent_header="user-agent",
|
662
|
+
accept_header_value="application/json",
|
663
|
+
http_headers=http_headers,
|
664
|
+
_globals=operations.GetCardGlobals(
|
665
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
666
|
+
),
|
667
|
+
security=self.sdk_configuration.security,
|
668
|
+
timeout_ms=timeout_ms,
|
669
|
+
)
|
670
|
+
|
671
|
+
if retries == UNSET:
|
672
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
673
|
+
retries = self.sdk_configuration.retry_config
|
674
|
+
|
675
|
+
retry_config = None
|
676
|
+
if isinstance(retries, utils.RetryConfig):
|
677
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
678
|
+
|
679
|
+
http_res = self.do_request(
|
680
|
+
hook_ctx=HookContext(
|
681
|
+
base_url=base_url or "",
|
682
|
+
operation_id="getCard",
|
683
|
+
oauth2_scopes=[],
|
684
|
+
security_source=get_security_from_env(
|
685
|
+
self.sdk_configuration.security, components.Security
|
686
|
+
),
|
687
|
+
),
|
688
|
+
request=req,
|
689
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
690
|
+
retry_config=retry_config,
|
691
|
+
)
|
692
|
+
|
693
|
+
if utils.match_response(http_res, "200", "application/json"):
|
694
|
+
return operations.GetCardResponse(
|
695
|
+
result=utils.unmarshal_json(http_res.text, components.Card),
|
696
|
+
headers=utils.get_response_headers(http_res.headers),
|
697
|
+
)
|
698
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
699
|
+
http_res_text = utils.stream_to_text(http_res)
|
700
|
+
raise errors.APIError(
|
701
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
702
|
+
)
|
703
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
704
|
+
http_res_text = utils.stream_to_text(http_res)
|
705
|
+
raise errors.APIError(
|
706
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
707
|
+
)
|
708
|
+
if utils.match_response(http_res, "4XX", "*"):
|
709
|
+
http_res_text = utils.stream_to_text(http_res)
|
710
|
+
raise errors.APIError(
|
711
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
712
|
+
)
|
713
|
+
if utils.match_response(http_res, "5XX", "*"):
|
714
|
+
http_res_text = utils.stream_to_text(http_res)
|
715
|
+
raise errors.APIError(
|
716
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
717
|
+
)
|
718
|
+
|
719
|
+
content_type = http_res.headers.get("Content-Type")
|
720
|
+
http_res_text = utils.stream_to_text(http_res)
|
721
|
+
raise errors.APIError(
|
722
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
723
|
+
http_res.status_code,
|
724
|
+
http_res_text,
|
725
|
+
http_res,
|
726
|
+
)
|
727
|
+
|
728
|
+
async def get_async(
|
729
|
+
self,
|
730
|
+
*,
|
731
|
+
account_id: str,
|
732
|
+
card_id: str,
|
733
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
734
|
+
server_url: Optional[str] = None,
|
735
|
+
timeout_ms: Optional[int] = None,
|
736
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
737
|
+
) -> operations.GetCardResponse:
|
738
|
+
r"""Fetch a specific card associated with a Moov account.
|
739
|
+
|
740
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/) to learn more.
|
741
|
+
|
742
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
743
|
+
you'll need to specify the `/accounts/{accountID}/cards.read` scope.
|
744
|
+
|
745
|
+
:param account_id:
|
746
|
+
:param card_id:
|
747
|
+
:param retries: Override the default retry configuration for this method
|
748
|
+
:param server_url: Override the default server URL for this method
|
749
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
750
|
+
:param http_headers: Additional headers to set or replace on requests.
|
751
|
+
"""
|
752
|
+
base_url = None
|
753
|
+
url_variables = None
|
754
|
+
if timeout_ms is None:
|
755
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
756
|
+
|
757
|
+
if server_url is not None:
|
758
|
+
base_url = server_url
|
759
|
+
else:
|
760
|
+
base_url = self._get_url(base_url, url_variables)
|
761
|
+
|
762
|
+
request = operations.GetCardRequest(
|
763
|
+
account_id=account_id,
|
764
|
+
card_id=card_id,
|
765
|
+
)
|
766
|
+
|
767
|
+
req = self._build_request_async(
|
768
|
+
method="GET",
|
769
|
+
path="/accounts/{accountID}/cards/{cardID}",
|
770
|
+
base_url=base_url,
|
771
|
+
url_variables=url_variables,
|
772
|
+
request=request,
|
773
|
+
request_body_required=False,
|
774
|
+
request_has_path_params=True,
|
775
|
+
request_has_query_params=True,
|
776
|
+
user_agent_header="user-agent",
|
777
|
+
accept_header_value="application/json",
|
778
|
+
http_headers=http_headers,
|
779
|
+
_globals=operations.GetCardGlobals(
|
780
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
781
|
+
),
|
782
|
+
security=self.sdk_configuration.security,
|
783
|
+
timeout_ms=timeout_ms,
|
784
|
+
)
|
785
|
+
|
786
|
+
if retries == UNSET:
|
787
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
788
|
+
retries = self.sdk_configuration.retry_config
|
789
|
+
|
790
|
+
retry_config = None
|
791
|
+
if isinstance(retries, utils.RetryConfig):
|
792
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
793
|
+
|
794
|
+
http_res = await self.do_request_async(
|
795
|
+
hook_ctx=HookContext(
|
796
|
+
base_url=base_url or "",
|
797
|
+
operation_id="getCard",
|
798
|
+
oauth2_scopes=[],
|
799
|
+
security_source=get_security_from_env(
|
800
|
+
self.sdk_configuration.security, components.Security
|
801
|
+
),
|
802
|
+
),
|
803
|
+
request=req,
|
804
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
805
|
+
retry_config=retry_config,
|
806
|
+
)
|
807
|
+
|
808
|
+
if utils.match_response(http_res, "200", "application/json"):
|
809
|
+
return operations.GetCardResponse(
|
810
|
+
result=utils.unmarshal_json(http_res.text, components.Card),
|
811
|
+
headers=utils.get_response_headers(http_res.headers),
|
812
|
+
)
|
813
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
814
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
815
|
+
raise errors.APIError(
|
816
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
817
|
+
)
|
818
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
819
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
820
|
+
raise errors.APIError(
|
821
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
822
|
+
)
|
823
|
+
if utils.match_response(http_res, "4XX", "*"):
|
824
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
825
|
+
raise errors.APIError(
|
826
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
827
|
+
)
|
828
|
+
if utils.match_response(http_res, "5XX", "*"):
|
829
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
830
|
+
raise errors.APIError(
|
831
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
832
|
+
)
|
833
|
+
|
834
|
+
content_type = http_res.headers.get("Content-Type")
|
835
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
836
|
+
raise errors.APIError(
|
837
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
838
|
+
http_res.status_code,
|
839
|
+
http_res_text,
|
840
|
+
http_res,
|
841
|
+
)
|
842
|
+
|
843
|
+
def update(
|
844
|
+
self,
|
845
|
+
*,
|
846
|
+
account_id: str,
|
847
|
+
card_id: str,
|
848
|
+
e2ee: Optional[
|
849
|
+
Union[components.E2EETokenUpdate, components.E2EETokenUpdateTypedDict]
|
850
|
+
] = None,
|
851
|
+
billing_address: Optional[
|
852
|
+
Union[components.UpdateCardAddress, components.UpdateCardAddressTypedDict]
|
853
|
+
] = None,
|
854
|
+
expiration: Optional[
|
855
|
+
Union[
|
856
|
+
components.UpdateCardExpiration,
|
857
|
+
components.UpdateCardExpirationTypedDict,
|
858
|
+
]
|
859
|
+
] = None,
|
860
|
+
card_cvv: Optional[str] = None,
|
861
|
+
card_on_file: Optional[bool] = None,
|
862
|
+
merchant_account_id: Optional[str] = None,
|
863
|
+
verify_name: Optional[bool] = None,
|
864
|
+
holder_name: Optional[str] = None,
|
865
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
866
|
+
server_url: Optional[str] = None,
|
867
|
+
timeout_ms: Optional[int] = None,
|
868
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
869
|
+
) -> operations.UpdateCardResponse:
|
870
|
+
r"""Update a linked card and/or resubmit it for verification.
|
871
|
+
|
872
|
+
If a value is provided for CVV, a new verification ($0 authorization) will be submitted for the card. Updating the expiration
|
873
|
+
date or
|
874
|
+
address will update the information stored on file for the card but will not be verified.
|
875
|
+
|
876
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/#reverify-a-card) to learn
|
877
|
+
more.
|
878
|
+
|
879
|
+
Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.
|
880
|
+
|
881
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
882
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
883
|
+
|
884
|
+
:param account_id:
|
885
|
+
:param card_id:
|
886
|
+
:param e2ee: Wraps a compact-serialized JSON Web Encryption (JWE) token used for secure transmission of sensitive data (e.g., PCI information) through intermediaries. This token is encrypted using the public key from /end-to-end-keys and wraps an AES key. For details and examples, refer to our [GitHub repository](https://github.com/moovfinancial/moov-go/blob/main/examples/e2ee/e2ee_test.go).
|
887
|
+
:param billing_address:
|
888
|
+
:param expiration:
|
889
|
+
:param card_cvv:
|
890
|
+
:param card_on_file:
|
891
|
+
:param merchant_account_id:
|
892
|
+
:param verify_name:
|
893
|
+
:param holder_name:
|
894
|
+
:param retries: Override the default retry configuration for this method
|
895
|
+
:param server_url: Override the default server URL for this method
|
896
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
897
|
+
:param http_headers: Additional headers to set or replace on requests.
|
898
|
+
"""
|
899
|
+
base_url = None
|
900
|
+
url_variables = None
|
901
|
+
if timeout_ms is None:
|
902
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
903
|
+
|
904
|
+
if server_url is not None:
|
905
|
+
base_url = server_url
|
906
|
+
else:
|
907
|
+
base_url = self._get_url(base_url, url_variables)
|
908
|
+
|
909
|
+
request = operations.UpdateCardRequest(
|
910
|
+
account_id=account_id,
|
911
|
+
card_id=card_id,
|
912
|
+
update_card=components.UpdateCard(
|
913
|
+
e2ee=utils.get_pydantic_model(
|
914
|
+
e2ee, Optional[components.E2EETokenUpdate]
|
915
|
+
),
|
916
|
+
billing_address=utils.get_pydantic_model(
|
917
|
+
billing_address, Optional[components.UpdateCardAddress]
|
918
|
+
),
|
919
|
+
expiration=utils.get_pydantic_model(
|
920
|
+
expiration, Optional[components.UpdateCardExpiration]
|
921
|
+
),
|
922
|
+
card_cvv=card_cvv,
|
923
|
+
card_on_file=card_on_file,
|
924
|
+
merchant_account_id=merchant_account_id,
|
925
|
+
verify_name=verify_name,
|
926
|
+
holder_name=holder_name,
|
927
|
+
),
|
928
|
+
)
|
929
|
+
|
930
|
+
req = self._build_request(
|
931
|
+
method="PATCH",
|
932
|
+
path="/accounts/{accountID}/cards/{cardID}",
|
933
|
+
base_url=base_url,
|
934
|
+
url_variables=url_variables,
|
935
|
+
request=request,
|
936
|
+
request_body_required=True,
|
937
|
+
request_has_path_params=True,
|
938
|
+
request_has_query_params=True,
|
939
|
+
user_agent_header="user-agent",
|
940
|
+
accept_header_value="application/json",
|
941
|
+
http_headers=http_headers,
|
942
|
+
_globals=operations.UpdateCardGlobals(
|
943
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
944
|
+
),
|
945
|
+
security=self.sdk_configuration.security,
|
946
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
947
|
+
request.update_card, False, False, "json", components.UpdateCard
|
948
|
+
),
|
949
|
+
timeout_ms=timeout_ms,
|
950
|
+
)
|
951
|
+
|
952
|
+
if retries == UNSET:
|
953
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
954
|
+
retries = self.sdk_configuration.retry_config
|
955
|
+
|
956
|
+
retry_config = None
|
957
|
+
if isinstance(retries, utils.RetryConfig):
|
958
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
959
|
+
|
960
|
+
http_res = self.do_request(
|
961
|
+
hook_ctx=HookContext(
|
962
|
+
base_url=base_url or "",
|
963
|
+
operation_id="updateCard",
|
964
|
+
oauth2_scopes=[],
|
965
|
+
security_source=get_security_from_env(
|
966
|
+
self.sdk_configuration.security, components.Security
|
967
|
+
),
|
968
|
+
),
|
969
|
+
request=req,
|
970
|
+
error_status_codes=[
|
971
|
+
"400",
|
972
|
+
"401",
|
973
|
+
"403",
|
974
|
+
"404",
|
975
|
+
"409",
|
976
|
+
"422",
|
977
|
+
"429",
|
978
|
+
"4XX",
|
979
|
+
"500",
|
980
|
+
"504",
|
981
|
+
"5XX",
|
982
|
+
],
|
983
|
+
retry_config=retry_config,
|
984
|
+
)
|
985
|
+
|
986
|
+
response_data: Any = None
|
987
|
+
if utils.match_response(http_res, "200", "application/json"):
|
988
|
+
return operations.UpdateCardResponse(
|
989
|
+
result=utils.unmarshal_json(http_res.text, components.Card),
|
990
|
+
headers=utils.get_response_headers(http_res.headers),
|
991
|
+
)
|
992
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
993
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
994
|
+
raise errors.GenericError(data=response_data)
|
995
|
+
if utils.match_response(http_res, "422", "application/json"):
|
996
|
+
response_data = utils.unmarshal_json(
|
997
|
+
http_res.text, errors.UpdateCardErrorData
|
998
|
+
)
|
999
|
+
raise errors.UpdateCardError(data=response_data)
|
1000
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1001
|
+
http_res_text = utils.stream_to_text(http_res)
|
1002
|
+
raise errors.APIError(
|
1003
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1004
|
+
)
|
1005
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1006
|
+
http_res_text = utils.stream_to_text(http_res)
|
1007
|
+
raise errors.APIError(
|
1008
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1009
|
+
)
|
1010
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1011
|
+
http_res_text = utils.stream_to_text(http_res)
|
1012
|
+
raise errors.APIError(
|
1013
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1014
|
+
)
|
1015
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1016
|
+
http_res_text = utils.stream_to_text(http_res)
|
1017
|
+
raise errors.APIError(
|
1018
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1019
|
+
)
|
1020
|
+
|
1021
|
+
content_type = http_res.headers.get("Content-Type")
|
1022
|
+
http_res_text = utils.stream_to_text(http_res)
|
1023
|
+
raise errors.APIError(
|
1024
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1025
|
+
http_res.status_code,
|
1026
|
+
http_res_text,
|
1027
|
+
http_res,
|
1028
|
+
)
|
1029
|
+
|
1030
|
+
async def update_async(
|
1031
|
+
self,
|
1032
|
+
*,
|
1033
|
+
account_id: str,
|
1034
|
+
card_id: str,
|
1035
|
+
e2ee: Optional[
|
1036
|
+
Union[components.E2EETokenUpdate, components.E2EETokenUpdateTypedDict]
|
1037
|
+
] = None,
|
1038
|
+
billing_address: Optional[
|
1039
|
+
Union[components.UpdateCardAddress, components.UpdateCardAddressTypedDict]
|
1040
|
+
] = None,
|
1041
|
+
expiration: Optional[
|
1042
|
+
Union[
|
1043
|
+
components.UpdateCardExpiration,
|
1044
|
+
components.UpdateCardExpirationTypedDict,
|
1045
|
+
]
|
1046
|
+
] = None,
|
1047
|
+
card_cvv: Optional[str] = None,
|
1048
|
+
card_on_file: Optional[bool] = None,
|
1049
|
+
merchant_account_id: Optional[str] = None,
|
1050
|
+
verify_name: Optional[bool] = None,
|
1051
|
+
holder_name: Optional[str] = None,
|
1052
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1053
|
+
server_url: Optional[str] = None,
|
1054
|
+
timeout_ms: Optional[int] = None,
|
1055
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1056
|
+
) -> operations.UpdateCardResponse:
|
1057
|
+
r"""Update a linked card and/or resubmit it for verification.
|
1058
|
+
|
1059
|
+
If a value is provided for CVV, a new verification ($0 authorization) will be submitted for the card. Updating the expiration
|
1060
|
+
date or
|
1061
|
+
address will update the information stored on file for the card but will not be verified.
|
1062
|
+
|
1063
|
+
Read our [accept card payments guide](https://docs.moov.io/guides/sources/cards/accept-card-payments/#reverify-a-card) to learn
|
1064
|
+
more.
|
1065
|
+
|
1066
|
+
Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.
|
1067
|
+
|
1068
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1069
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
1070
|
+
|
1071
|
+
:param account_id:
|
1072
|
+
:param card_id:
|
1073
|
+
:param e2ee: Wraps a compact-serialized JSON Web Encryption (JWE) token used for secure transmission of sensitive data (e.g., PCI information) through intermediaries. This token is encrypted using the public key from /end-to-end-keys and wraps an AES key. For details and examples, refer to our [GitHub repository](https://github.com/moovfinancial/moov-go/blob/main/examples/e2ee/e2ee_test.go).
|
1074
|
+
:param billing_address:
|
1075
|
+
:param expiration:
|
1076
|
+
:param card_cvv:
|
1077
|
+
:param card_on_file:
|
1078
|
+
:param merchant_account_id:
|
1079
|
+
:param verify_name:
|
1080
|
+
:param holder_name:
|
1081
|
+
:param retries: Override the default retry configuration for this method
|
1082
|
+
:param server_url: Override the default server URL for this method
|
1083
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1084
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1085
|
+
"""
|
1086
|
+
base_url = None
|
1087
|
+
url_variables = None
|
1088
|
+
if timeout_ms is None:
|
1089
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1090
|
+
|
1091
|
+
if server_url is not None:
|
1092
|
+
base_url = server_url
|
1093
|
+
else:
|
1094
|
+
base_url = self._get_url(base_url, url_variables)
|
1095
|
+
|
1096
|
+
request = operations.UpdateCardRequest(
|
1097
|
+
account_id=account_id,
|
1098
|
+
card_id=card_id,
|
1099
|
+
update_card=components.UpdateCard(
|
1100
|
+
e2ee=utils.get_pydantic_model(
|
1101
|
+
e2ee, Optional[components.E2EETokenUpdate]
|
1102
|
+
),
|
1103
|
+
billing_address=utils.get_pydantic_model(
|
1104
|
+
billing_address, Optional[components.UpdateCardAddress]
|
1105
|
+
),
|
1106
|
+
expiration=utils.get_pydantic_model(
|
1107
|
+
expiration, Optional[components.UpdateCardExpiration]
|
1108
|
+
),
|
1109
|
+
card_cvv=card_cvv,
|
1110
|
+
card_on_file=card_on_file,
|
1111
|
+
merchant_account_id=merchant_account_id,
|
1112
|
+
verify_name=verify_name,
|
1113
|
+
holder_name=holder_name,
|
1114
|
+
),
|
1115
|
+
)
|
1116
|
+
|
1117
|
+
req = self._build_request_async(
|
1118
|
+
method="PATCH",
|
1119
|
+
path="/accounts/{accountID}/cards/{cardID}",
|
1120
|
+
base_url=base_url,
|
1121
|
+
url_variables=url_variables,
|
1122
|
+
request=request,
|
1123
|
+
request_body_required=True,
|
1124
|
+
request_has_path_params=True,
|
1125
|
+
request_has_query_params=True,
|
1126
|
+
user_agent_header="user-agent",
|
1127
|
+
accept_header_value="application/json",
|
1128
|
+
http_headers=http_headers,
|
1129
|
+
_globals=operations.UpdateCardGlobals(
|
1130
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1131
|
+
),
|
1132
|
+
security=self.sdk_configuration.security,
|
1133
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1134
|
+
request.update_card, False, False, "json", components.UpdateCard
|
1135
|
+
),
|
1136
|
+
timeout_ms=timeout_ms,
|
1137
|
+
)
|
1138
|
+
|
1139
|
+
if retries == UNSET:
|
1140
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1141
|
+
retries = self.sdk_configuration.retry_config
|
1142
|
+
|
1143
|
+
retry_config = None
|
1144
|
+
if isinstance(retries, utils.RetryConfig):
|
1145
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1146
|
+
|
1147
|
+
http_res = await self.do_request_async(
|
1148
|
+
hook_ctx=HookContext(
|
1149
|
+
base_url=base_url or "",
|
1150
|
+
operation_id="updateCard",
|
1151
|
+
oauth2_scopes=[],
|
1152
|
+
security_source=get_security_from_env(
|
1153
|
+
self.sdk_configuration.security, components.Security
|
1154
|
+
),
|
1155
|
+
),
|
1156
|
+
request=req,
|
1157
|
+
error_status_codes=[
|
1158
|
+
"400",
|
1159
|
+
"401",
|
1160
|
+
"403",
|
1161
|
+
"404",
|
1162
|
+
"409",
|
1163
|
+
"422",
|
1164
|
+
"429",
|
1165
|
+
"4XX",
|
1166
|
+
"500",
|
1167
|
+
"504",
|
1168
|
+
"5XX",
|
1169
|
+
],
|
1170
|
+
retry_config=retry_config,
|
1171
|
+
)
|
1172
|
+
|
1173
|
+
response_data: Any = None
|
1174
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1175
|
+
return operations.UpdateCardResponse(
|
1176
|
+
result=utils.unmarshal_json(http_res.text, components.Card),
|
1177
|
+
headers=utils.get_response_headers(http_res.headers),
|
1178
|
+
)
|
1179
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1180
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1181
|
+
raise errors.GenericError(data=response_data)
|
1182
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1183
|
+
response_data = utils.unmarshal_json(
|
1184
|
+
http_res.text, errors.UpdateCardErrorData
|
1185
|
+
)
|
1186
|
+
raise errors.UpdateCardError(data=response_data)
|
1187
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1188
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1189
|
+
raise errors.APIError(
|
1190
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1191
|
+
)
|
1192
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1193
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1194
|
+
raise errors.APIError(
|
1195
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1196
|
+
)
|
1197
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1198
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1199
|
+
raise errors.APIError(
|
1200
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1201
|
+
)
|
1202
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1203
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1204
|
+
raise errors.APIError(
|
1205
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1206
|
+
)
|
1207
|
+
|
1208
|
+
content_type = http_res.headers.get("Content-Type")
|
1209
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1210
|
+
raise errors.APIError(
|
1211
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1212
|
+
http_res.status_code,
|
1213
|
+
http_res_text,
|
1214
|
+
http_res,
|
1215
|
+
)
|
1216
|
+
|
1217
|
+
def disable(
|
1218
|
+
self,
|
1219
|
+
*,
|
1220
|
+
account_id: str,
|
1221
|
+
card_id: str,
|
1222
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1223
|
+
server_url: Optional[str] = None,
|
1224
|
+
timeout_ms: Optional[int] = None,
|
1225
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1226
|
+
) -> operations.DisableCardResponse:
|
1227
|
+
r"""Disables a card associated with a Moov account.
|
1228
|
+
|
1229
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1230
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
1231
|
+
|
1232
|
+
:param account_id:
|
1233
|
+
:param card_id:
|
1234
|
+
:param retries: Override the default retry configuration for this method
|
1235
|
+
:param server_url: Override the default server URL for this method
|
1236
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1237
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1238
|
+
"""
|
1239
|
+
base_url = None
|
1240
|
+
url_variables = None
|
1241
|
+
if timeout_ms is None:
|
1242
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1243
|
+
|
1244
|
+
if server_url is not None:
|
1245
|
+
base_url = server_url
|
1246
|
+
else:
|
1247
|
+
base_url = self._get_url(base_url, url_variables)
|
1248
|
+
|
1249
|
+
request = operations.DisableCardRequest(
|
1250
|
+
account_id=account_id,
|
1251
|
+
card_id=card_id,
|
1252
|
+
)
|
1253
|
+
|
1254
|
+
req = self._build_request(
|
1255
|
+
method="DELETE",
|
1256
|
+
path="/accounts/{accountID}/cards/{cardID}",
|
1257
|
+
base_url=base_url,
|
1258
|
+
url_variables=url_variables,
|
1259
|
+
request=request,
|
1260
|
+
request_body_required=False,
|
1261
|
+
request_has_path_params=True,
|
1262
|
+
request_has_query_params=True,
|
1263
|
+
user_agent_header="user-agent",
|
1264
|
+
accept_header_value="application/json",
|
1265
|
+
http_headers=http_headers,
|
1266
|
+
_globals=operations.DisableCardGlobals(
|
1267
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1268
|
+
),
|
1269
|
+
security=self.sdk_configuration.security,
|
1270
|
+
timeout_ms=timeout_ms,
|
1271
|
+
)
|
1272
|
+
|
1273
|
+
if retries == UNSET:
|
1274
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1275
|
+
retries = self.sdk_configuration.retry_config
|
1276
|
+
|
1277
|
+
retry_config = None
|
1278
|
+
if isinstance(retries, utils.RetryConfig):
|
1279
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1280
|
+
|
1281
|
+
http_res = self.do_request(
|
1282
|
+
hook_ctx=HookContext(
|
1283
|
+
base_url=base_url or "",
|
1284
|
+
operation_id="disableCard",
|
1285
|
+
oauth2_scopes=[],
|
1286
|
+
security_source=get_security_from_env(
|
1287
|
+
self.sdk_configuration.security, components.Security
|
1288
|
+
),
|
1289
|
+
),
|
1290
|
+
request=req,
|
1291
|
+
error_status_codes=[
|
1292
|
+
"400",
|
1293
|
+
"401",
|
1294
|
+
"403",
|
1295
|
+
"404",
|
1296
|
+
"409",
|
1297
|
+
"429",
|
1298
|
+
"4XX",
|
1299
|
+
"500",
|
1300
|
+
"504",
|
1301
|
+
"5XX",
|
1302
|
+
],
|
1303
|
+
retry_config=retry_config,
|
1304
|
+
)
|
1305
|
+
|
1306
|
+
response_data: Any = None
|
1307
|
+
if utils.match_response(http_res, "204", "*"):
|
1308
|
+
return operations.DisableCardResponse(
|
1309
|
+
headers=utils.get_response_headers(http_res.headers)
|
1310
|
+
)
|
1311
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1312
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1313
|
+
raise errors.GenericError(data=response_data)
|
1314
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1315
|
+
http_res_text = utils.stream_to_text(http_res)
|
1316
|
+
raise errors.APIError(
|
1317
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1318
|
+
)
|
1319
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1320
|
+
http_res_text = utils.stream_to_text(http_res)
|
1321
|
+
raise errors.APIError(
|
1322
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1323
|
+
)
|
1324
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1325
|
+
http_res_text = utils.stream_to_text(http_res)
|
1326
|
+
raise errors.APIError(
|
1327
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1328
|
+
)
|
1329
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1330
|
+
http_res_text = utils.stream_to_text(http_res)
|
1331
|
+
raise errors.APIError(
|
1332
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1333
|
+
)
|
1334
|
+
|
1335
|
+
content_type = http_res.headers.get("Content-Type")
|
1336
|
+
http_res_text = utils.stream_to_text(http_res)
|
1337
|
+
raise errors.APIError(
|
1338
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1339
|
+
http_res.status_code,
|
1340
|
+
http_res_text,
|
1341
|
+
http_res,
|
1342
|
+
)
|
1343
|
+
|
1344
|
+
async def disable_async(
|
1345
|
+
self,
|
1346
|
+
*,
|
1347
|
+
account_id: str,
|
1348
|
+
card_id: str,
|
1349
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1350
|
+
server_url: Optional[str] = None,
|
1351
|
+
timeout_ms: Optional[int] = None,
|
1352
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1353
|
+
) -> operations.DisableCardResponse:
|
1354
|
+
r"""Disables a card associated with a Moov account.
|
1355
|
+
|
1356
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1357
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
1358
|
+
|
1359
|
+
:param account_id:
|
1360
|
+
:param card_id:
|
1361
|
+
:param retries: Override the default retry configuration for this method
|
1362
|
+
:param server_url: Override the default server URL for this method
|
1363
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1364
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1365
|
+
"""
|
1366
|
+
base_url = None
|
1367
|
+
url_variables = None
|
1368
|
+
if timeout_ms is None:
|
1369
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1370
|
+
|
1371
|
+
if server_url is not None:
|
1372
|
+
base_url = server_url
|
1373
|
+
else:
|
1374
|
+
base_url = self._get_url(base_url, url_variables)
|
1375
|
+
|
1376
|
+
request = operations.DisableCardRequest(
|
1377
|
+
account_id=account_id,
|
1378
|
+
card_id=card_id,
|
1379
|
+
)
|
1380
|
+
|
1381
|
+
req = self._build_request_async(
|
1382
|
+
method="DELETE",
|
1383
|
+
path="/accounts/{accountID}/cards/{cardID}",
|
1384
|
+
base_url=base_url,
|
1385
|
+
url_variables=url_variables,
|
1386
|
+
request=request,
|
1387
|
+
request_body_required=False,
|
1388
|
+
request_has_path_params=True,
|
1389
|
+
request_has_query_params=True,
|
1390
|
+
user_agent_header="user-agent",
|
1391
|
+
accept_header_value="application/json",
|
1392
|
+
http_headers=http_headers,
|
1393
|
+
_globals=operations.DisableCardGlobals(
|
1394
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1395
|
+
),
|
1396
|
+
security=self.sdk_configuration.security,
|
1397
|
+
timeout_ms=timeout_ms,
|
1398
|
+
)
|
1399
|
+
|
1400
|
+
if retries == UNSET:
|
1401
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1402
|
+
retries = self.sdk_configuration.retry_config
|
1403
|
+
|
1404
|
+
retry_config = None
|
1405
|
+
if isinstance(retries, utils.RetryConfig):
|
1406
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1407
|
+
|
1408
|
+
http_res = await self.do_request_async(
|
1409
|
+
hook_ctx=HookContext(
|
1410
|
+
base_url=base_url or "",
|
1411
|
+
operation_id="disableCard",
|
1412
|
+
oauth2_scopes=[],
|
1413
|
+
security_source=get_security_from_env(
|
1414
|
+
self.sdk_configuration.security, components.Security
|
1415
|
+
),
|
1416
|
+
),
|
1417
|
+
request=req,
|
1418
|
+
error_status_codes=[
|
1419
|
+
"400",
|
1420
|
+
"401",
|
1421
|
+
"403",
|
1422
|
+
"404",
|
1423
|
+
"409",
|
1424
|
+
"429",
|
1425
|
+
"4XX",
|
1426
|
+
"500",
|
1427
|
+
"504",
|
1428
|
+
"5XX",
|
1429
|
+
],
|
1430
|
+
retry_config=retry_config,
|
1431
|
+
)
|
1432
|
+
|
1433
|
+
response_data: Any = None
|
1434
|
+
if utils.match_response(http_res, "204", "*"):
|
1435
|
+
return operations.DisableCardResponse(
|
1436
|
+
headers=utils.get_response_headers(http_res.headers)
|
1437
|
+
)
|
1438
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1439
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1440
|
+
raise errors.GenericError(data=response_data)
|
1441
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1442
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1443
|
+
raise errors.APIError(
|
1444
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1445
|
+
)
|
1446
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1447
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1448
|
+
raise errors.APIError(
|
1449
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1450
|
+
)
|
1451
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1452
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1453
|
+
raise errors.APIError(
|
1454
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1455
|
+
)
|
1456
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1457
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1458
|
+
raise errors.APIError(
|
1459
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1460
|
+
)
|
1461
|
+
|
1462
|
+
content_type = http_res.headers.get("Content-Type")
|
1463
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1464
|
+
raise errors.APIError(
|
1465
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1466
|
+
http_res.status_code,
|
1467
|
+
http_res_text,
|
1468
|
+
http_res,
|
1469
|
+
)
|