moovio_sdk 0.3.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- moovio_sdk/__init__.py +17 -0
- moovio_sdk/_hooks/__init__.py +5 -0
- moovio_sdk/_hooks/registration.py +13 -0
- moovio_sdk/_hooks/sdkhooks.py +76 -0
- moovio_sdk/_hooks/types.py +106 -0
- moovio_sdk/_version.py +15 -0
- moovio_sdk/accounts.py +2461 -0
- moovio_sdk/adjustments.py +463 -0
- moovio_sdk/apple_pay.py +1417 -0
- moovio_sdk/authentication.py +531 -0
- moovio_sdk/avatars.py +231 -0
- moovio_sdk/bank_accounts.py +2445 -0
- moovio_sdk/basesdk.py +363 -0
- moovio_sdk/branding.py +1089 -0
- moovio_sdk/capabilities.py +1001 -0
- moovio_sdk/card_issuing.py +1351 -0
- moovio_sdk/cards.py +1469 -0
- moovio_sdk/disputes.py +2985 -0
- moovio_sdk/end_to_end_encryption.py +453 -0
- moovio_sdk/enriched_address.py +307 -0
- moovio_sdk/enriched_profile.py +235 -0
- moovio_sdk/fee_plans.py +1759 -0
- moovio_sdk/files.py +775 -0
- moovio_sdk/httpclient.py +136 -0
- moovio_sdk/industries.py +239 -0
- moovio_sdk/institutions.py +261 -0
- moovio_sdk/issuing_transactions.py +1228 -0
- moovio_sdk/models/__init__.py +4 -0
- moovio_sdk/models/components/__init__.py +1411 -0
- moovio_sdk/models/components/account.py +96 -0
- moovio_sdk/models/components/accountcapability.py +20 -0
- moovio_sdk/models/components/accountcountries.py +18 -0
- moovio_sdk/models/components/accountnameverification.py +28 -0
- moovio_sdk/models/components/accounttype.py +11 -0
- moovio_sdk/models/components/accountverificationstatus.py +19 -0
- moovio_sdk/models/components/achcreditsamedaypaymentmethod.py +38 -0
- moovio_sdk/models/components/achcreditstandardpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitcollectpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitfundpaymentmethod.py +38 -0
- moovio_sdk/models/components/achexception.py +20 -0
- moovio_sdk/models/components/achlocation.py +26 -0
- moovio_sdk/models/components/achparticipant.py +93 -0
- moovio_sdk/models/components/achpaymentdetails.py +30 -0
- moovio_sdk/models/components/achpaymentdetailserror.py +22 -0
- moovio_sdk/models/components/achpaymentsettings.py +16 -0
- moovio_sdk/models/components/achreturncode.py +51 -0
- moovio_sdk/models/components/achtransactiondetails.py +94 -0
- moovio_sdk/models/components/achtransactionstatus.py +15 -0
- moovio_sdk/models/components/addcapabilities.py +15 -0
- moovio_sdk/models/components/address.py +30 -0
- moovio_sdk/models/components/addresserror.py +32 -0
- moovio_sdk/models/components/addresssuggestion.py +34 -0
- moovio_sdk/models/components/addressupdate.py +32 -0
- moovio_sdk/models/components/adjustment.py +29 -0
- moovio_sdk/models/components/amount.py +26 -0
- moovio_sdk/models/components/amountdecimal.py +27 -0
- moovio_sdk/models/components/amountupdate.py +27 -0
- moovio_sdk/models/components/amountvalidationerror.py +17 -0
- moovio_sdk/models/components/applebillingcontact.py +53 -0
- moovio_sdk/models/components/applepayheader.py +41 -0
- moovio_sdk/models/components/applepaymerchantdomains.py +32 -0
- moovio_sdk/models/components/applepaypaymentmethod.py +33 -0
- moovio_sdk/models/components/applepayresponse.py +70 -0
- moovio_sdk/models/components/applicationscope.py +41 -0
- moovio_sdk/models/components/asynccreatedrefund.py +26 -0
- moovio_sdk/models/components/asynctransfer.py +18 -0
- moovio_sdk/models/components/authorizeduser.py +21 -0
- moovio_sdk/models/components/authtoken.py +36 -0
- moovio_sdk/models/components/authtokenrequest.py +46 -0
- moovio_sdk/models/components/bankaccount.py +98 -0
- moovio_sdk/models/components/bankaccountexception.py +96 -0
- moovio_sdk/models/components/bankaccountholdertype.py +11 -0
- moovio_sdk/models/components/bankaccountintegration.py +34 -0
- moovio_sdk/models/components/bankaccountpayload.py +21 -0
- moovio_sdk/models/components/bankaccountstatus.py +12 -0
- moovio_sdk/models/components/bankaccountstatusreason.py +23 -0
- moovio_sdk/models/components/bankaccounttype.py +13 -0
- moovio_sdk/models/components/bankaccountverification.py +30 -0
- moovio_sdk/models/components/bankaccountverificationcreated.py +21 -0
- moovio_sdk/models/components/bankaccountverificationmethod.py +9 -0
- moovio_sdk/models/components/bankaccountverificationstatus.py +13 -0
- moovio_sdk/models/components/bankaccountwaitfor.py +9 -0
- moovio_sdk/models/components/basicpaymentmethod.py +24 -0
- moovio_sdk/models/components/billablefee.py +54 -0
- moovio_sdk/models/components/birthdate.py +19 -0
- moovio_sdk/models/components/birthdateerror.py +20 -0
- moovio_sdk/models/components/birthdateupdate.py +20 -0
- moovio_sdk/models/components/birthdatevalidationerror.py +20 -0
- moovio_sdk/models/components/brandcolor.py +15 -0
- moovio_sdk/models/components/brandcolors.py +21 -0
- moovio_sdk/models/components/brandcolorvalidationerror.py +14 -0
- moovio_sdk/models/components/brandproperties.py +16 -0
- moovio_sdk/models/components/businessprofile.py +81 -0
- moovio_sdk/models/components/businesstype.py +19 -0
- moovio_sdk/models/components/calltoaction.py +19 -0
- moovio_sdk/models/components/cancellation.py +22 -0
- moovio_sdk/models/components/cancellationstatus.py +10 -0
- moovio_sdk/models/components/capabilitieserror.py +14 -0
- moovio_sdk/models/components/capability.py +56 -0
- moovio_sdk/models/components/capabilityid.py +18 -0
- moovio_sdk/models/components/capabilityrequirement.py +26 -0
- moovio_sdk/models/components/capabilitystatus.py +13 -0
- moovio_sdk/models/components/card.py +164 -0
- moovio_sdk/models/components/cardaccountupdater.py +28 -0
- moovio_sdk/models/components/cardacquiringdispute.py +26 -0
- moovio_sdk/models/components/cardacquiringmodel.py +11 -0
- moovio_sdk/models/components/cardacquiringrefund.py +42 -0
- moovio_sdk/models/components/cardaddress.py +32 -0
- moovio_sdk/models/components/cardbrand.py +14 -0
- moovio_sdk/models/components/cardexpiration.py +20 -0
- moovio_sdk/models/components/cardexpirationerror.py +17 -0
- moovio_sdk/models/components/cardissuingnetwork.py +12 -0
- moovio_sdk/models/components/cardpaymentdetails.py +23 -0
- moovio_sdk/models/components/cardpaymentdetailserror.py +17 -0
- moovio_sdk/models/components/cardpaymentpaymentmethod.py +33 -0
- moovio_sdk/models/components/cardpaymentsettings.py +23 -0
- moovio_sdk/models/components/cardtransactiondetails.py +94 -0
- moovio_sdk/models/components/cardtransactionfailurecode.py +32 -0
- moovio_sdk/models/components/cardtransactionstatus.py +15 -0
- moovio_sdk/models/components/cardtype.py +13 -0
- moovio_sdk/models/components/cardupdatereason.py +16 -0
- moovio_sdk/models/components/cardverification.py +38 -0
- moovio_sdk/models/components/cardverificationresult.py +12 -0
- moovio_sdk/models/components/cardvolumedistribution.py +29 -0
- moovio_sdk/models/components/cardvolumedistributionerror.py +32 -0
- moovio_sdk/models/components/collectionpaymentmethodtype.py +12 -0
- moovio_sdk/models/components/colorsvalidationerror.py +21 -0
- moovio_sdk/models/components/completebankaccountverification.py +15 -0
- moovio_sdk/models/components/completedmicrodeposits.py +14 -0
- moovio_sdk/models/components/completemicrodeposits.py +20 -0
- moovio_sdk/models/components/countrieserrors.py +14 -0
- moovio_sdk/models/components/createaccount.py +78 -0
- moovio_sdk/models/components/createaccounterror.py +44 -0
- moovio_sdk/models/components/createaccountsettings.py +40 -0
- moovio_sdk/models/components/createapplepaysession.py +21 -0
- moovio_sdk/models/components/createauthorizeduser.py +26 -0
- moovio_sdk/models/components/createauthorizedusererror.py +24 -0
- moovio_sdk/models/components/createauthorizeduserupdate.py +28 -0
- moovio_sdk/models/components/createbusinesserror.py +88 -0
- moovio_sdk/models/components/createbusinessprofile.py +69 -0
- moovio_sdk/models/components/createevidencefilemultipart.py +63 -0
- moovio_sdk/models/components/createevidencetext.py +20 -0
- moovio_sdk/models/components/createfeeplanagreement.py +14 -0
- moovio_sdk/models/components/createindividualerror.py +72 -0
- moovio_sdk/models/components/createindividualprofile.py +37 -0
- moovio_sdk/models/components/createpaymentlink.py +95 -0
- moovio_sdk/models/components/createprofile.py +22 -0
- moovio_sdk/models/components/createprofileerror.py +19 -0
- moovio_sdk/models/components/createrefund.py +26 -0
- moovio_sdk/models/components/createrefundresponse.py +18 -0
- moovio_sdk/models/components/createrepresentative.py +50 -0
- moovio_sdk/models/components/createreversal.py +15 -0
- moovio_sdk/models/components/createsweepconfig.py +41 -0
- moovio_sdk/models/components/createterminalapplication.py +42 -0
- moovio_sdk/models/components/createtransfer.py +49 -0
- moovio_sdk/models/components/createtransferdestination.py +37 -0
- moovio_sdk/models/components/createtransferdestinationach.py +26 -0
- moovio_sdk/models/components/createtransferdestinationcard.py +19 -0
- moovio_sdk/models/components/createtransferoptions.py +24 -0
- moovio_sdk/models/components/createtransfersource.py +48 -0
- moovio_sdk/models/components/createtransfersourceach.py +40 -0
- moovio_sdk/models/components/createtransfersourcecard.py +35 -0
- moovio_sdk/models/components/customersupport.py +33 -0
- moovio_sdk/models/components/customersupporterror.py +25 -0
- moovio_sdk/models/components/debitholdperiod.py +12 -0
- moovio_sdk/models/components/disbursementpaymentmethodtype.py +13 -0
- moovio_sdk/models/components/displayoptionserror.py +23 -0
- moovio_sdk/models/components/dispute.py +76 -0
- moovio_sdk/models/components/disputeevidenceresponse.py +49 -0
- moovio_sdk/models/components/disputephase.py +13 -0
- moovio_sdk/models/components/disputestatus.py +20 -0
- moovio_sdk/models/components/disputetransferdetails.py +16 -0
- moovio_sdk/models/components/document.py +37 -0
- moovio_sdk/models/components/documenttype.py +13 -0
- moovio_sdk/models/components/domesticpullfromcard.py +12 -0
- moovio_sdk/models/components/domesticpushtocard.py +13 -0
- moovio_sdk/models/components/e2eetoken.py +25 -0
- moovio_sdk/models/components/e2eetokenupdate.py +26 -0
- moovio_sdk/models/components/end2endencryptionerror.py +14 -0
- moovio_sdk/models/components/enrichedaddressresponse.py +15 -0
- moovio_sdk/models/components/enrichedbusinessprofile.py +37 -0
- moovio_sdk/models/components/enrichedbusinessresponse.py +18 -0
- moovio_sdk/models/components/enrichedindustries.py +15 -0
- moovio_sdk/models/components/enrichedindustry.py +32 -0
- moovio_sdk/models/components/enrichedindustrycodes.py +17 -0
- moovio_sdk/models/components/evidencetextresponse.py +28 -0
- moovio_sdk/models/components/evidencetype.py +15 -0
- moovio_sdk/models/components/evidenceuploadresponse.py +50 -0
- moovio_sdk/models/components/facilitatorfee.py +48 -0
- moovio_sdk/models/components/feecategory.py +16 -0
- moovio_sdk/models/components/feemodel.py +12 -0
- moovio_sdk/models/components/feeplan.py +43 -0
- moovio_sdk/models/components/feeplanagreement.py +51 -0
- moovio_sdk/models/components/feeplanagreementstatus.py +9 -0
- moovio_sdk/models/components/feeproperties.py +49 -0
- moovio_sdk/models/components/filedetails.py +55 -0
- moovio_sdk/models/components/filepurpose.py +15 -0
- moovio_sdk/models/components/filestatus.py +12 -0
- moovio_sdk/models/components/fileuploadrequestmultipart.py +69 -0
- moovio_sdk/models/components/financialinstitutions.py +18 -0
- moovio_sdk/models/components/fulfillmentdetails.py +24 -0
- moovio_sdk/models/components/fulfillmentdetailserror.py +20 -0
- moovio_sdk/models/components/fullissuedcard.py +92 -0
- moovio_sdk/models/components/generatedby.py +39 -0
- moovio_sdk/models/components/generatedbyaccountid.py +15 -0
- moovio_sdk/models/components/generatedbybankaccountid.py +17 -0
- moovio_sdk/models/components/generatedbycardid.py +15 -0
- moovio_sdk/models/components/generatedbydisputeid.py +15 -0
- moovio_sdk/models/components/generatedbytransferid.py +15 -0
- moovio_sdk/models/components/governmentid.py +40 -0
- moovio_sdk/models/components/governmentiderror.py +40 -0
- moovio_sdk/models/components/granttype.py +15 -0
- moovio_sdk/models/components/incurredfee.py +44 -0
- moovio_sdk/models/components/individualname.py +32 -0
- moovio_sdk/models/components/individualnameerror.py +24 -0
- moovio_sdk/models/components/individualnameupdate.py +32 -0
- moovio_sdk/models/components/individualprofile.py +45 -0
- moovio_sdk/models/components/industrycodes.py +20 -0
- moovio_sdk/models/components/issuedcard.py +78 -0
- moovio_sdk/models/components/issuedcardauthorization.py +53 -0
- moovio_sdk/models/components/issuedcardauthorizationevent.py +37 -0
- moovio_sdk/models/components/issuedcardauthorizationeventresult.py +12 -0
- moovio_sdk/models/components/issuedcardeventtype.py +15 -0
- moovio_sdk/models/components/issuedcardformfactor.py +10 -0
- moovio_sdk/models/components/issuedcardstate.py +19 -0
- moovio_sdk/models/components/issuedcardtransaction.py +42 -0
- moovio_sdk/models/components/issuingauthorizationstatus.py +14 -0
- moovio_sdk/models/components/issuingcontrols.py +25 -0
- moovio_sdk/models/components/issuingcontrolserror.py +22 -0
- moovio_sdk/models/components/issuingintervallimit.py +10 -0
- moovio_sdk/models/components/issuingmerchantdata.py +47 -0
- moovio_sdk/models/components/issuingvelocitylimit.py +21 -0
- moovio_sdk/models/components/issuingvelocitylimiterror.py +17 -0
- moovio_sdk/models/components/jsonwebkey.py +103 -0
- moovio_sdk/models/components/linkapplepay.py +54 -0
- moovio_sdk/models/components/linkapplepaymentdata.py +51 -0
- moovio_sdk/models/components/linkapplepaymentmethod.py +38 -0
- moovio_sdk/models/components/linkapplepaytoken.py +63 -0
- moovio_sdk/models/components/linkbankaccount.py +26 -0
- moovio_sdk/models/components/linkcard.py +54 -0
- moovio_sdk/models/components/linkcardwaitfor.py +8 -0
- moovio_sdk/models/components/linkedapplepaypaymentmethod.py +30 -0
- moovio_sdk/models/components/listfeesfetchrequest.py +19 -0
- moovio_sdk/models/components/manualtermsofservice.py +34 -0
- moovio_sdk/models/components/manualtermsofserviceupdate.py +41 -0
- moovio_sdk/models/components/microdepositstatus.py +8 -0
- moovio_sdk/models/components/mode.py +11 -0
- moovio_sdk/models/components/moovfeedetails.py +36 -0
- moovio_sdk/models/components/moovwalletpaymentmethod.py +31 -0
- moovio_sdk/models/components/mxauthorizationcode.py +26 -0
- moovio_sdk/models/components/mxpayload.py +46 -0
- moovio_sdk/models/components/occurrence.py +44 -0
- moovio_sdk/models/components/occurrencesresponse.py +80 -0
- moovio_sdk/models/components/occurrencestatus.py +12 -0
- moovio_sdk/models/components/onboardinginvite.py +91 -0
- moovio_sdk/models/components/onboardinginviterequest.py +57 -0
- moovio_sdk/models/components/onboardingpartneraccount.py +31 -0
- moovio_sdk/models/components/partnerpricing.py +46 -0
- moovio_sdk/models/components/partnerpricingagreement.py +56 -0
- moovio_sdk/models/components/patchaccount.py +138 -0
- moovio_sdk/models/components/patchaccounterror.py +38 -0
- moovio_sdk/models/components/patchbusiness.py +72 -0
- moovio_sdk/models/components/patchindividual.py +43 -0
- moovio_sdk/models/components/patchprofile.py +29 -0
- moovio_sdk/models/components/patchsweepconfig.py +147 -0
- moovio_sdk/models/components/patchtransfer.py +51 -0
- moovio_sdk/models/components/paymentdetailserror.py +35 -0
- moovio_sdk/models/components/paymentlink.py +125 -0
- moovio_sdk/models/components/paymentlinkcustomeroptions.py +31 -0
- moovio_sdk/models/components/paymentlinkdisplayoptions.py +39 -0
- moovio_sdk/models/components/paymentlinkdisplayoptionsupdate.py +42 -0
- moovio_sdk/models/components/paymentlinkpaymentdetails.py +40 -0
- moovio_sdk/models/components/paymentlinkpaymentdetailsupdate.py +41 -0
- moovio_sdk/models/components/paymentlinkpayoutdetails.py +32 -0
- moovio_sdk/models/components/paymentlinkpayoutdetailsupdate.py +33 -0
- moovio_sdk/models/components/paymentlinkstatus.py +11 -0
- moovio_sdk/models/components/paymentmethod.py +82 -0
- moovio_sdk/models/components/paymentmethodsbankaccount.py +65 -0
- moovio_sdk/models/components/paymentmethodscard.py +121 -0
- moovio_sdk/models/components/paymentmethodswallet.py +14 -0
- moovio_sdk/models/components/paymentmethodtype.py +19 -0
- moovio_sdk/models/components/payoutdetailserror.py +21 -0
- moovio_sdk/models/components/payoutrecipient.py +23 -0
- moovio_sdk/models/components/payoutrecipienterror.py +14 -0
- moovio_sdk/models/components/payoutrecipientupdate.py +24 -0
- moovio_sdk/models/components/phonenumber.py +18 -0
- moovio_sdk/models/components/phonenumbererror.py +18 -0
- moovio_sdk/models/components/plaidintegration.py +39 -0
- moovio_sdk/models/components/plaidlinkintegration.py +36 -0
- moovio_sdk/models/components/plaidlinkpayload.py +45 -0
- moovio_sdk/models/components/plaidpayload.py +42 -0
- moovio_sdk/models/components/primaryregulator.py +13 -0
- moovio_sdk/models/components/profile.py +27 -0
- moovio_sdk/models/components/pullfromcardpaymentmethod.py +33 -0
- moovio_sdk/models/components/pushtocardpaymentmethod.py +33 -0
- moovio_sdk/models/components/qrcode.py +16 -0
- moovio_sdk/models/components/receiptkind.py +10 -0
- moovio_sdk/models/components/receiptrequest.py +75 -0
- moovio_sdk/models/components/receiptresponse.py +95 -0
- moovio_sdk/models/components/recur.py +40 -0
- moovio_sdk/models/components/refundcarddetails.py +44 -0
- moovio_sdk/models/components/refundcardstatus.py +12 -0
- moovio_sdk/models/components/refundstatus.py +11 -0
- moovio_sdk/models/components/registerapplepaymerchantdomains.py +22 -0
- moovio_sdk/models/components/representative.py +71 -0
- moovio_sdk/models/components/representativeresponsibilities.py +42 -0
- moovio_sdk/models/components/representativeresponsibilitieserror.py +26 -0
- moovio_sdk/models/components/requestcard.py +44 -0
- moovio_sdk/models/components/requirementerror.py +24 -0
- moovio_sdk/models/components/requirementerrorcode.py +25 -0
- moovio_sdk/models/components/requirementid.py +71 -0
- moovio_sdk/models/components/returnpolicytype.py +11 -0
- moovio_sdk/models/components/reversal.py +23 -0
- moovio_sdk/models/components/reversedwithcancellation.py +14 -0
- moovio_sdk/models/components/reversedwithrefund.py +16 -0
- moovio_sdk/models/components/revoketokenrequest.py +40 -0
- moovio_sdk/models/components/rtpcreditpaymentmethod.py +38 -0
- moovio_sdk/models/components/rtpfailurecode.py +19 -0
- moovio_sdk/models/components/rtprejectioncode.py +25 -0
- moovio_sdk/models/components/rtptransactiondetails.py +56 -0
- moovio_sdk/models/components/rtptransactionstatus.py +13 -0
- moovio_sdk/models/components/runtransfer.py +34 -0
- moovio_sdk/models/components/schedulepaymentmethod.py +56 -0
- moovio_sdk/models/components/scheduleresponse.py +60 -0
- moovio_sdk/models/components/seccode.py +13 -0
- moovio_sdk/models/components/security.py +32 -0
- moovio_sdk/models/components/sentreceipt.py +27 -0
- moovio_sdk/models/components/settings.py +30 -0
- moovio_sdk/models/components/sourcedestinationoptions.py +20 -0
- moovio_sdk/models/components/sweep.py +80 -0
- moovio_sdk/models/components/sweepconfig.py +81 -0
- moovio_sdk/models/components/sweepconfigpaymentmethod.py +31 -0
- moovio_sdk/models/components/sweepconfigstatus.py +9 -0
- moovio_sdk/models/components/sweepstatus.py +13 -0
- moovio_sdk/models/components/taxid.py +25 -0
- moovio_sdk/models/components/taxidupdate.py +26 -0
- moovio_sdk/models/components/terminalapplication.py +55 -0
- moovio_sdk/models/components/terminalapplicationplatform.py +12 -0
- moovio_sdk/models/components/terminalapplicationstatus.py +13 -0
- moovio_sdk/models/components/termsofservice.py +26 -0
- moovio_sdk/models/components/termsofserviceerror.py +39 -0
- moovio_sdk/models/components/termsofservicetoken.py +17 -0
- moovio_sdk/models/components/termsofservicetokenupdate.py +18 -0
- moovio_sdk/models/components/tokentype.py +10 -0
- moovio_sdk/models/components/transactionsource.py +16 -0
- moovio_sdk/models/components/transfer.py +126 -0
- moovio_sdk/models/components/transferaccount.py +20 -0
- moovio_sdk/models/components/transferdestination.py +83 -0
- moovio_sdk/models/components/transferfailurereason.py +14 -0
- moovio_sdk/models/components/transferoptions.py +23 -0
- moovio_sdk/models/components/transferresponse.py +15 -0
- moovio_sdk/models/components/transfersource.py +80 -0
- moovio_sdk/models/components/transferstatus.py +16 -0
- moovio_sdk/models/components/transferwaitfor.py +8 -0
- moovio_sdk/models/components/underwriting.py +56 -0
- moovio_sdk/models/components/underwritingstatus.py +16 -0
- moovio_sdk/models/components/updateapplepaymerchantdomains.py +26 -0
- moovio_sdk/models/components/updatebrand.py +15 -0
- moovio_sdk/models/components/updatecard.py +51 -0
- moovio_sdk/models/components/updatecardaddress.py +32 -0
- moovio_sdk/models/components/updatecardexpiration.py +17 -0
- moovio_sdk/models/components/updatecolor.py +14 -0
- moovio_sdk/models/components/updatecolors.py +18 -0
- moovio_sdk/models/components/updateevidence.py +23 -0
- moovio_sdk/models/components/updateissuedcard.py +44 -0
- moovio_sdk/models/components/updatepaymentlink.py +98 -0
- moovio_sdk/models/components/updaterepresentative.py +224 -0
- moovio_sdk/models/components/updateunderwriting.py +43 -0
- moovio_sdk/models/components/upsertschedule.py +26 -0
- moovio_sdk/models/components/verification.py +54 -0
- moovio_sdk/models/components/verificationstatus.py +17 -0
- moovio_sdk/models/components/verificationstatusdetail.py +23 -0
- moovio_sdk/models/components/volumebycustomertype.py +21 -0
- moovio_sdk/models/components/volumebycustomertypeerror.py +22 -0
- moovio_sdk/models/components/wallet.py +27 -0
- moovio_sdk/models/components/walletavailablebalance.py +30 -0
- moovio_sdk/models/components/wallettransaction.py +114 -0
- moovio_sdk/models/components/wallettransactionsourcetype.py +13 -0
- moovio_sdk/models/components/wallettransactionstatus.py +11 -0
- moovio_sdk/models/components/wallettransactiontype.py +32 -0
- moovio_sdk/models/errors/__init__.py +155 -0
- moovio_sdk/models/errors/addcapabilitieserror.py +23 -0
- moovio_sdk/models/errors/apierror.py +22 -0
- moovio_sdk/models/errors/assigncountrieserror.py +20 -0
- moovio_sdk/models/errors/authtokenrequesterror.py +22 -0
- moovio_sdk/models/errors/bankaccountvalidationerror.py +30 -0
- moovio_sdk/models/errors/brandvalidationerror.py +23 -0
- moovio_sdk/models/errors/cardacquiringrefund.py +44 -0
- moovio_sdk/models/errors/createaccount.py +24 -0
- moovio_sdk/models/errors/createpaymentlinkerror.py +46 -0
- moovio_sdk/models/errors/createsweepconfigerror.py +40 -0
- moovio_sdk/models/errors/feeplanagreementerror.py +22 -0
- moovio_sdk/models/errors/fileuploadvalidationerror.py +35 -0
- moovio_sdk/models/errors/filevalidationerror.py +28 -0
- moovio_sdk/models/errors/genericerror.py +19 -0
- moovio_sdk/models/errors/linkapplepayerror.py +36 -0
- moovio_sdk/models/errors/linkcarderror.py +47 -0
- moovio_sdk/models/errors/microdepositvalidationerror.py +20 -0
- moovio_sdk/models/errors/onboardinginviteerror.py +34 -0
- moovio_sdk/models/errors/patchsweepconfigerror.py +38 -0
- moovio_sdk/models/errors/receiptvalidationerror.py +40 -0
- moovio_sdk/models/errors/refundvalidationerror.py +23 -0
- moovio_sdk/models/errors/representativevalidationerror.py +68 -0
- moovio_sdk/models/errors/requestcarderror.py +42 -0
- moovio_sdk/models/errors/reversalvalidationerror.py +20 -0
- moovio_sdk/models/errors/revoketokenrequesterror.py +22 -0
- moovio_sdk/models/errors/schedulevalidationerror.py +24 -0
- moovio_sdk/models/errors/terminalapplicationerror.py +30 -0
- moovio_sdk/models/errors/transfer.py +108 -0
- moovio_sdk/models/errors/transferoptionsvalidationerror.py +24 -0
- moovio_sdk/models/errors/transfervalidationerror.py +49 -0
- moovio_sdk/models/errors/updateaccount.py +24 -0
- moovio_sdk/models/errors/updatecarderror.py +43 -0
- moovio_sdk/models/errors/updateissuedcarderror.py +32 -0
- moovio_sdk/models/errors/updatepaymentlinkerror.py +36 -0
- moovio_sdk/models/errors/updateunderwritingerror.py +70 -0
- moovio_sdk/models/internal/__init__.py +6 -0
- moovio_sdk/models/internal/globals.py +40 -0
- moovio_sdk/models/operations/__init__.py +1824 -0
- moovio_sdk/models/operations/acceptdispute.py +71 -0
- moovio_sdk/models/operations/assignaccountcountries.py +75 -0
- moovio_sdk/models/operations/cancelschedule.py +67 -0
- moovio_sdk/models/operations/completebankaccountverification.py +85 -0
- moovio_sdk/models/operations/completemicrodeposits.py +87 -0
- moovio_sdk/models/operations/createaccesstoken.py +52 -0
- moovio_sdk/models/operations/createaccount.py +52 -0
- moovio_sdk/models/operations/createapplepaysession.py +81 -0
- moovio_sdk/models/operations/createbrand.py +75 -0
- moovio_sdk/models/operations/createcancellation.py +75 -0
- moovio_sdk/models/operations/createfeeplanagreements.py +80 -0
- moovio_sdk/models/operations/createonboardinginvite.py +52 -0
- moovio_sdk/models/operations/createpaymentlink.py +78 -0
- moovio_sdk/models/operations/createreceipts.py +52 -0
- moovio_sdk/models/operations/createrepresentative.py +80 -0
- moovio_sdk/models/operations/createreversal.py +98 -0
- moovio_sdk/models/operations/createschedule.py +78 -0
- moovio_sdk/models/operations/createsweepconfig.py +78 -0
- moovio_sdk/models/operations/createterminalapplication.py +54 -0
- moovio_sdk/models/operations/createtransfer.py +125 -0
- moovio_sdk/models/operations/createtransferoptions.py +52 -0
- moovio_sdk/models/operations/deletedisputeevidencefile.py +74 -0
- moovio_sdk/models/operations/deleterepresentative.py +71 -0
- moovio_sdk/models/operations/deleteterminalapplication.py +60 -0
- moovio_sdk/models/operations/disablebankaccount.py +67 -0
- moovio_sdk/models/operations/disablecapability.py +76 -0
- moovio_sdk/models/operations/disablecard.py +67 -0
- moovio_sdk/models/operations/disablepaymentlink.py +67 -0
- moovio_sdk/models/operations/disconnectaccount.py +60 -0
- moovio_sdk/models/operations/generateendtoendkey.py +60 -0
- moovio_sdk/models/operations/getaccount.py +64 -0
- moovio_sdk/models/operations/getaccountcountries.py +64 -0
- moovio_sdk/models/operations/getadjustment.py +71 -0
- moovio_sdk/models/operations/getapplepaymerchantdomains.py +68 -0
- moovio_sdk/models/operations/getavatar.py +66 -0
- moovio_sdk/models/operations/getbankaccount.py +71 -0
- moovio_sdk/models/operations/getbankaccountverification.py +73 -0
- moovio_sdk/models/operations/getbrand.py +64 -0
- moovio_sdk/models/operations/getcancellation.py +84 -0
- moovio_sdk/models/operations/getcapability.py +82 -0
- moovio_sdk/models/operations/getcard.py +71 -0
- moovio_sdk/models/operations/getdispute.py +71 -0
- moovio_sdk/models/operations/getdisputeevidence.py +80 -0
- moovio_sdk/models/operations/getdisputeevidencedata.py +90 -0
- moovio_sdk/models/operations/getenrichmentaddress.py +178 -0
- moovio_sdk/models/operations/getenrichmentprofile.py +64 -0
- moovio_sdk/models/operations/getfiledetails.py +71 -0
- moovio_sdk/models/operations/getfullissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcardauthorization.py +75 -0
- moovio_sdk/models/operations/getissuedcardtransaction.py +75 -0
- moovio_sdk/models/operations/getmerchantprocessingagreement.py +64 -0
- moovio_sdk/models/operations/getonboardinginvite.py +62 -0
- moovio_sdk/models/operations/getpaymentlink.py +71 -0
- moovio_sdk/models/operations/getpaymentlinkqrcode.py +84 -0
- moovio_sdk/models/operations/getpaymentmethod.py +71 -0
- moovio_sdk/models/operations/getrefund.py +84 -0
- moovio_sdk/models/operations/getrepresentative.py +75 -0
- moovio_sdk/models/operations/getscheduledoccurrence.py +92 -0
- moovio_sdk/models/operations/getschedules.py +71 -0
- moovio_sdk/models/operations/getsweep.py +78 -0
- moovio_sdk/models/operations/getsweepconfig.py +71 -0
- moovio_sdk/models/operations/getterminalapplication.py +66 -0
- moovio_sdk/models/operations/gettermsofservicetoken.py +75 -0
- moovio_sdk/models/operations/gettransfer.py +73 -0
- moovio_sdk/models/operations/getunderwriting.py +64 -0
- moovio_sdk/models/operations/getwallet.py +71 -0
- moovio_sdk/models/operations/getwallettransaction.py +80 -0
- moovio_sdk/models/operations/initiatebankaccountverification.py +89 -0
- moovio_sdk/models/operations/initiatemicrodeposits.py +67 -0
- moovio_sdk/models/operations/initiaterefund.py +131 -0
- moovio_sdk/models/operations/linkapplepaytoken.py +80 -0
- moovio_sdk/models/operations/linkbankaccount.py +96 -0
- moovio_sdk/models/operations/linkcard.py +96 -0
- moovio_sdk/models/operations/listaccounts.py +171 -0
- moovio_sdk/models/operations/listadjustments.py +78 -0
- moovio_sdk/models/operations/listbankaccounts.py +64 -0
- moovio_sdk/models/operations/listcapabilities.py +64 -0
- moovio_sdk/models/operations/listcards.py +64 -0
- moovio_sdk/models/operations/listdisputeevidence.py +73 -0
- moovio_sdk/models/operations/listdisputes.py +172 -0
- moovio_sdk/models/operations/listfeeplanagreements.py +101 -0
- moovio_sdk/models/operations/listfeeplans.py +78 -0
- moovio_sdk/models/operations/listfeesfetch.py +80 -0
- moovio_sdk/models/operations/listfiles.py +64 -0
- moovio_sdk/models/operations/listindustries.py +62 -0
- moovio_sdk/models/operations/listinstitutions.py +92 -0
- moovio_sdk/models/operations/listissuedcardauthorizationevents.py +94 -0
- moovio_sdk/models/operations/listissuedcardauthorizations.py +126 -0
- moovio_sdk/models/operations/listissuedcards.py +94 -0
- moovio_sdk/models/operations/listissuedcardtransactions.py +113 -0
- moovio_sdk/models/operations/listonboardinginvites.py +60 -0
- moovio_sdk/models/operations/listpartnerpricing.py +78 -0
- moovio_sdk/models/operations/listpartnerpricingagreements.py +101 -0
- moovio_sdk/models/operations/listpaymentlinks.py +64 -0
- moovio_sdk/models/operations/listpaymentmethods.py +98 -0
- moovio_sdk/models/operations/listreceipts.py +65 -0
- moovio_sdk/models/operations/listrefunds.py +75 -0
- moovio_sdk/models/operations/listrepresentatives.py +66 -0
- moovio_sdk/models/operations/listschedules.py +81 -0
- moovio_sdk/models/operations/listsweepconfigs.py +64 -0
- moovio_sdk/models/operations/listsweeps.py +108 -0
- moovio_sdk/models/operations/listterminalapplications.py +62 -0
- moovio_sdk/models/operations/listtransfers.py +145 -0
- moovio_sdk/models/operations/listwallets.py +64 -0
- moovio_sdk/models/operations/listwallettransactions.py +189 -0
- moovio_sdk/models/operations/ping.py +56 -0
- moovio_sdk/models/operations/registerapplepaymerchantdomains.py +80 -0
- moovio_sdk/models/operations/requestcapabilities.py +78 -0
- moovio_sdk/models/operations/requestcard.py +80 -0
- moovio_sdk/models/operations/retrievefees.py +117 -0
- moovio_sdk/models/operations/revokeaccesstoken.py +48 -0
- moovio_sdk/models/operations/revokeonboardinginvite.py +58 -0
- moovio_sdk/models/operations/submitdisputeevidence.py +71 -0
- moovio_sdk/models/operations/testendtoendtoken.py +56 -0
- moovio_sdk/models/operations/updateaccount.py +78 -0
- moovio_sdk/models/operations/updateapplepaymerchantdomains.py +78 -0
- moovio_sdk/models/operations/updatebrand.py +78 -0
- moovio_sdk/models/operations/updatecard.py +85 -0
- moovio_sdk/models/operations/updatedisputeevidence.py +92 -0
- moovio_sdk/models/operations/updateissuedcard.py +81 -0
- moovio_sdk/models/operations/updatepaymentlink.py +85 -0
- moovio_sdk/models/operations/updaterepresentative.py +89 -0
- moovio_sdk/models/operations/updateschedule.py +85 -0
- moovio_sdk/models/operations/updatesweepconfig.py +85 -0
- moovio_sdk/models/operations/updatetransfer.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencefile.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencetext.py +85 -0
- moovio_sdk/models/operations/uploadfile.py +80 -0
- moovio_sdk/models/operations/upsertbrand.py +75 -0
- moovio_sdk/models/operations/upsertunderwriting.py +78 -0
- moovio_sdk/onboarding.py +965 -0
- moovio_sdk/payment_links.py +1694 -0
- moovio_sdk/payment_methods.py +475 -0
- moovio_sdk/ping.py +233 -0
- moovio_sdk/py.typed +1 -0
- moovio_sdk/receipts.py +507 -0
- moovio_sdk/representatives.py +1513 -0
- moovio_sdk/scheduling.py +1565 -0
- moovio_sdk/sdk.py +242 -0
- moovio_sdk/sdkconfiguration.py +59 -0
- moovio_sdk/sweeps.py +1617 -0
- moovio_sdk/terminal_applications.py +1013 -0
- moovio_sdk/transfers.py +3040 -0
- moovio_sdk/types/__init__.py +21 -0
- moovio_sdk/types/basemodel.py +39 -0
- moovio_sdk/underwriting.py +581 -0
- moovio_sdk/utils/__init__.py +101 -0
- moovio_sdk/utils/annotations.py +55 -0
- moovio_sdk/utils/enums.py +34 -0
- moovio_sdk/utils/eventstreaming.py +238 -0
- moovio_sdk/utils/forms.py +202 -0
- moovio_sdk/utils/headers.py +136 -0
- moovio_sdk/utils/logger.py +27 -0
- moovio_sdk/utils/metadata.py +118 -0
- moovio_sdk/utils/queryparams.py +205 -0
- moovio_sdk/utils/requestbodies.py +66 -0
- moovio_sdk/utils/retries.py +217 -0
- moovio_sdk/utils/security.py +195 -0
- moovio_sdk/utils/serializers.py +215 -0
- moovio_sdk/utils/url.py +155 -0
- moovio_sdk/utils/values.py +137 -0
- moovio_sdk/wallet_transactions.py +558 -0
- moovio_sdk/wallets.py +465 -0
- moovio_sdk-0.3.8.dist-info/METADATA +1920 -0
- moovio_sdk-0.3.8.dist-info/RECORD +586 -0
- moovio_sdk-0.3.8.dist-info/WHEEL +4 -0
@@ -0,0 +1,1694 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from datetime import datetime
|
5
|
+
from enum import Enum
|
6
|
+
from moovio_sdk import utils
|
7
|
+
from moovio_sdk._hooks import HookContext
|
8
|
+
from moovio_sdk.models import components, errors, operations
|
9
|
+
from moovio_sdk.types import OptionalNullable, UNSET
|
10
|
+
from moovio_sdk.utils import get_security_from_env
|
11
|
+
from typing import Any, List, Mapping, Optional, Union
|
12
|
+
|
13
|
+
|
14
|
+
class GetQRCodeAcceptEnum(str, Enum):
|
15
|
+
APPLICATION_JSON = "application/json"
|
16
|
+
IMAGE_PNG = "image/png"
|
17
|
+
|
18
|
+
|
19
|
+
class PaymentLinks(BaseSDK):
|
20
|
+
def create(
|
21
|
+
self,
|
22
|
+
*,
|
23
|
+
account_id: str,
|
24
|
+
partner_account_id: str,
|
25
|
+
merchant_payment_method_id: str,
|
26
|
+
amount: Union[components.Amount, components.AmountTypedDict],
|
27
|
+
display: Union[
|
28
|
+
components.PaymentLinkDisplayOptions,
|
29
|
+
components.PaymentLinkDisplayOptionsTypedDict,
|
30
|
+
],
|
31
|
+
max_uses: Optional[int] = None,
|
32
|
+
expires_on: Optional[datetime] = None,
|
33
|
+
customer: Optional[
|
34
|
+
Union[
|
35
|
+
components.PaymentLinkCustomerOptions,
|
36
|
+
components.PaymentLinkCustomerOptionsTypedDict,
|
37
|
+
]
|
38
|
+
] = None,
|
39
|
+
payment: Optional[
|
40
|
+
Union[
|
41
|
+
components.PaymentLinkPaymentDetails,
|
42
|
+
components.PaymentLinkPaymentDetailsTypedDict,
|
43
|
+
]
|
44
|
+
] = None,
|
45
|
+
payout: Optional[
|
46
|
+
Union[
|
47
|
+
components.PaymentLinkPayoutDetails,
|
48
|
+
components.PaymentLinkPayoutDetailsTypedDict,
|
49
|
+
]
|
50
|
+
] = None,
|
51
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
52
|
+
server_url: Optional[str] = None,
|
53
|
+
timeout_ms: Optional[int] = None,
|
54
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
55
|
+
) -> operations.CreatePaymentLinkResponse:
|
56
|
+
r"""Create a payment link that allows an end user to make a payment on Moov's hosted payment link page.
|
57
|
+
|
58
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
59
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
60
|
+
|
61
|
+
:param account_id:
|
62
|
+
:param partner_account_id: The partner's Moov account ID.
|
63
|
+
:param merchant_payment_method_id: The merchant's preferred payment method ID. Must be a wallet payment method.
|
64
|
+
:param amount:
|
65
|
+
:param display: Customizable display options for a payment link.
|
66
|
+
:param max_uses: An optional limit on the number of times this payment link can be used. **For payouts, `maxUses` is always 1.**
|
67
|
+
:param expires_on: An optional expiration date for this payment link.
|
68
|
+
:param customer:
|
69
|
+
:param payment: Options for payment links used to collect payment.
|
70
|
+
:param payout:
|
71
|
+
:param retries: Override the default retry configuration for this method
|
72
|
+
:param server_url: Override the default server URL for this method
|
73
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
74
|
+
:param http_headers: Additional headers to set or replace on requests.
|
75
|
+
"""
|
76
|
+
base_url = None
|
77
|
+
url_variables = None
|
78
|
+
if timeout_ms is None:
|
79
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
80
|
+
|
81
|
+
if server_url is not None:
|
82
|
+
base_url = server_url
|
83
|
+
else:
|
84
|
+
base_url = self._get_url(base_url, url_variables)
|
85
|
+
|
86
|
+
request = operations.CreatePaymentLinkRequest(
|
87
|
+
account_id=account_id,
|
88
|
+
create_payment_link=components.CreatePaymentLink(
|
89
|
+
partner_account_id=partner_account_id,
|
90
|
+
merchant_payment_method_id=merchant_payment_method_id,
|
91
|
+
amount=utils.get_pydantic_model(amount, components.Amount),
|
92
|
+
max_uses=max_uses,
|
93
|
+
expires_on=expires_on,
|
94
|
+
display=utils.get_pydantic_model(
|
95
|
+
display, components.PaymentLinkDisplayOptions
|
96
|
+
),
|
97
|
+
customer=utils.get_pydantic_model(
|
98
|
+
customer, Optional[components.PaymentLinkCustomerOptions]
|
99
|
+
),
|
100
|
+
payment=utils.get_pydantic_model(
|
101
|
+
payment, Optional[components.PaymentLinkPaymentDetails]
|
102
|
+
),
|
103
|
+
payout=utils.get_pydantic_model(
|
104
|
+
payout, Optional[components.PaymentLinkPayoutDetails]
|
105
|
+
),
|
106
|
+
),
|
107
|
+
)
|
108
|
+
|
109
|
+
req = self._build_request(
|
110
|
+
method="POST",
|
111
|
+
path="/accounts/{accountID}/payment-links",
|
112
|
+
base_url=base_url,
|
113
|
+
url_variables=url_variables,
|
114
|
+
request=request,
|
115
|
+
request_body_required=True,
|
116
|
+
request_has_path_params=True,
|
117
|
+
request_has_query_params=True,
|
118
|
+
user_agent_header="user-agent",
|
119
|
+
accept_header_value="application/json",
|
120
|
+
http_headers=http_headers,
|
121
|
+
_globals=operations.CreatePaymentLinkGlobals(
|
122
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
123
|
+
),
|
124
|
+
security=self.sdk_configuration.security,
|
125
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
126
|
+
request.create_payment_link,
|
127
|
+
False,
|
128
|
+
False,
|
129
|
+
"json",
|
130
|
+
components.CreatePaymentLink,
|
131
|
+
),
|
132
|
+
timeout_ms=timeout_ms,
|
133
|
+
)
|
134
|
+
|
135
|
+
if retries == UNSET:
|
136
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
137
|
+
retries = self.sdk_configuration.retry_config
|
138
|
+
|
139
|
+
retry_config = None
|
140
|
+
if isinstance(retries, utils.RetryConfig):
|
141
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
142
|
+
|
143
|
+
http_res = self.do_request(
|
144
|
+
hook_ctx=HookContext(
|
145
|
+
base_url=base_url or "",
|
146
|
+
operation_id="createPaymentLink",
|
147
|
+
oauth2_scopes=[],
|
148
|
+
security_source=get_security_from_env(
|
149
|
+
self.sdk_configuration.security, components.Security
|
150
|
+
),
|
151
|
+
),
|
152
|
+
request=req,
|
153
|
+
error_status_codes=[
|
154
|
+
"400",
|
155
|
+
"401",
|
156
|
+
"403",
|
157
|
+
"404",
|
158
|
+
"409",
|
159
|
+
"422",
|
160
|
+
"429",
|
161
|
+
"4XX",
|
162
|
+
"500",
|
163
|
+
"504",
|
164
|
+
"5XX",
|
165
|
+
],
|
166
|
+
retry_config=retry_config,
|
167
|
+
)
|
168
|
+
|
169
|
+
response_data: Any = None
|
170
|
+
if utils.match_response(http_res, "200", "application/json"):
|
171
|
+
return operations.CreatePaymentLinkResponse(
|
172
|
+
result=utils.unmarshal_json(http_res.text, components.PaymentLink),
|
173
|
+
headers=utils.get_response_headers(http_res.headers),
|
174
|
+
)
|
175
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
176
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
177
|
+
raise errors.GenericError(data=response_data)
|
178
|
+
if utils.match_response(http_res, "422", "application/json"):
|
179
|
+
response_data = utils.unmarshal_json(
|
180
|
+
http_res.text, errors.CreatePaymentLinkErrorData
|
181
|
+
)
|
182
|
+
raise errors.CreatePaymentLinkError(data=response_data)
|
183
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
184
|
+
http_res_text = utils.stream_to_text(http_res)
|
185
|
+
raise errors.APIError(
|
186
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
187
|
+
)
|
188
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
189
|
+
http_res_text = utils.stream_to_text(http_res)
|
190
|
+
raise errors.APIError(
|
191
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
192
|
+
)
|
193
|
+
if utils.match_response(http_res, "4XX", "*"):
|
194
|
+
http_res_text = utils.stream_to_text(http_res)
|
195
|
+
raise errors.APIError(
|
196
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
197
|
+
)
|
198
|
+
if utils.match_response(http_res, "5XX", "*"):
|
199
|
+
http_res_text = utils.stream_to_text(http_res)
|
200
|
+
raise errors.APIError(
|
201
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
202
|
+
)
|
203
|
+
|
204
|
+
content_type = http_res.headers.get("Content-Type")
|
205
|
+
http_res_text = utils.stream_to_text(http_res)
|
206
|
+
raise errors.APIError(
|
207
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
208
|
+
http_res.status_code,
|
209
|
+
http_res_text,
|
210
|
+
http_res,
|
211
|
+
)
|
212
|
+
|
213
|
+
async def create_async(
|
214
|
+
self,
|
215
|
+
*,
|
216
|
+
account_id: str,
|
217
|
+
partner_account_id: str,
|
218
|
+
merchant_payment_method_id: str,
|
219
|
+
amount: Union[components.Amount, components.AmountTypedDict],
|
220
|
+
display: Union[
|
221
|
+
components.PaymentLinkDisplayOptions,
|
222
|
+
components.PaymentLinkDisplayOptionsTypedDict,
|
223
|
+
],
|
224
|
+
max_uses: Optional[int] = None,
|
225
|
+
expires_on: Optional[datetime] = None,
|
226
|
+
customer: Optional[
|
227
|
+
Union[
|
228
|
+
components.PaymentLinkCustomerOptions,
|
229
|
+
components.PaymentLinkCustomerOptionsTypedDict,
|
230
|
+
]
|
231
|
+
] = None,
|
232
|
+
payment: Optional[
|
233
|
+
Union[
|
234
|
+
components.PaymentLinkPaymentDetails,
|
235
|
+
components.PaymentLinkPaymentDetailsTypedDict,
|
236
|
+
]
|
237
|
+
] = None,
|
238
|
+
payout: Optional[
|
239
|
+
Union[
|
240
|
+
components.PaymentLinkPayoutDetails,
|
241
|
+
components.PaymentLinkPayoutDetailsTypedDict,
|
242
|
+
]
|
243
|
+
] = None,
|
244
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
245
|
+
server_url: Optional[str] = None,
|
246
|
+
timeout_ms: Optional[int] = None,
|
247
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
248
|
+
) -> operations.CreatePaymentLinkResponse:
|
249
|
+
r"""Create a payment link that allows an end user to make a payment on Moov's hosted payment link page.
|
250
|
+
|
251
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
252
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
253
|
+
|
254
|
+
:param account_id:
|
255
|
+
:param partner_account_id: The partner's Moov account ID.
|
256
|
+
:param merchant_payment_method_id: The merchant's preferred payment method ID. Must be a wallet payment method.
|
257
|
+
:param amount:
|
258
|
+
:param display: Customizable display options for a payment link.
|
259
|
+
:param max_uses: An optional limit on the number of times this payment link can be used. **For payouts, `maxUses` is always 1.**
|
260
|
+
:param expires_on: An optional expiration date for this payment link.
|
261
|
+
:param customer:
|
262
|
+
:param payment: Options for payment links used to collect payment.
|
263
|
+
:param payout:
|
264
|
+
:param retries: Override the default retry configuration for this method
|
265
|
+
:param server_url: Override the default server URL for this method
|
266
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
267
|
+
:param http_headers: Additional headers to set or replace on requests.
|
268
|
+
"""
|
269
|
+
base_url = None
|
270
|
+
url_variables = None
|
271
|
+
if timeout_ms is None:
|
272
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
273
|
+
|
274
|
+
if server_url is not None:
|
275
|
+
base_url = server_url
|
276
|
+
else:
|
277
|
+
base_url = self._get_url(base_url, url_variables)
|
278
|
+
|
279
|
+
request = operations.CreatePaymentLinkRequest(
|
280
|
+
account_id=account_id,
|
281
|
+
create_payment_link=components.CreatePaymentLink(
|
282
|
+
partner_account_id=partner_account_id,
|
283
|
+
merchant_payment_method_id=merchant_payment_method_id,
|
284
|
+
amount=utils.get_pydantic_model(amount, components.Amount),
|
285
|
+
max_uses=max_uses,
|
286
|
+
expires_on=expires_on,
|
287
|
+
display=utils.get_pydantic_model(
|
288
|
+
display, components.PaymentLinkDisplayOptions
|
289
|
+
),
|
290
|
+
customer=utils.get_pydantic_model(
|
291
|
+
customer, Optional[components.PaymentLinkCustomerOptions]
|
292
|
+
),
|
293
|
+
payment=utils.get_pydantic_model(
|
294
|
+
payment, Optional[components.PaymentLinkPaymentDetails]
|
295
|
+
),
|
296
|
+
payout=utils.get_pydantic_model(
|
297
|
+
payout, Optional[components.PaymentLinkPayoutDetails]
|
298
|
+
),
|
299
|
+
),
|
300
|
+
)
|
301
|
+
|
302
|
+
req = self._build_request_async(
|
303
|
+
method="POST",
|
304
|
+
path="/accounts/{accountID}/payment-links",
|
305
|
+
base_url=base_url,
|
306
|
+
url_variables=url_variables,
|
307
|
+
request=request,
|
308
|
+
request_body_required=True,
|
309
|
+
request_has_path_params=True,
|
310
|
+
request_has_query_params=True,
|
311
|
+
user_agent_header="user-agent",
|
312
|
+
accept_header_value="application/json",
|
313
|
+
http_headers=http_headers,
|
314
|
+
_globals=operations.CreatePaymentLinkGlobals(
|
315
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
316
|
+
),
|
317
|
+
security=self.sdk_configuration.security,
|
318
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
319
|
+
request.create_payment_link,
|
320
|
+
False,
|
321
|
+
False,
|
322
|
+
"json",
|
323
|
+
components.CreatePaymentLink,
|
324
|
+
),
|
325
|
+
timeout_ms=timeout_ms,
|
326
|
+
)
|
327
|
+
|
328
|
+
if retries == UNSET:
|
329
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
330
|
+
retries = self.sdk_configuration.retry_config
|
331
|
+
|
332
|
+
retry_config = None
|
333
|
+
if isinstance(retries, utils.RetryConfig):
|
334
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
335
|
+
|
336
|
+
http_res = await self.do_request_async(
|
337
|
+
hook_ctx=HookContext(
|
338
|
+
base_url=base_url or "",
|
339
|
+
operation_id="createPaymentLink",
|
340
|
+
oauth2_scopes=[],
|
341
|
+
security_source=get_security_from_env(
|
342
|
+
self.sdk_configuration.security, components.Security
|
343
|
+
),
|
344
|
+
),
|
345
|
+
request=req,
|
346
|
+
error_status_codes=[
|
347
|
+
"400",
|
348
|
+
"401",
|
349
|
+
"403",
|
350
|
+
"404",
|
351
|
+
"409",
|
352
|
+
"422",
|
353
|
+
"429",
|
354
|
+
"4XX",
|
355
|
+
"500",
|
356
|
+
"504",
|
357
|
+
"5XX",
|
358
|
+
],
|
359
|
+
retry_config=retry_config,
|
360
|
+
)
|
361
|
+
|
362
|
+
response_data: Any = None
|
363
|
+
if utils.match_response(http_res, "200", "application/json"):
|
364
|
+
return operations.CreatePaymentLinkResponse(
|
365
|
+
result=utils.unmarshal_json(http_res.text, components.PaymentLink),
|
366
|
+
headers=utils.get_response_headers(http_res.headers),
|
367
|
+
)
|
368
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
369
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
370
|
+
raise errors.GenericError(data=response_data)
|
371
|
+
if utils.match_response(http_res, "422", "application/json"):
|
372
|
+
response_data = utils.unmarshal_json(
|
373
|
+
http_res.text, errors.CreatePaymentLinkErrorData
|
374
|
+
)
|
375
|
+
raise errors.CreatePaymentLinkError(data=response_data)
|
376
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
377
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
378
|
+
raise errors.APIError(
|
379
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
380
|
+
)
|
381
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
382
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
383
|
+
raise errors.APIError(
|
384
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
385
|
+
)
|
386
|
+
if utils.match_response(http_res, "4XX", "*"):
|
387
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
388
|
+
raise errors.APIError(
|
389
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
390
|
+
)
|
391
|
+
if utils.match_response(http_res, "5XX", "*"):
|
392
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
393
|
+
raise errors.APIError(
|
394
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
395
|
+
)
|
396
|
+
|
397
|
+
content_type = http_res.headers.get("Content-Type")
|
398
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
399
|
+
raise errors.APIError(
|
400
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
401
|
+
http_res.status_code,
|
402
|
+
http_res_text,
|
403
|
+
http_res,
|
404
|
+
)
|
405
|
+
|
406
|
+
def list(
|
407
|
+
self,
|
408
|
+
*,
|
409
|
+
account_id: str,
|
410
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
411
|
+
server_url: Optional[str] = None,
|
412
|
+
timeout_ms: Optional[int] = None,
|
413
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
414
|
+
) -> operations.ListPaymentLinksResponse:
|
415
|
+
r"""List all the payment links created under a Moov account.
|
416
|
+
|
417
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
418
|
+
you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
|
419
|
+
|
420
|
+
:param account_id:
|
421
|
+
:param retries: Override the default retry configuration for this method
|
422
|
+
:param server_url: Override the default server URL for this method
|
423
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
424
|
+
:param http_headers: Additional headers to set or replace on requests.
|
425
|
+
"""
|
426
|
+
base_url = None
|
427
|
+
url_variables = None
|
428
|
+
if timeout_ms is None:
|
429
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
430
|
+
|
431
|
+
if server_url is not None:
|
432
|
+
base_url = server_url
|
433
|
+
else:
|
434
|
+
base_url = self._get_url(base_url, url_variables)
|
435
|
+
|
436
|
+
request = operations.ListPaymentLinksRequest(
|
437
|
+
account_id=account_id,
|
438
|
+
)
|
439
|
+
|
440
|
+
req = self._build_request(
|
441
|
+
method="GET",
|
442
|
+
path="/accounts/{accountID}/payment-links",
|
443
|
+
base_url=base_url,
|
444
|
+
url_variables=url_variables,
|
445
|
+
request=request,
|
446
|
+
request_body_required=False,
|
447
|
+
request_has_path_params=True,
|
448
|
+
request_has_query_params=True,
|
449
|
+
user_agent_header="user-agent",
|
450
|
+
accept_header_value="application/json",
|
451
|
+
http_headers=http_headers,
|
452
|
+
_globals=operations.ListPaymentLinksGlobals(
|
453
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
454
|
+
),
|
455
|
+
security=self.sdk_configuration.security,
|
456
|
+
timeout_ms=timeout_ms,
|
457
|
+
)
|
458
|
+
|
459
|
+
if retries == UNSET:
|
460
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
461
|
+
retries = self.sdk_configuration.retry_config
|
462
|
+
|
463
|
+
retry_config = None
|
464
|
+
if isinstance(retries, utils.RetryConfig):
|
465
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
466
|
+
|
467
|
+
http_res = self.do_request(
|
468
|
+
hook_ctx=HookContext(
|
469
|
+
base_url=base_url or "",
|
470
|
+
operation_id="listPaymentLinks",
|
471
|
+
oauth2_scopes=[],
|
472
|
+
security_source=get_security_from_env(
|
473
|
+
self.sdk_configuration.security, components.Security
|
474
|
+
),
|
475
|
+
),
|
476
|
+
request=req,
|
477
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
478
|
+
retry_config=retry_config,
|
479
|
+
)
|
480
|
+
|
481
|
+
if utils.match_response(http_res, "200", "application/json"):
|
482
|
+
return operations.ListPaymentLinksResponse(
|
483
|
+
result=utils.unmarshal_json(
|
484
|
+
http_res.text, List[components.PaymentLink]
|
485
|
+
),
|
486
|
+
headers=utils.get_response_headers(http_res.headers),
|
487
|
+
)
|
488
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
489
|
+
http_res_text = utils.stream_to_text(http_res)
|
490
|
+
raise errors.APIError(
|
491
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
492
|
+
)
|
493
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
494
|
+
http_res_text = utils.stream_to_text(http_res)
|
495
|
+
raise errors.APIError(
|
496
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
497
|
+
)
|
498
|
+
if utils.match_response(http_res, "4XX", "*"):
|
499
|
+
http_res_text = utils.stream_to_text(http_res)
|
500
|
+
raise errors.APIError(
|
501
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
502
|
+
)
|
503
|
+
if utils.match_response(http_res, "5XX", "*"):
|
504
|
+
http_res_text = utils.stream_to_text(http_res)
|
505
|
+
raise errors.APIError(
|
506
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
507
|
+
)
|
508
|
+
|
509
|
+
content_type = http_res.headers.get("Content-Type")
|
510
|
+
http_res_text = utils.stream_to_text(http_res)
|
511
|
+
raise errors.APIError(
|
512
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
513
|
+
http_res.status_code,
|
514
|
+
http_res_text,
|
515
|
+
http_res,
|
516
|
+
)
|
517
|
+
|
518
|
+
async def list_async(
|
519
|
+
self,
|
520
|
+
*,
|
521
|
+
account_id: str,
|
522
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
523
|
+
server_url: Optional[str] = None,
|
524
|
+
timeout_ms: Optional[int] = None,
|
525
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
526
|
+
) -> operations.ListPaymentLinksResponse:
|
527
|
+
r"""List all the payment links created under a Moov account.
|
528
|
+
|
529
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
530
|
+
you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
|
531
|
+
|
532
|
+
:param account_id:
|
533
|
+
:param retries: Override the default retry configuration for this method
|
534
|
+
:param server_url: Override the default server URL for this method
|
535
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
536
|
+
:param http_headers: Additional headers to set or replace on requests.
|
537
|
+
"""
|
538
|
+
base_url = None
|
539
|
+
url_variables = None
|
540
|
+
if timeout_ms is None:
|
541
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
542
|
+
|
543
|
+
if server_url is not None:
|
544
|
+
base_url = server_url
|
545
|
+
else:
|
546
|
+
base_url = self._get_url(base_url, url_variables)
|
547
|
+
|
548
|
+
request = operations.ListPaymentLinksRequest(
|
549
|
+
account_id=account_id,
|
550
|
+
)
|
551
|
+
|
552
|
+
req = self._build_request_async(
|
553
|
+
method="GET",
|
554
|
+
path="/accounts/{accountID}/payment-links",
|
555
|
+
base_url=base_url,
|
556
|
+
url_variables=url_variables,
|
557
|
+
request=request,
|
558
|
+
request_body_required=False,
|
559
|
+
request_has_path_params=True,
|
560
|
+
request_has_query_params=True,
|
561
|
+
user_agent_header="user-agent",
|
562
|
+
accept_header_value="application/json",
|
563
|
+
http_headers=http_headers,
|
564
|
+
_globals=operations.ListPaymentLinksGlobals(
|
565
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
566
|
+
),
|
567
|
+
security=self.sdk_configuration.security,
|
568
|
+
timeout_ms=timeout_ms,
|
569
|
+
)
|
570
|
+
|
571
|
+
if retries == UNSET:
|
572
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
573
|
+
retries = self.sdk_configuration.retry_config
|
574
|
+
|
575
|
+
retry_config = None
|
576
|
+
if isinstance(retries, utils.RetryConfig):
|
577
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
578
|
+
|
579
|
+
http_res = await self.do_request_async(
|
580
|
+
hook_ctx=HookContext(
|
581
|
+
base_url=base_url or "",
|
582
|
+
operation_id="listPaymentLinks",
|
583
|
+
oauth2_scopes=[],
|
584
|
+
security_source=get_security_from_env(
|
585
|
+
self.sdk_configuration.security, components.Security
|
586
|
+
),
|
587
|
+
),
|
588
|
+
request=req,
|
589
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
590
|
+
retry_config=retry_config,
|
591
|
+
)
|
592
|
+
|
593
|
+
if utils.match_response(http_res, "200", "application/json"):
|
594
|
+
return operations.ListPaymentLinksResponse(
|
595
|
+
result=utils.unmarshal_json(
|
596
|
+
http_res.text, List[components.PaymentLink]
|
597
|
+
),
|
598
|
+
headers=utils.get_response_headers(http_res.headers),
|
599
|
+
)
|
600
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
601
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
602
|
+
raise errors.APIError(
|
603
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
604
|
+
)
|
605
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
606
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
607
|
+
raise errors.APIError(
|
608
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
609
|
+
)
|
610
|
+
if utils.match_response(http_res, "4XX", "*"):
|
611
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
612
|
+
raise errors.APIError(
|
613
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
614
|
+
)
|
615
|
+
if utils.match_response(http_res, "5XX", "*"):
|
616
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
617
|
+
raise errors.APIError(
|
618
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
619
|
+
)
|
620
|
+
|
621
|
+
content_type = http_res.headers.get("Content-Type")
|
622
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
623
|
+
raise errors.APIError(
|
624
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
625
|
+
http_res.status_code,
|
626
|
+
http_res_text,
|
627
|
+
http_res,
|
628
|
+
)
|
629
|
+
|
630
|
+
def get(
|
631
|
+
self,
|
632
|
+
*,
|
633
|
+
account_id: str,
|
634
|
+
payment_link_code: str,
|
635
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
636
|
+
server_url: Optional[str] = None,
|
637
|
+
timeout_ms: Optional[int] = None,
|
638
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
639
|
+
) -> operations.GetPaymentLinkResponse:
|
640
|
+
r"""Retrieve a payment link by code.
|
641
|
+
|
642
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
643
|
+
you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
|
644
|
+
|
645
|
+
:param account_id:
|
646
|
+
:param payment_link_code:
|
647
|
+
:param retries: Override the default retry configuration for this method
|
648
|
+
:param server_url: Override the default server URL for this method
|
649
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
650
|
+
:param http_headers: Additional headers to set or replace on requests.
|
651
|
+
"""
|
652
|
+
base_url = None
|
653
|
+
url_variables = None
|
654
|
+
if timeout_ms is None:
|
655
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
656
|
+
|
657
|
+
if server_url is not None:
|
658
|
+
base_url = server_url
|
659
|
+
else:
|
660
|
+
base_url = self._get_url(base_url, url_variables)
|
661
|
+
|
662
|
+
request = operations.GetPaymentLinkRequest(
|
663
|
+
account_id=account_id,
|
664
|
+
payment_link_code=payment_link_code,
|
665
|
+
)
|
666
|
+
|
667
|
+
req = self._build_request(
|
668
|
+
method="GET",
|
669
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}",
|
670
|
+
base_url=base_url,
|
671
|
+
url_variables=url_variables,
|
672
|
+
request=request,
|
673
|
+
request_body_required=False,
|
674
|
+
request_has_path_params=True,
|
675
|
+
request_has_query_params=True,
|
676
|
+
user_agent_header="user-agent",
|
677
|
+
accept_header_value="application/json",
|
678
|
+
http_headers=http_headers,
|
679
|
+
_globals=operations.GetPaymentLinkGlobals(
|
680
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
681
|
+
),
|
682
|
+
security=self.sdk_configuration.security,
|
683
|
+
timeout_ms=timeout_ms,
|
684
|
+
)
|
685
|
+
|
686
|
+
if retries == UNSET:
|
687
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
688
|
+
retries = self.sdk_configuration.retry_config
|
689
|
+
|
690
|
+
retry_config = None
|
691
|
+
if isinstance(retries, utils.RetryConfig):
|
692
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
693
|
+
|
694
|
+
http_res = self.do_request(
|
695
|
+
hook_ctx=HookContext(
|
696
|
+
base_url=base_url or "",
|
697
|
+
operation_id="getPaymentLink",
|
698
|
+
oauth2_scopes=[],
|
699
|
+
security_source=get_security_from_env(
|
700
|
+
self.sdk_configuration.security, components.Security
|
701
|
+
),
|
702
|
+
),
|
703
|
+
request=req,
|
704
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
705
|
+
retry_config=retry_config,
|
706
|
+
)
|
707
|
+
|
708
|
+
if utils.match_response(http_res, "200", "application/json"):
|
709
|
+
return operations.GetPaymentLinkResponse(
|
710
|
+
result=utils.unmarshal_json(http_res.text, components.PaymentLink),
|
711
|
+
headers=utils.get_response_headers(http_res.headers),
|
712
|
+
)
|
713
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
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
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
719
|
+
http_res_text = utils.stream_to_text(http_res)
|
720
|
+
raise errors.APIError(
|
721
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
722
|
+
)
|
723
|
+
if utils.match_response(http_res, "4XX", "*"):
|
724
|
+
http_res_text = utils.stream_to_text(http_res)
|
725
|
+
raise errors.APIError(
|
726
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
727
|
+
)
|
728
|
+
if utils.match_response(http_res, "5XX", "*"):
|
729
|
+
http_res_text = utils.stream_to_text(http_res)
|
730
|
+
raise errors.APIError(
|
731
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
732
|
+
)
|
733
|
+
|
734
|
+
content_type = http_res.headers.get("Content-Type")
|
735
|
+
http_res_text = utils.stream_to_text(http_res)
|
736
|
+
raise errors.APIError(
|
737
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
738
|
+
http_res.status_code,
|
739
|
+
http_res_text,
|
740
|
+
http_res,
|
741
|
+
)
|
742
|
+
|
743
|
+
async def get_async(
|
744
|
+
self,
|
745
|
+
*,
|
746
|
+
account_id: str,
|
747
|
+
payment_link_code: str,
|
748
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
749
|
+
server_url: Optional[str] = None,
|
750
|
+
timeout_ms: Optional[int] = None,
|
751
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
752
|
+
) -> operations.GetPaymentLinkResponse:
|
753
|
+
r"""Retrieve a payment link by code.
|
754
|
+
|
755
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
756
|
+
you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
|
757
|
+
|
758
|
+
:param account_id:
|
759
|
+
:param payment_link_code:
|
760
|
+
:param retries: Override the default retry configuration for this method
|
761
|
+
:param server_url: Override the default server URL for this method
|
762
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
763
|
+
:param http_headers: Additional headers to set or replace on requests.
|
764
|
+
"""
|
765
|
+
base_url = None
|
766
|
+
url_variables = None
|
767
|
+
if timeout_ms is None:
|
768
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
769
|
+
|
770
|
+
if server_url is not None:
|
771
|
+
base_url = server_url
|
772
|
+
else:
|
773
|
+
base_url = self._get_url(base_url, url_variables)
|
774
|
+
|
775
|
+
request = operations.GetPaymentLinkRequest(
|
776
|
+
account_id=account_id,
|
777
|
+
payment_link_code=payment_link_code,
|
778
|
+
)
|
779
|
+
|
780
|
+
req = self._build_request_async(
|
781
|
+
method="GET",
|
782
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}",
|
783
|
+
base_url=base_url,
|
784
|
+
url_variables=url_variables,
|
785
|
+
request=request,
|
786
|
+
request_body_required=False,
|
787
|
+
request_has_path_params=True,
|
788
|
+
request_has_query_params=True,
|
789
|
+
user_agent_header="user-agent",
|
790
|
+
accept_header_value="application/json",
|
791
|
+
http_headers=http_headers,
|
792
|
+
_globals=operations.GetPaymentLinkGlobals(
|
793
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
794
|
+
),
|
795
|
+
security=self.sdk_configuration.security,
|
796
|
+
timeout_ms=timeout_ms,
|
797
|
+
)
|
798
|
+
|
799
|
+
if retries == UNSET:
|
800
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
801
|
+
retries = self.sdk_configuration.retry_config
|
802
|
+
|
803
|
+
retry_config = None
|
804
|
+
if isinstance(retries, utils.RetryConfig):
|
805
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
806
|
+
|
807
|
+
http_res = await self.do_request_async(
|
808
|
+
hook_ctx=HookContext(
|
809
|
+
base_url=base_url or "",
|
810
|
+
operation_id="getPaymentLink",
|
811
|
+
oauth2_scopes=[],
|
812
|
+
security_source=get_security_from_env(
|
813
|
+
self.sdk_configuration.security, components.Security
|
814
|
+
),
|
815
|
+
),
|
816
|
+
request=req,
|
817
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
818
|
+
retry_config=retry_config,
|
819
|
+
)
|
820
|
+
|
821
|
+
if utils.match_response(http_res, "200", "application/json"):
|
822
|
+
return operations.GetPaymentLinkResponse(
|
823
|
+
result=utils.unmarshal_json(http_res.text, components.PaymentLink),
|
824
|
+
headers=utils.get_response_headers(http_res.headers),
|
825
|
+
)
|
826
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
827
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
828
|
+
raise errors.APIError(
|
829
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
830
|
+
)
|
831
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
832
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
833
|
+
raise errors.APIError(
|
834
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
835
|
+
)
|
836
|
+
if utils.match_response(http_res, "4XX", "*"):
|
837
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
838
|
+
raise errors.APIError(
|
839
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
840
|
+
)
|
841
|
+
if utils.match_response(http_res, "5XX", "*"):
|
842
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
843
|
+
raise errors.APIError(
|
844
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
845
|
+
)
|
846
|
+
|
847
|
+
content_type = http_res.headers.get("Content-Type")
|
848
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
849
|
+
raise errors.APIError(
|
850
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
851
|
+
http_res.status_code,
|
852
|
+
http_res_text,
|
853
|
+
http_res,
|
854
|
+
)
|
855
|
+
|
856
|
+
def update(
|
857
|
+
self,
|
858
|
+
*,
|
859
|
+
account_id: str,
|
860
|
+
payment_link_code: str,
|
861
|
+
amount: Optional[
|
862
|
+
Union[components.AmountUpdate, components.AmountUpdateTypedDict]
|
863
|
+
] = None,
|
864
|
+
expires_on: OptionalNullable[datetime] = UNSET,
|
865
|
+
display: Optional[
|
866
|
+
Union[
|
867
|
+
components.PaymentLinkDisplayOptionsUpdate,
|
868
|
+
components.PaymentLinkDisplayOptionsUpdateTypedDict,
|
869
|
+
]
|
870
|
+
] = None,
|
871
|
+
customer: Optional[
|
872
|
+
Union[
|
873
|
+
components.PaymentLinkCustomerOptions,
|
874
|
+
components.PaymentLinkCustomerOptionsTypedDict,
|
875
|
+
]
|
876
|
+
] = None,
|
877
|
+
payment: Optional[
|
878
|
+
Union[
|
879
|
+
components.PaymentLinkPaymentDetailsUpdate,
|
880
|
+
components.PaymentLinkPaymentDetailsUpdateTypedDict,
|
881
|
+
]
|
882
|
+
] = None,
|
883
|
+
payout: Optional[
|
884
|
+
Union[
|
885
|
+
components.PaymentLinkPayoutDetailsUpdate,
|
886
|
+
components.PaymentLinkPayoutDetailsUpdateTypedDict,
|
887
|
+
]
|
888
|
+
] = None,
|
889
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
890
|
+
server_url: Optional[str] = None,
|
891
|
+
timeout_ms: Optional[int] = None,
|
892
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
893
|
+
) -> operations.UpdatePaymentLinkResponse:
|
894
|
+
r"""Update a payment link.
|
895
|
+
|
896
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
897
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
898
|
+
|
899
|
+
:param account_id:
|
900
|
+
:param payment_link_code:
|
901
|
+
:param amount:
|
902
|
+
:param expires_on:
|
903
|
+
:param display: Customizable display options for a payment link.
|
904
|
+
:param customer:
|
905
|
+
:param payment: Options for payment links used to collect payment.
|
906
|
+
:param payout:
|
907
|
+
:param retries: Override the default retry configuration for this method
|
908
|
+
:param server_url: Override the default server URL for this method
|
909
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
910
|
+
:param http_headers: Additional headers to set or replace on requests.
|
911
|
+
"""
|
912
|
+
base_url = None
|
913
|
+
url_variables = None
|
914
|
+
if timeout_ms is None:
|
915
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
916
|
+
|
917
|
+
if server_url is not None:
|
918
|
+
base_url = server_url
|
919
|
+
else:
|
920
|
+
base_url = self._get_url(base_url, url_variables)
|
921
|
+
|
922
|
+
request = operations.UpdatePaymentLinkRequest(
|
923
|
+
account_id=account_id,
|
924
|
+
payment_link_code=payment_link_code,
|
925
|
+
update_payment_link=components.UpdatePaymentLink(
|
926
|
+
amount=utils.get_pydantic_model(
|
927
|
+
amount, Optional[components.AmountUpdate]
|
928
|
+
),
|
929
|
+
expires_on=expires_on,
|
930
|
+
display=utils.get_pydantic_model(
|
931
|
+
display, Optional[components.PaymentLinkDisplayOptionsUpdate]
|
932
|
+
),
|
933
|
+
customer=utils.get_pydantic_model(
|
934
|
+
customer, Optional[components.PaymentLinkCustomerOptions]
|
935
|
+
),
|
936
|
+
payment=utils.get_pydantic_model(
|
937
|
+
payment, Optional[components.PaymentLinkPaymentDetailsUpdate]
|
938
|
+
),
|
939
|
+
payout=utils.get_pydantic_model(
|
940
|
+
payout, Optional[components.PaymentLinkPayoutDetailsUpdate]
|
941
|
+
),
|
942
|
+
),
|
943
|
+
)
|
944
|
+
|
945
|
+
req = self._build_request(
|
946
|
+
method="PATCH",
|
947
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}",
|
948
|
+
base_url=base_url,
|
949
|
+
url_variables=url_variables,
|
950
|
+
request=request,
|
951
|
+
request_body_required=True,
|
952
|
+
request_has_path_params=True,
|
953
|
+
request_has_query_params=True,
|
954
|
+
user_agent_header="user-agent",
|
955
|
+
accept_header_value="application/json",
|
956
|
+
http_headers=http_headers,
|
957
|
+
_globals=operations.UpdatePaymentLinkGlobals(
|
958
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
959
|
+
),
|
960
|
+
security=self.sdk_configuration.security,
|
961
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
962
|
+
request.update_payment_link,
|
963
|
+
False,
|
964
|
+
False,
|
965
|
+
"json",
|
966
|
+
components.UpdatePaymentLink,
|
967
|
+
),
|
968
|
+
timeout_ms=timeout_ms,
|
969
|
+
)
|
970
|
+
|
971
|
+
if retries == UNSET:
|
972
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
973
|
+
retries = self.sdk_configuration.retry_config
|
974
|
+
|
975
|
+
retry_config = None
|
976
|
+
if isinstance(retries, utils.RetryConfig):
|
977
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
978
|
+
|
979
|
+
http_res = self.do_request(
|
980
|
+
hook_ctx=HookContext(
|
981
|
+
base_url=base_url or "",
|
982
|
+
operation_id="updatePaymentLink",
|
983
|
+
oauth2_scopes=[],
|
984
|
+
security_source=get_security_from_env(
|
985
|
+
self.sdk_configuration.security, components.Security
|
986
|
+
),
|
987
|
+
),
|
988
|
+
request=req,
|
989
|
+
error_status_codes=[
|
990
|
+
"400",
|
991
|
+
"401",
|
992
|
+
"403",
|
993
|
+
"404",
|
994
|
+
"409",
|
995
|
+
"422",
|
996
|
+
"429",
|
997
|
+
"4XX",
|
998
|
+
"500",
|
999
|
+
"504",
|
1000
|
+
"5XX",
|
1001
|
+
],
|
1002
|
+
retry_config=retry_config,
|
1003
|
+
)
|
1004
|
+
|
1005
|
+
response_data: Any = None
|
1006
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1007
|
+
return operations.UpdatePaymentLinkResponse(
|
1008
|
+
result=utils.unmarshal_json(http_res.text, components.PaymentLink),
|
1009
|
+
headers=utils.get_response_headers(http_res.headers),
|
1010
|
+
)
|
1011
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1012
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1013
|
+
raise errors.GenericError(data=response_data)
|
1014
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1015
|
+
response_data = utils.unmarshal_json(
|
1016
|
+
http_res.text, errors.UpdatePaymentLinkErrorData
|
1017
|
+
)
|
1018
|
+
raise errors.UpdatePaymentLinkError(data=response_data)
|
1019
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1020
|
+
http_res_text = utils.stream_to_text(http_res)
|
1021
|
+
raise errors.APIError(
|
1022
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1023
|
+
)
|
1024
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1025
|
+
http_res_text = utils.stream_to_text(http_res)
|
1026
|
+
raise errors.APIError(
|
1027
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1028
|
+
)
|
1029
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1030
|
+
http_res_text = utils.stream_to_text(http_res)
|
1031
|
+
raise errors.APIError(
|
1032
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1033
|
+
)
|
1034
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1035
|
+
http_res_text = utils.stream_to_text(http_res)
|
1036
|
+
raise errors.APIError(
|
1037
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1038
|
+
)
|
1039
|
+
|
1040
|
+
content_type = http_res.headers.get("Content-Type")
|
1041
|
+
http_res_text = utils.stream_to_text(http_res)
|
1042
|
+
raise errors.APIError(
|
1043
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1044
|
+
http_res.status_code,
|
1045
|
+
http_res_text,
|
1046
|
+
http_res,
|
1047
|
+
)
|
1048
|
+
|
1049
|
+
async def update_async(
|
1050
|
+
self,
|
1051
|
+
*,
|
1052
|
+
account_id: str,
|
1053
|
+
payment_link_code: str,
|
1054
|
+
amount: Optional[
|
1055
|
+
Union[components.AmountUpdate, components.AmountUpdateTypedDict]
|
1056
|
+
] = None,
|
1057
|
+
expires_on: OptionalNullable[datetime] = UNSET,
|
1058
|
+
display: Optional[
|
1059
|
+
Union[
|
1060
|
+
components.PaymentLinkDisplayOptionsUpdate,
|
1061
|
+
components.PaymentLinkDisplayOptionsUpdateTypedDict,
|
1062
|
+
]
|
1063
|
+
] = None,
|
1064
|
+
customer: Optional[
|
1065
|
+
Union[
|
1066
|
+
components.PaymentLinkCustomerOptions,
|
1067
|
+
components.PaymentLinkCustomerOptionsTypedDict,
|
1068
|
+
]
|
1069
|
+
] = None,
|
1070
|
+
payment: Optional[
|
1071
|
+
Union[
|
1072
|
+
components.PaymentLinkPaymentDetailsUpdate,
|
1073
|
+
components.PaymentLinkPaymentDetailsUpdateTypedDict,
|
1074
|
+
]
|
1075
|
+
] = None,
|
1076
|
+
payout: Optional[
|
1077
|
+
Union[
|
1078
|
+
components.PaymentLinkPayoutDetailsUpdate,
|
1079
|
+
components.PaymentLinkPayoutDetailsUpdateTypedDict,
|
1080
|
+
]
|
1081
|
+
] = None,
|
1082
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1083
|
+
server_url: Optional[str] = None,
|
1084
|
+
timeout_ms: Optional[int] = None,
|
1085
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1086
|
+
) -> operations.UpdatePaymentLinkResponse:
|
1087
|
+
r"""Update a payment link.
|
1088
|
+
|
1089
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1090
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
1091
|
+
|
1092
|
+
:param account_id:
|
1093
|
+
:param payment_link_code:
|
1094
|
+
:param amount:
|
1095
|
+
:param expires_on:
|
1096
|
+
:param display: Customizable display options for a payment link.
|
1097
|
+
:param customer:
|
1098
|
+
:param payment: Options for payment links used to collect payment.
|
1099
|
+
:param payout:
|
1100
|
+
:param retries: Override the default retry configuration for this method
|
1101
|
+
:param server_url: Override the default server URL for this method
|
1102
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1103
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1104
|
+
"""
|
1105
|
+
base_url = None
|
1106
|
+
url_variables = None
|
1107
|
+
if timeout_ms is None:
|
1108
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1109
|
+
|
1110
|
+
if server_url is not None:
|
1111
|
+
base_url = server_url
|
1112
|
+
else:
|
1113
|
+
base_url = self._get_url(base_url, url_variables)
|
1114
|
+
|
1115
|
+
request = operations.UpdatePaymentLinkRequest(
|
1116
|
+
account_id=account_id,
|
1117
|
+
payment_link_code=payment_link_code,
|
1118
|
+
update_payment_link=components.UpdatePaymentLink(
|
1119
|
+
amount=utils.get_pydantic_model(
|
1120
|
+
amount, Optional[components.AmountUpdate]
|
1121
|
+
),
|
1122
|
+
expires_on=expires_on,
|
1123
|
+
display=utils.get_pydantic_model(
|
1124
|
+
display, Optional[components.PaymentLinkDisplayOptionsUpdate]
|
1125
|
+
),
|
1126
|
+
customer=utils.get_pydantic_model(
|
1127
|
+
customer, Optional[components.PaymentLinkCustomerOptions]
|
1128
|
+
),
|
1129
|
+
payment=utils.get_pydantic_model(
|
1130
|
+
payment, Optional[components.PaymentLinkPaymentDetailsUpdate]
|
1131
|
+
),
|
1132
|
+
payout=utils.get_pydantic_model(
|
1133
|
+
payout, Optional[components.PaymentLinkPayoutDetailsUpdate]
|
1134
|
+
),
|
1135
|
+
),
|
1136
|
+
)
|
1137
|
+
|
1138
|
+
req = self._build_request_async(
|
1139
|
+
method="PATCH",
|
1140
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}",
|
1141
|
+
base_url=base_url,
|
1142
|
+
url_variables=url_variables,
|
1143
|
+
request=request,
|
1144
|
+
request_body_required=True,
|
1145
|
+
request_has_path_params=True,
|
1146
|
+
request_has_query_params=True,
|
1147
|
+
user_agent_header="user-agent",
|
1148
|
+
accept_header_value="application/json",
|
1149
|
+
http_headers=http_headers,
|
1150
|
+
_globals=operations.UpdatePaymentLinkGlobals(
|
1151
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1152
|
+
),
|
1153
|
+
security=self.sdk_configuration.security,
|
1154
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1155
|
+
request.update_payment_link,
|
1156
|
+
False,
|
1157
|
+
False,
|
1158
|
+
"json",
|
1159
|
+
components.UpdatePaymentLink,
|
1160
|
+
),
|
1161
|
+
timeout_ms=timeout_ms,
|
1162
|
+
)
|
1163
|
+
|
1164
|
+
if retries == UNSET:
|
1165
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1166
|
+
retries = self.sdk_configuration.retry_config
|
1167
|
+
|
1168
|
+
retry_config = None
|
1169
|
+
if isinstance(retries, utils.RetryConfig):
|
1170
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1171
|
+
|
1172
|
+
http_res = await self.do_request_async(
|
1173
|
+
hook_ctx=HookContext(
|
1174
|
+
base_url=base_url or "",
|
1175
|
+
operation_id="updatePaymentLink",
|
1176
|
+
oauth2_scopes=[],
|
1177
|
+
security_source=get_security_from_env(
|
1178
|
+
self.sdk_configuration.security, components.Security
|
1179
|
+
),
|
1180
|
+
),
|
1181
|
+
request=req,
|
1182
|
+
error_status_codes=[
|
1183
|
+
"400",
|
1184
|
+
"401",
|
1185
|
+
"403",
|
1186
|
+
"404",
|
1187
|
+
"409",
|
1188
|
+
"422",
|
1189
|
+
"429",
|
1190
|
+
"4XX",
|
1191
|
+
"500",
|
1192
|
+
"504",
|
1193
|
+
"5XX",
|
1194
|
+
],
|
1195
|
+
retry_config=retry_config,
|
1196
|
+
)
|
1197
|
+
|
1198
|
+
response_data: Any = None
|
1199
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1200
|
+
return operations.UpdatePaymentLinkResponse(
|
1201
|
+
result=utils.unmarshal_json(http_res.text, components.PaymentLink),
|
1202
|
+
headers=utils.get_response_headers(http_res.headers),
|
1203
|
+
)
|
1204
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1205
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1206
|
+
raise errors.GenericError(data=response_data)
|
1207
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1208
|
+
response_data = utils.unmarshal_json(
|
1209
|
+
http_res.text, errors.UpdatePaymentLinkErrorData
|
1210
|
+
)
|
1211
|
+
raise errors.UpdatePaymentLinkError(data=response_data)
|
1212
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1213
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1214
|
+
raise errors.APIError(
|
1215
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1216
|
+
)
|
1217
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1218
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1219
|
+
raise errors.APIError(
|
1220
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1221
|
+
)
|
1222
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1223
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1224
|
+
raise errors.APIError(
|
1225
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1226
|
+
)
|
1227
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1228
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1229
|
+
raise errors.APIError(
|
1230
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1231
|
+
)
|
1232
|
+
|
1233
|
+
content_type = http_res.headers.get("Content-Type")
|
1234
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1235
|
+
raise errors.APIError(
|
1236
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1237
|
+
http_res.status_code,
|
1238
|
+
http_res_text,
|
1239
|
+
http_res,
|
1240
|
+
)
|
1241
|
+
|
1242
|
+
def disable(
|
1243
|
+
self,
|
1244
|
+
*,
|
1245
|
+
account_id: str,
|
1246
|
+
payment_link_code: str,
|
1247
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1248
|
+
server_url: Optional[str] = None,
|
1249
|
+
timeout_ms: Optional[int] = None,
|
1250
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1251
|
+
) -> operations.DisablePaymentLinkResponse:
|
1252
|
+
r"""Disable a payment link.
|
1253
|
+
|
1254
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1255
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
1256
|
+
|
1257
|
+
:param account_id:
|
1258
|
+
:param payment_link_code:
|
1259
|
+
:param retries: Override the default retry configuration for this method
|
1260
|
+
:param server_url: Override the default server URL for this method
|
1261
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1262
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1263
|
+
"""
|
1264
|
+
base_url = None
|
1265
|
+
url_variables = None
|
1266
|
+
if timeout_ms is None:
|
1267
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1268
|
+
|
1269
|
+
if server_url is not None:
|
1270
|
+
base_url = server_url
|
1271
|
+
else:
|
1272
|
+
base_url = self._get_url(base_url, url_variables)
|
1273
|
+
|
1274
|
+
request = operations.DisablePaymentLinkRequest(
|
1275
|
+
account_id=account_id,
|
1276
|
+
payment_link_code=payment_link_code,
|
1277
|
+
)
|
1278
|
+
|
1279
|
+
req = self._build_request(
|
1280
|
+
method="DELETE",
|
1281
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}",
|
1282
|
+
base_url=base_url,
|
1283
|
+
url_variables=url_variables,
|
1284
|
+
request=request,
|
1285
|
+
request_body_required=False,
|
1286
|
+
request_has_path_params=True,
|
1287
|
+
request_has_query_params=True,
|
1288
|
+
user_agent_header="user-agent",
|
1289
|
+
accept_header_value="*/*",
|
1290
|
+
http_headers=http_headers,
|
1291
|
+
_globals=operations.DisablePaymentLinkGlobals(
|
1292
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1293
|
+
),
|
1294
|
+
security=self.sdk_configuration.security,
|
1295
|
+
timeout_ms=timeout_ms,
|
1296
|
+
)
|
1297
|
+
|
1298
|
+
if retries == UNSET:
|
1299
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1300
|
+
retries = self.sdk_configuration.retry_config
|
1301
|
+
|
1302
|
+
retry_config = None
|
1303
|
+
if isinstance(retries, utils.RetryConfig):
|
1304
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1305
|
+
|
1306
|
+
http_res = self.do_request(
|
1307
|
+
hook_ctx=HookContext(
|
1308
|
+
base_url=base_url or "",
|
1309
|
+
operation_id="disablePaymentLink",
|
1310
|
+
oauth2_scopes=[],
|
1311
|
+
security_source=get_security_from_env(
|
1312
|
+
self.sdk_configuration.security, components.Security
|
1313
|
+
),
|
1314
|
+
),
|
1315
|
+
request=req,
|
1316
|
+
error_status_codes=["4XX", "5XX"],
|
1317
|
+
retry_config=retry_config,
|
1318
|
+
)
|
1319
|
+
|
1320
|
+
if utils.match_response(http_res, "204", "*"):
|
1321
|
+
return operations.DisablePaymentLinkResponse(
|
1322
|
+
headers=utils.get_response_headers(http_res.headers)
|
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
|
+
payment_link_code: 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.DisablePaymentLinkResponse:
|
1354
|
+
r"""Disable a payment link.
|
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}/transfers.write` scope.
|
1358
|
+
|
1359
|
+
:param account_id:
|
1360
|
+
:param payment_link_code:
|
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.DisablePaymentLinkRequest(
|
1377
|
+
account_id=account_id,
|
1378
|
+
payment_link_code=payment_link_code,
|
1379
|
+
)
|
1380
|
+
|
1381
|
+
req = self._build_request_async(
|
1382
|
+
method="DELETE",
|
1383
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}",
|
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="*/*",
|
1392
|
+
http_headers=http_headers,
|
1393
|
+
_globals=operations.DisablePaymentLinkGlobals(
|
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="disablePaymentLink",
|
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=["4XX", "5XX"],
|
1419
|
+
retry_config=retry_config,
|
1420
|
+
)
|
1421
|
+
|
1422
|
+
if utils.match_response(http_res, "204", "*"):
|
1423
|
+
return operations.DisablePaymentLinkResponse(
|
1424
|
+
headers=utils.get_response_headers(http_res.headers)
|
1425
|
+
)
|
1426
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1427
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1428
|
+
raise errors.APIError(
|
1429
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1430
|
+
)
|
1431
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1432
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1433
|
+
raise errors.APIError(
|
1434
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1435
|
+
)
|
1436
|
+
|
1437
|
+
content_type = http_res.headers.get("Content-Type")
|
1438
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1439
|
+
raise errors.APIError(
|
1440
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1441
|
+
http_res.status_code,
|
1442
|
+
http_res_text,
|
1443
|
+
http_res,
|
1444
|
+
)
|
1445
|
+
|
1446
|
+
def get_qr_code(
|
1447
|
+
self,
|
1448
|
+
*,
|
1449
|
+
account_id: str,
|
1450
|
+
payment_link_code: str,
|
1451
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1452
|
+
server_url: Optional[str] = None,
|
1453
|
+
timeout_ms: Optional[int] = None,
|
1454
|
+
accept_header_override: Optional[GetQRCodeAcceptEnum] = None,
|
1455
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1456
|
+
) -> operations.GetPaymentLinkQRCodeResponse:
|
1457
|
+
r"""Retrieve the payment link encoded in a QR code.
|
1458
|
+
|
1459
|
+
Use the `Accept` header to specify the format of the response. Supported formats are `application/json` and `image/png`.
|
1460
|
+
|
1461
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1462
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
1463
|
+
|
1464
|
+
:param account_id:
|
1465
|
+
:param payment_link_code:
|
1466
|
+
:param retries: Override the default retry configuration for this method
|
1467
|
+
:param server_url: Override the default server URL for this method
|
1468
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1469
|
+
:param accept_header_override: Override the default accept header for this method
|
1470
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1471
|
+
"""
|
1472
|
+
base_url = None
|
1473
|
+
url_variables = None
|
1474
|
+
if timeout_ms is None:
|
1475
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1476
|
+
|
1477
|
+
if server_url is not None:
|
1478
|
+
base_url = server_url
|
1479
|
+
else:
|
1480
|
+
base_url = self._get_url(base_url, url_variables)
|
1481
|
+
|
1482
|
+
request = operations.GetPaymentLinkQRCodeRequest(
|
1483
|
+
account_id=account_id,
|
1484
|
+
payment_link_code=payment_link_code,
|
1485
|
+
)
|
1486
|
+
|
1487
|
+
req = self._build_request(
|
1488
|
+
method="GET",
|
1489
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}/qrcode",
|
1490
|
+
base_url=base_url,
|
1491
|
+
url_variables=url_variables,
|
1492
|
+
request=request,
|
1493
|
+
request_body_required=False,
|
1494
|
+
request_has_path_params=True,
|
1495
|
+
request_has_query_params=True,
|
1496
|
+
user_agent_header="user-agent",
|
1497
|
+
accept_header_value=accept_header_override.value
|
1498
|
+
if accept_header_override is not None
|
1499
|
+
else "application/json;q=1, image/png;q=0",
|
1500
|
+
http_headers=http_headers,
|
1501
|
+
_globals=operations.GetPaymentLinkQRCodeGlobals(
|
1502
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1503
|
+
),
|
1504
|
+
security=self.sdk_configuration.security,
|
1505
|
+
timeout_ms=timeout_ms,
|
1506
|
+
)
|
1507
|
+
|
1508
|
+
if retries == UNSET:
|
1509
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1510
|
+
retries = self.sdk_configuration.retry_config
|
1511
|
+
|
1512
|
+
retry_config = None
|
1513
|
+
if isinstance(retries, utils.RetryConfig):
|
1514
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1515
|
+
|
1516
|
+
http_res = self.do_request(
|
1517
|
+
hook_ctx=HookContext(
|
1518
|
+
base_url=base_url or "",
|
1519
|
+
operation_id="getPaymentLinkQRCode",
|
1520
|
+
oauth2_scopes=[],
|
1521
|
+
security_source=get_security_from_env(
|
1522
|
+
self.sdk_configuration.security, components.Security
|
1523
|
+
),
|
1524
|
+
),
|
1525
|
+
request=req,
|
1526
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
1527
|
+
stream=True,
|
1528
|
+
retry_config=retry_config,
|
1529
|
+
)
|
1530
|
+
|
1531
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1532
|
+
http_response_text = utils.stream_to_text(http_res)
|
1533
|
+
return operations.GetPaymentLinkQRCodeResponse(
|
1534
|
+
result=utils.unmarshal_json(http_response_text, components.QRCode),
|
1535
|
+
headers=utils.get_response_headers(http_res.headers),
|
1536
|
+
)
|
1537
|
+
if utils.match_response(http_res, "200", "image/png"):
|
1538
|
+
return operations.GetPaymentLinkQRCodeResponse(
|
1539
|
+
result=http_res, headers=utils.get_response_headers(http_res.headers)
|
1540
|
+
)
|
1541
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1542
|
+
http_res_text = utils.stream_to_text(http_res)
|
1543
|
+
raise errors.APIError(
|
1544
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1545
|
+
)
|
1546
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1547
|
+
http_res_text = utils.stream_to_text(http_res)
|
1548
|
+
raise errors.APIError(
|
1549
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1550
|
+
)
|
1551
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1552
|
+
http_res_text = utils.stream_to_text(http_res)
|
1553
|
+
raise errors.APIError(
|
1554
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1555
|
+
)
|
1556
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1557
|
+
http_res_text = utils.stream_to_text(http_res)
|
1558
|
+
raise errors.APIError(
|
1559
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1560
|
+
)
|
1561
|
+
|
1562
|
+
content_type = http_res.headers.get("Content-Type")
|
1563
|
+
http_res_text = utils.stream_to_text(http_res)
|
1564
|
+
raise errors.APIError(
|
1565
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1566
|
+
http_res.status_code,
|
1567
|
+
http_res_text,
|
1568
|
+
http_res,
|
1569
|
+
)
|
1570
|
+
|
1571
|
+
async def get_qr_code_async(
|
1572
|
+
self,
|
1573
|
+
*,
|
1574
|
+
account_id: str,
|
1575
|
+
payment_link_code: str,
|
1576
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1577
|
+
server_url: Optional[str] = None,
|
1578
|
+
timeout_ms: Optional[int] = None,
|
1579
|
+
accept_header_override: Optional[GetQRCodeAcceptEnum] = None,
|
1580
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1581
|
+
) -> operations.GetPaymentLinkQRCodeResponse:
|
1582
|
+
r"""Retrieve the payment link encoded in a QR code.
|
1583
|
+
|
1584
|
+
Use the `Accept` header to specify the format of the response. Supported formats are `application/json` and `image/png`.
|
1585
|
+
|
1586
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1587
|
+
you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
1588
|
+
|
1589
|
+
:param account_id:
|
1590
|
+
:param payment_link_code:
|
1591
|
+
:param retries: Override the default retry configuration for this method
|
1592
|
+
:param server_url: Override the default server URL for this method
|
1593
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1594
|
+
:param accept_header_override: Override the default accept header for this method
|
1595
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1596
|
+
"""
|
1597
|
+
base_url = None
|
1598
|
+
url_variables = None
|
1599
|
+
if timeout_ms is None:
|
1600
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1601
|
+
|
1602
|
+
if server_url is not None:
|
1603
|
+
base_url = server_url
|
1604
|
+
else:
|
1605
|
+
base_url = self._get_url(base_url, url_variables)
|
1606
|
+
|
1607
|
+
request = operations.GetPaymentLinkQRCodeRequest(
|
1608
|
+
account_id=account_id,
|
1609
|
+
payment_link_code=payment_link_code,
|
1610
|
+
)
|
1611
|
+
|
1612
|
+
req = self._build_request_async(
|
1613
|
+
method="GET",
|
1614
|
+
path="/accounts/{accountID}/payment-links/{paymentLinkCode}/qrcode",
|
1615
|
+
base_url=base_url,
|
1616
|
+
url_variables=url_variables,
|
1617
|
+
request=request,
|
1618
|
+
request_body_required=False,
|
1619
|
+
request_has_path_params=True,
|
1620
|
+
request_has_query_params=True,
|
1621
|
+
user_agent_header="user-agent",
|
1622
|
+
accept_header_value=accept_header_override.value
|
1623
|
+
if accept_header_override is not None
|
1624
|
+
else "application/json;q=1, image/png;q=0",
|
1625
|
+
http_headers=http_headers,
|
1626
|
+
_globals=operations.GetPaymentLinkQRCodeGlobals(
|
1627
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1628
|
+
),
|
1629
|
+
security=self.sdk_configuration.security,
|
1630
|
+
timeout_ms=timeout_ms,
|
1631
|
+
)
|
1632
|
+
|
1633
|
+
if retries == UNSET:
|
1634
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1635
|
+
retries = self.sdk_configuration.retry_config
|
1636
|
+
|
1637
|
+
retry_config = None
|
1638
|
+
if isinstance(retries, utils.RetryConfig):
|
1639
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1640
|
+
|
1641
|
+
http_res = await self.do_request_async(
|
1642
|
+
hook_ctx=HookContext(
|
1643
|
+
base_url=base_url or "",
|
1644
|
+
operation_id="getPaymentLinkQRCode",
|
1645
|
+
oauth2_scopes=[],
|
1646
|
+
security_source=get_security_from_env(
|
1647
|
+
self.sdk_configuration.security, components.Security
|
1648
|
+
),
|
1649
|
+
),
|
1650
|
+
request=req,
|
1651
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
1652
|
+
stream=True,
|
1653
|
+
retry_config=retry_config,
|
1654
|
+
)
|
1655
|
+
|
1656
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1657
|
+
http_response_text = await utils.stream_to_text_async(http_res)
|
1658
|
+
return operations.GetPaymentLinkQRCodeResponse(
|
1659
|
+
result=utils.unmarshal_json(http_response_text, components.QRCode),
|
1660
|
+
headers=utils.get_response_headers(http_res.headers),
|
1661
|
+
)
|
1662
|
+
if utils.match_response(http_res, "200", "image/png"):
|
1663
|
+
return operations.GetPaymentLinkQRCodeResponse(
|
1664
|
+
result=http_res, headers=utils.get_response_headers(http_res.headers)
|
1665
|
+
)
|
1666
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1667
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1668
|
+
raise errors.APIError(
|
1669
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1670
|
+
)
|
1671
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1672
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1673
|
+
raise errors.APIError(
|
1674
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1675
|
+
)
|
1676
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1677
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1678
|
+
raise errors.APIError(
|
1679
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1680
|
+
)
|
1681
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1682
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1683
|
+
raise errors.APIError(
|
1684
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1685
|
+
)
|
1686
|
+
|
1687
|
+
content_type = http_res.headers.get("Content-Type")
|
1688
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1689
|
+
raise errors.APIError(
|
1690
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1691
|
+
http_res.status_code,
|
1692
|
+
http_res_text,
|
1693
|
+
http_res,
|
1694
|
+
)
|