moovio_sdk 0.3.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- moovio_sdk/__init__.py +17 -0
- moovio_sdk/_hooks/__init__.py +5 -0
- moovio_sdk/_hooks/registration.py +13 -0
- moovio_sdk/_hooks/sdkhooks.py +76 -0
- moovio_sdk/_hooks/types.py +106 -0
- moovio_sdk/_version.py +15 -0
- moovio_sdk/accounts.py +2461 -0
- moovio_sdk/adjustments.py +463 -0
- moovio_sdk/apple_pay.py +1417 -0
- moovio_sdk/authentication.py +531 -0
- moovio_sdk/avatars.py +231 -0
- moovio_sdk/bank_accounts.py +2445 -0
- moovio_sdk/basesdk.py +363 -0
- moovio_sdk/branding.py +1089 -0
- moovio_sdk/capabilities.py +1001 -0
- moovio_sdk/card_issuing.py +1351 -0
- moovio_sdk/cards.py +1469 -0
- moovio_sdk/disputes.py +2985 -0
- moovio_sdk/end_to_end_encryption.py +453 -0
- moovio_sdk/enriched_address.py +307 -0
- moovio_sdk/enriched_profile.py +235 -0
- moovio_sdk/fee_plans.py +1759 -0
- moovio_sdk/files.py +775 -0
- moovio_sdk/httpclient.py +136 -0
- moovio_sdk/industries.py +239 -0
- moovio_sdk/institutions.py +261 -0
- moovio_sdk/issuing_transactions.py +1228 -0
- moovio_sdk/models/__init__.py +4 -0
- moovio_sdk/models/components/__init__.py +1411 -0
- moovio_sdk/models/components/account.py +96 -0
- moovio_sdk/models/components/accountcapability.py +20 -0
- moovio_sdk/models/components/accountcountries.py +18 -0
- moovio_sdk/models/components/accountnameverification.py +28 -0
- moovio_sdk/models/components/accounttype.py +11 -0
- moovio_sdk/models/components/accountverificationstatus.py +19 -0
- moovio_sdk/models/components/achcreditsamedaypaymentmethod.py +38 -0
- moovio_sdk/models/components/achcreditstandardpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitcollectpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitfundpaymentmethod.py +38 -0
- moovio_sdk/models/components/achexception.py +20 -0
- moovio_sdk/models/components/achlocation.py +26 -0
- moovio_sdk/models/components/achparticipant.py +93 -0
- moovio_sdk/models/components/achpaymentdetails.py +30 -0
- moovio_sdk/models/components/achpaymentdetailserror.py +22 -0
- moovio_sdk/models/components/achpaymentsettings.py +16 -0
- moovio_sdk/models/components/achreturncode.py +51 -0
- moovio_sdk/models/components/achtransactiondetails.py +94 -0
- moovio_sdk/models/components/achtransactionstatus.py +15 -0
- moovio_sdk/models/components/addcapabilities.py +15 -0
- moovio_sdk/models/components/address.py +30 -0
- moovio_sdk/models/components/addresserror.py +32 -0
- moovio_sdk/models/components/addresssuggestion.py +34 -0
- moovio_sdk/models/components/addressupdate.py +32 -0
- moovio_sdk/models/components/adjustment.py +29 -0
- moovio_sdk/models/components/amount.py +26 -0
- moovio_sdk/models/components/amountdecimal.py +27 -0
- moovio_sdk/models/components/amountupdate.py +27 -0
- moovio_sdk/models/components/amountvalidationerror.py +17 -0
- moovio_sdk/models/components/applebillingcontact.py +53 -0
- moovio_sdk/models/components/applepayheader.py +41 -0
- moovio_sdk/models/components/applepaymerchantdomains.py +32 -0
- moovio_sdk/models/components/applepaypaymentmethod.py +33 -0
- moovio_sdk/models/components/applepayresponse.py +70 -0
- moovio_sdk/models/components/applicationscope.py +41 -0
- moovio_sdk/models/components/asynccreatedrefund.py +26 -0
- moovio_sdk/models/components/asynctransfer.py +18 -0
- moovio_sdk/models/components/authorizeduser.py +21 -0
- moovio_sdk/models/components/authtoken.py +36 -0
- moovio_sdk/models/components/authtokenrequest.py +46 -0
- moovio_sdk/models/components/bankaccount.py +98 -0
- moovio_sdk/models/components/bankaccountexception.py +96 -0
- moovio_sdk/models/components/bankaccountholdertype.py +11 -0
- moovio_sdk/models/components/bankaccountintegration.py +34 -0
- moovio_sdk/models/components/bankaccountpayload.py +21 -0
- moovio_sdk/models/components/bankaccountstatus.py +12 -0
- moovio_sdk/models/components/bankaccountstatusreason.py +23 -0
- moovio_sdk/models/components/bankaccounttype.py +13 -0
- moovio_sdk/models/components/bankaccountverification.py +30 -0
- moovio_sdk/models/components/bankaccountverificationcreated.py +21 -0
- moovio_sdk/models/components/bankaccountverificationmethod.py +9 -0
- moovio_sdk/models/components/bankaccountverificationstatus.py +13 -0
- moovio_sdk/models/components/bankaccountwaitfor.py +9 -0
- moovio_sdk/models/components/basicpaymentmethod.py +24 -0
- moovio_sdk/models/components/billablefee.py +54 -0
- moovio_sdk/models/components/birthdate.py +19 -0
- moovio_sdk/models/components/birthdateerror.py +20 -0
- moovio_sdk/models/components/birthdateupdate.py +20 -0
- moovio_sdk/models/components/birthdatevalidationerror.py +20 -0
- moovio_sdk/models/components/brandcolor.py +15 -0
- moovio_sdk/models/components/brandcolors.py +21 -0
- moovio_sdk/models/components/brandcolorvalidationerror.py +14 -0
- moovio_sdk/models/components/brandproperties.py +16 -0
- moovio_sdk/models/components/businessprofile.py +81 -0
- moovio_sdk/models/components/businesstype.py +19 -0
- moovio_sdk/models/components/calltoaction.py +19 -0
- moovio_sdk/models/components/cancellation.py +22 -0
- moovio_sdk/models/components/cancellationstatus.py +10 -0
- moovio_sdk/models/components/capabilitieserror.py +14 -0
- moovio_sdk/models/components/capability.py +56 -0
- moovio_sdk/models/components/capabilityid.py +18 -0
- moovio_sdk/models/components/capabilityrequirement.py +26 -0
- moovio_sdk/models/components/capabilitystatus.py +13 -0
- moovio_sdk/models/components/card.py +164 -0
- moovio_sdk/models/components/cardaccountupdater.py +28 -0
- moovio_sdk/models/components/cardacquiringdispute.py +26 -0
- moovio_sdk/models/components/cardacquiringmodel.py +11 -0
- moovio_sdk/models/components/cardacquiringrefund.py +42 -0
- moovio_sdk/models/components/cardaddress.py +32 -0
- moovio_sdk/models/components/cardbrand.py +14 -0
- moovio_sdk/models/components/cardexpiration.py +20 -0
- moovio_sdk/models/components/cardexpirationerror.py +17 -0
- moovio_sdk/models/components/cardissuingnetwork.py +12 -0
- moovio_sdk/models/components/cardpaymentdetails.py +23 -0
- moovio_sdk/models/components/cardpaymentdetailserror.py +17 -0
- moovio_sdk/models/components/cardpaymentpaymentmethod.py +33 -0
- moovio_sdk/models/components/cardpaymentsettings.py +23 -0
- moovio_sdk/models/components/cardtransactiondetails.py +94 -0
- moovio_sdk/models/components/cardtransactionfailurecode.py +32 -0
- moovio_sdk/models/components/cardtransactionstatus.py +15 -0
- moovio_sdk/models/components/cardtype.py +13 -0
- moovio_sdk/models/components/cardupdatereason.py +16 -0
- moovio_sdk/models/components/cardverification.py +38 -0
- moovio_sdk/models/components/cardverificationresult.py +12 -0
- moovio_sdk/models/components/cardvolumedistribution.py +29 -0
- moovio_sdk/models/components/cardvolumedistributionerror.py +32 -0
- moovio_sdk/models/components/collectionpaymentmethodtype.py +12 -0
- moovio_sdk/models/components/colorsvalidationerror.py +21 -0
- moovio_sdk/models/components/completebankaccountverification.py +15 -0
- moovio_sdk/models/components/completedmicrodeposits.py +14 -0
- moovio_sdk/models/components/completemicrodeposits.py +20 -0
- moovio_sdk/models/components/countrieserrors.py +14 -0
- moovio_sdk/models/components/createaccount.py +78 -0
- moovio_sdk/models/components/createaccounterror.py +44 -0
- moovio_sdk/models/components/createaccountsettings.py +40 -0
- moovio_sdk/models/components/createapplepaysession.py +21 -0
- moovio_sdk/models/components/createauthorizeduser.py +26 -0
- moovio_sdk/models/components/createauthorizedusererror.py +24 -0
- moovio_sdk/models/components/createauthorizeduserupdate.py +28 -0
- moovio_sdk/models/components/createbusinesserror.py +88 -0
- moovio_sdk/models/components/createbusinessprofile.py +69 -0
- moovio_sdk/models/components/createevidencefilemultipart.py +63 -0
- moovio_sdk/models/components/createevidencetext.py +20 -0
- moovio_sdk/models/components/createfeeplanagreement.py +14 -0
- moovio_sdk/models/components/createindividualerror.py +72 -0
- moovio_sdk/models/components/createindividualprofile.py +37 -0
- moovio_sdk/models/components/createpaymentlink.py +95 -0
- moovio_sdk/models/components/createprofile.py +22 -0
- moovio_sdk/models/components/createprofileerror.py +19 -0
- moovio_sdk/models/components/createrefund.py +26 -0
- moovio_sdk/models/components/createrefundresponse.py +18 -0
- moovio_sdk/models/components/createrepresentative.py +50 -0
- moovio_sdk/models/components/createreversal.py +15 -0
- moovio_sdk/models/components/createsweepconfig.py +41 -0
- moovio_sdk/models/components/createterminalapplication.py +42 -0
- moovio_sdk/models/components/createtransfer.py +49 -0
- moovio_sdk/models/components/createtransferdestination.py +37 -0
- moovio_sdk/models/components/createtransferdestinationach.py +26 -0
- moovio_sdk/models/components/createtransferdestinationcard.py +19 -0
- moovio_sdk/models/components/createtransferoptions.py +24 -0
- moovio_sdk/models/components/createtransfersource.py +48 -0
- moovio_sdk/models/components/createtransfersourceach.py +40 -0
- moovio_sdk/models/components/createtransfersourcecard.py +35 -0
- moovio_sdk/models/components/customersupport.py +33 -0
- moovio_sdk/models/components/customersupporterror.py +25 -0
- moovio_sdk/models/components/debitholdperiod.py +12 -0
- moovio_sdk/models/components/disbursementpaymentmethodtype.py +13 -0
- moovio_sdk/models/components/displayoptionserror.py +23 -0
- moovio_sdk/models/components/dispute.py +76 -0
- moovio_sdk/models/components/disputeevidenceresponse.py +49 -0
- moovio_sdk/models/components/disputephase.py +13 -0
- moovio_sdk/models/components/disputestatus.py +20 -0
- moovio_sdk/models/components/disputetransferdetails.py +16 -0
- moovio_sdk/models/components/document.py +37 -0
- moovio_sdk/models/components/documenttype.py +13 -0
- moovio_sdk/models/components/domesticpullfromcard.py +12 -0
- moovio_sdk/models/components/domesticpushtocard.py +13 -0
- moovio_sdk/models/components/e2eetoken.py +25 -0
- moovio_sdk/models/components/e2eetokenupdate.py +26 -0
- moovio_sdk/models/components/end2endencryptionerror.py +14 -0
- moovio_sdk/models/components/enrichedaddressresponse.py +15 -0
- moovio_sdk/models/components/enrichedbusinessprofile.py +37 -0
- moovio_sdk/models/components/enrichedbusinessresponse.py +18 -0
- moovio_sdk/models/components/enrichedindustries.py +15 -0
- moovio_sdk/models/components/enrichedindustry.py +32 -0
- moovio_sdk/models/components/enrichedindustrycodes.py +17 -0
- moovio_sdk/models/components/evidencetextresponse.py +28 -0
- moovio_sdk/models/components/evidencetype.py +15 -0
- moovio_sdk/models/components/evidenceuploadresponse.py +50 -0
- moovio_sdk/models/components/facilitatorfee.py +48 -0
- moovio_sdk/models/components/feecategory.py +16 -0
- moovio_sdk/models/components/feemodel.py +12 -0
- moovio_sdk/models/components/feeplan.py +43 -0
- moovio_sdk/models/components/feeplanagreement.py +51 -0
- moovio_sdk/models/components/feeplanagreementstatus.py +9 -0
- moovio_sdk/models/components/feeproperties.py +49 -0
- moovio_sdk/models/components/filedetails.py +55 -0
- moovio_sdk/models/components/filepurpose.py +15 -0
- moovio_sdk/models/components/filestatus.py +12 -0
- moovio_sdk/models/components/fileuploadrequestmultipart.py +69 -0
- moovio_sdk/models/components/financialinstitutions.py +18 -0
- moovio_sdk/models/components/fulfillmentdetails.py +24 -0
- moovio_sdk/models/components/fulfillmentdetailserror.py +20 -0
- moovio_sdk/models/components/fullissuedcard.py +92 -0
- moovio_sdk/models/components/generatedby.py +39 -0
- moovio_sdk/models/components/generatedbyaccountid.py +15 -0
- moovio_sdk/models/components/generatedbybankaccountid.py +17 -0
- moovio_sdk/models/components/generatedbycardid.py +15 -0
- moovio_sdk/models/components/generatedbydisputeid.py +15 -0
- moovio_sdk/models/components/generatedbytransferid.py +15 -0
- moovio_sdk/models/components/governmentid.py +40 -0
- moovio_sdk/models/components/governmentiderror.py +40 -0
- moovio_sdk/models/components/granttype.py +15 -0
- moovio_sdk/models/components/incurredfee.py +44 -0
- moovio_sdk/models/components/individualname.py +32 -0
- moovio_sdk/models/components/individualnameerror.py +24 -0
- moovio_sdk/models/components/individualnameupdate.py +32 -0
- moovio_sdk/models/components/individualprofile.py +45 -0
- moovio_sdk/models/components/industrycodes.py +20 -0
- moovio_sdk/models/components/issuedcard.py +78 -0
- moovio_sdk/models/components/issuedcardauthorization.py +53 -0
- moovio_sdk/models/components/issuedcardauthorizationevent.py +37 -0
- moovio_sdk/models/components/issuedcardauthorizationeventresult.py +12 -0
- moovio_sdk/models/components/issuedcardeventtype.py +15 -0
- moovio_sdk/models/components/issuedcardformfactor.py +10 -0
- moovio_sdk/models/components/issuedcardstate.py +19 -0
- moovio_sdk/models/components/issuedcardtransaction.py +42 -0
- moovio_sdk/models/components/issuingauthorizationstatus.py +14 -0
- moovio_sdk/models/components/issuingcontrols.py +25 -0
- moovio_sdk/models/components/issuingcontrolserror.py +22 -0
- moovio_sdk/models/components/issuingintervallimit.py +10 -0
- moovio_sdk/models/components/issuingmerchantdata.py +47 -0
- moovio_sdk/models/components/issuingvelocitylimit.py +21 -0
- moovio_sdk/models/components/issuingvelocitylimiterror.py +17 -0
- moovio_sdk/models/components/jsonwebkey.py +103 -0
- moovio_sdk/models/components/linkapplepay.py +54 -0
- moovio_sdk/models/components/linkapplepaymentdata.py +51 -0
- moovio_sdk/models/components/linkapplepaymentmethod.py +38 -0
- moovio_sdk/models/components/linkapplepaytoken.py +63 -0
- moovio_sdk/models/components/linkbankaccount.py +26 -0
- moovio_sdk/models/components/linkcard.py +54 -0
- moovio_sdk/models/components/linkcardwaitfor.py +8 -0
- moovio_sdk/models/components/linkedapplepaypaymentmethod.py +30 -0
- moovio_sdk/models/components/listfeesfetchrequest.py +19 -0
- moovio_sdk/models/components/manualtermsofservice.py +34 -0
- moovio_sdk/models/components/manualtermsofserviceupdate.py +41 -0
- moovio_sdk/models/components/microdepositstatus.py +8 -0
- moovio_sdk/models/components/mode.py +11 -0
- moovio_sdk/models/components/moovfeedetails.py +36 -0
- moovio_sdk/models/components/moovwalletpaymentmethod.py +31 -0
- moovio_sdk/models/components/mxauthorizationcode.py +26 -0
- moovio_sdk/models/components/mxpayload.py +46 -0
- moovio_sdk/models/components/occurrence.py +44 -0
- moovio_sdk/models/components/occurrencesresponse.py +80 -0
- moovio_sdk/models/components/occurrencestatus.py +12 -0
- moovio_sdk/models/components/onboardinginvite.py +91 -0
- moovio_sdk/models/components/onboardinginviterequest.py +57 -0
- moovio_sdk/models/components/onboardingpartneraccount.py +31 -0
- moovio_sdk/models/components/partnerpricing.py +46 -0
- moovio_sdk/models/components/partnerpricingagreement.py +56 -0
- moovio_sdk/models/components/patchaccount.py +138 -0
- moovio_sdk/models/components/patchaccounterror.py +38 -0
- moovio_sdk/models/components/patchbusiness.py +72 -0
- moovio_sdk/models/components/patchindividual.py +43 -0
- moovio_sdk/models/components/patchprofile.py +29 -0
- moovio_sdk/models/components/patchsweepconfig.py +147 -0
- moovio_sdk/models/components/patchtransfer.py +51 -0
- moovio_sdk/models/components/paymentdetailserror.py +35 -0
- moovio_sdk/models/components/paymentlink.py +125 -0
- moovio_sdk/models/components/paymentlinkcustomeroptions.py +31 -0
- moovio_sdk/models/components/paymentlinkdisplayoptions.py +39 -0
- moovio_sdk/models/components/paymentlinkdisplayoptionsupdate.py +42 -0
- moovio_sdk/models/components/paymentlinkpaymentdetails.py +40 -0
- moovio_sdk/models/components/paymentlinkpaymentdetailsupdate.py +41 -0
- moovio_sdk/models/components/paymentlinkpayoutdetails.py +32 -0
- moovio_sdk/models/components/paymentlinkpayoutdetailsupdate.py +33 -0
- moovio_sdk/models/components/paymentlinkstatus.py +11 -0
- moovio_sdk/models/components/paymentmethod.py +82 -0
- moovio_sdk/models/components/paymentmethodsbankaccount.py +65 -0
- moovio_sdk/models/components/paymentmethodscard.py +121 -0
- moovio_sdk/models/components/paymentmethodswallet.py +14 -0
- moovio_sdk/models/components/paymentmethodtype.py +19 -0
- moovio_sdk/models/components/payoutdetailserror.py +21 -0
- moovio_sdk/models/components/payoutrecipient.py +23 -0
- moovio_sdk/models/components/payoutrecipienterror.py +14 -0
- moovio_sdk/models/components/payoutrecipientupdate.py +24 -0
- moovio_sdk/models/components/phonenumber.py +18 -0
- moovio_sdk/models/components/phonenumbererror.py +18 -0
- moovio_sdk/models/components/plaidintegration.py +39 -0
- moovio_sdk/models/components/plaidlinkintegration.py +36 -0
- moovio_sdk/models/components/plaidlinkpayload.py +45 -0
- moovio_sdk/models/components/plaidpayload.py +42 -0
- moovio_sdk/models/components/primaryregulator.py +13 -0
- moovio_sdk/models/components/profile.py +27 -0
- moovio_sdk/models/components/pullfromcardpaymentmethod.py +33 -0
- moovio_sdk/models/components/pushtocardpaymentmethod.py +33 -0
- moovio_sdk/models/components/qrcode.py +16 -0
- moovio_sdk/models/components/receiptkind.py +10 -0
- moovio_sdk/models/components/receiptrequest.py +75 -0
- moovio_sdk/models/components/receiptresponse.py +95 -0
- moovio_sdk/models/components/recur.py +40 -0
- moovio_sdk/models/components/refundcarddetails.py +44 -0
- moovio_sdk/models/components/refundcardstatus.py +12 -0
- moovio_sdk/models/components/refundstatus.py +11 -0
- moovio_sdk/models/components/registerapplepaymerchantdomains.py +22 -0
- moovio_sdk/models/components/representative.py +71 -0
- moovio_sdk/models/components/representativeresponsibilities.py +42 -0
- moovio_sdk/models/components/representativeresponsibilitieserror.py +26 -0
- moovio_sdk/models/components/requestcard.py +44 -0
- moovio_sdk/models/components/requirementerror.py +24 -0
- moovio_sdk/models/components/requirementerrorcode.py +25 -0
- moovio_sdk/models/components/requirementid.py +71 -0
- moovio_sdk/models/components/returnpolicytype.py +11 -0
- moovio_sdk/models/components/reversal.py +23 -0
- moovio_sdk/models/components/reversedwithcancellation.py +14 -0
- moovio_sdk/models/components/reversedwithrefund.py +16 -0
- moovio_sdk/models/components/revoketokenrequest.py +40 -0
- moovio_sdk/models/components/rtpcreditpaymentmethod.py +38 -0
- moovio_sdk/models/components/rtpfailurecode.py +19 -0
- moovio_sdk/models/components/rtprejectioncode.py +25 -0
- moovio_sdk/models/components/rtptransactiondetails.py +56 -0
- moovio_sdk/models/components/rtptransactionstatus.py +13 -0
- moovio_sdk/models/components/runtransfer.py +34 -0
- moovio_sdk/models/components/schedulepaymentmethod.py +56 -0
- moovio_sdk/models/components/scheduleresponse.py +60 -0
- moovio_sdk/models/components/seccode.py +13 -0
- moovio_sdk/models/components/security.py +32 -0
- moovio_sdk/models/components/sentreceipt.py +27 -0
- moovio_sdk/models/components/settings.py +30 -0
- moovio_sdk/models/components/sourcedestinationoptions.py +20 -0
- moovio_sdk/models/components/sweep.py +80 -0
- moovio_sdk/models/components/sweepconfig.py +81 -0
- moovio_sdk/models/components/sweepconfigpaymentmethod.py +31 -0
- moovio_sdk/models/components/sweepconfigstatus.py +9 -0
- moovio_sdk/models/components/sweepstatus.py +13 -0
- moovio_sdk/models/components/taxid.py +25 -0
- moovio_sdk/models/components/taxidupdate.py +26 -0
- moovio_sdk/models/components/terminalapplication.py +55 -0
- moovio_sdk/models/components/terminalapplicationplatform.py +12 -0
- moovio_sdk/models/components/terminalapplicationstatus.py +13 -0
- moovio_sdk/models/components/termsofservice.py +26 -0
- moovio_sdk/models/components/termsofserviceerror.py +39 -0
- moovio_sdk/models/components/termsofservicetoken.py +17 -0
- moovio_sdk/models/components/termsofservicetokenupdate.py +18 -0
- moovio_sdk/models/components/tokentype.py +10 -0
- moovio_sdk/models/components/transactionsource.py +16 -0
- moovio_sdk/models/components/transfer.py +126 -0
- moovio_sdk/models/components/transferaccount.py +20 -0
- moovio_sdk/models/components/transferdestination.py +83 -0
- moovio_sdk/models/components/transferfailurereason.py +14 -0
- moovio_sdk/models/components/transferoptions.py +23 -0
- moovio_sdk/models/components/transferresponse.py +15 -0
- moovio_sdk/models/components/transfersource.py +80 -0
- moovio_sdk/models/components/transferstatus.py +16 -0
- moovio_sdk/models/components/transferwaitfor.py +8 -0
- moovio_sdk/models/components/underwriting.py +56 -0
- moovio_sdk/models/components/underwritingstatus.py +16 -0
- moovio_sdk/models/components/updateapplepaymerchantdomains.py +26 -0
- moovio_sdk/models/components/updatebrand.py +15 -0
- moovio_sdk/models/components/updatecard.py +51 -0
- moovio_sdk/models/components/updatecardaddress.py +32 -0
- moovio_sdk/models/components/updatecardexpiration.py +17 -0
- moovio_sdk/models/components/updatecolor.py +14 -0
- moovio_sdk/models/components/updatecolors.py +18 -0
- moovio_sdk/models/components/updateevidence.py +23 -0
- moovio_sdk/models/components/updateissuedcard.py +44 -0
- moovio_sdk/models/components/updatepaymentlink.py +98 -0
- moovio_sdk/models/components/updaterepresentative.py +224 -0
- moovio_sdk/models/components/updateunderwriting.py +43 -0
- moovio_sdk/models/components/upsertschedule.py +26 -0
- moovio_sdk/models/components/verification.py +54 -0
- moovio_sdk/models/components/verificationstatus.py +17 -0
- moovio_sdk/models/components/verificationstatusdetail.py +23 -0
- moovio_sdk/models/components/volumebycustomertype.py +21 -0
- moovio_sdk/models/components/volumebycustomertypeerror.py +22 -0
- moovio_sdk/models/components/wallet.py +27 -0
- moovio_sdk/models/components/walletavailablebalance.py +30 -0
- moovio_sdk/models/components/wallettransaction.py +114 -0
- moovio_sdk/models/components/wallettransactionsourcetype.py +13 -0
- moovio_sdk/models/components/wallettransactionstatus.py +11 -0
- moovio_sdk/models/components/wallettransactiontype.py +32 -0
- moovio_sdk/models/errors/__init__.py +155 -0
- moovio_sdk/models/errors/addcapabilitieserror.py +23 -0
- moovio_sdk/models/errors/apierror.py +22 -0
- moovio_sdk/models/errors/assigncountrieserror.py +20 -0
- moovio_sdk/models/errors/authtokenrequesterror.py +22 -0
- moovio_sdk/models/errors/bankaccountvalidationerror.py +30 -0
- moovio_sdk/models/errors/brandvalidationerror.py +23 -0
- moovio_sdk/models/errors/cardacquiringrefund.py +44 -0
- moovio_sdk/models/errors/createaccount.py +24 -0
- moovio_sdk/models/errors/createpaymentlinkerror.py +46 -0
- moovio_sdk/models/errors/createsweepconfigerror.py +40 -0
- moovio_sdk/models/errors/feeplanagreementerror.py +22 -0
- moovio_sdk/models/errors/fileuploadvalidationerror.py +35 -0
- moovio_sdk/models/errors/filevalidationerror.py +28 -0
- moovio_sdk/models/errors/genericerror.py +19 -0
- moovio_sdk/models/errors/linkapplepayerror.py +36 -0
- moovio_sdk/models/errors/linkcarderror.py +47 -0
- moovio_sdk/models/errors/microdepositvalidationerror.py +20 -0
- moovio_sdk/models/errors/onboardinginviteerror.py +34 -0
- moovio_sdk/models/errors/patchsweepconfigerror.py +38 -0
- moovio_sdk/models/errors/receiptvalidationerror.py +40 -0
- moovio_sdk/models/errors/refundvalidationerror.py +23 -0
- moovio_sdk/models/errors/representativevalidationerror.py +68 -0
- moovio_sdk/models/errors/requestcarderror.py +42 -0
- moovio_sdk/models/errors/reversalvalidationerror.py +20 -0
- moovio_sdk/models/errors/revoketokenrequesterror.py +22 -0
- moovio_sdk/models/errors/schedulevalidationerror.py +24 -0
- moovio_sdk/models/errors/terminalapplicationerror.py +30 -0
- moovio_sdk/models/errors/transfer.py +108 -0
- moovio_sdk/models/errors/transferoptionsvalidationerror.py +24 -0
- moovio_sdk/models/errors/transfervalidationerror.py +49 -0
- moovio_sdk/models/errors/updateaccount.py +24 -0
- moovio_sdk/models/errors/updatecarderror.py +43 -0
- moovio_sdk/models/errors/updateissuedcarderror.py +32 -0
- moovio_sdk/models/errors/updatepaymentlinkerror.py +36 -0
- moovio_sdk/models/errors/updateunderwritingerror.py +70 -0
- moovio_sdk/models/internal/__init__.py +6 -0
- moovio_sdk/models/internal/globals.py +40 -0
- moovio_sdk/models/operations/__init__.py +1824 -0
- moovio_sdk/models/operations/acceptdispute.py +71 -0
- moovio_sdk/models/operations/assignaccountcountries.py +75 -0
- moovio_sdk/models/operations/cancelschedule.py +67 -0
- moovio_sdk/models/operations/completebankaccountverification.py +85 -0
- moovio_sdk/models/operations/completemicrodeposits.py +87 -0
- moovio_sdk/models/operations/createaccesstoken.py +52 -0
- moovio_sdk/models/operations/createaccount.py +52 -0
- moovio_sdk/models/operations/createapplepaysession.py +81 -0
- moovio_sdk/models/operations/createbrand.py +75 -0
- moovio_sdk/models/operations/createcancellation.py +75 -0
- moovio_sdk/models/operations/createfeeplanagreements.py +80 -0
- moovio_sdk/models/operations/createonboardinginvite.py +52 -0
- moovio_sdk/models/operations/createpaymentlink.py +78 -0
- moovio_sdk/models/operations/createreceipts.py +52 -0
- moovio_sdk/models/operations/createrepresentative.py +80 -0
- moovio_sdk/models/operations/createreversal.py +98 -0
- moovio_sdk/models/operations/createschedule.py +78 -0
- moovio_sdk/models/operations/createsweepconfig.py +78 -0
- moovio_sdk/models/operations/createterminalapplication.py +54 -0
- moovio_sdk/models/operations/createtransfer.py +125 -0
- moovio_sdk/models/operations/createtransferoptions.py +52 -0
- moovio_sdk/models/operations/deletedisputeevidencefile.py +74 -0
- moovio_sdk/models/operations/deleterepresentative.py +71 -0
- moovio_sdk/models/operations/deleteterminalapplication.py +60 -0
- moovio_sdk/models/operations/disablebankaccount.py +67 -0
- moovio_sdk/models/operations/disablecapability.py +76 -0
- moovio_sdk/models/operations/disablecard.py +67 -0
- moovio_sdk/models/operations/disablepaymentlink.py +67 -0
- moovio_sdk/models/operations/disconnectaccount.py +60 -0
- moovio_sdk/models/operations/generateendtoendkey.py +60 -0
- moovio_sdk/models/operations/getaccount.py +64 -0
- moovio_sdk/models/operations/getaccountcountries.py +64 -0
- moovio_sdk/models/operations/getadjustment.py +71 -0
- moovio_sdk/models/operations/getapplepaymerchantdomains.py +68 -0
- moovio_sdk/models/operations/getavatar.py +66 -0
- moovio_sdk/models/operations/getbankaccount.py +71 -0
- moovio_sdk/models/operations/getbankaccountverification.py +73 -0
- moovio_sdk/models/operations/getbrand.py +64 -0
- moovio_sdk/models/operations/getcancellation.py +84 -0
- moovio_sdk/models/operations/getcapability.py +82 -0
- moovio_sdk/models/operations/getcard.py +71 -0
- moovio_sdk/models/operations/getdispute.py +71 -0
- moovio_sdk/models/operations/getdisputeevidence.py +80 -0
- moovio_sdk/models/operations/getdisputeevidencedata.py +90 -0
- moovio_sdk/models/operations/getenrichmentaddress.py +178 -0
- moovio_sdk/models/operations/getenrichmentprofile.py +64 -0
- moovio_sdk/models/operations/getfiledetails.py +71 -0
- moovio_sdk/models/operations/getfullissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcardauthorization.py +75 -0
- moovio_sdk/models/operations/getissuedcardtransaction.py +75 -0
- moovio_sdk/models/operations/getmerchantprocessingagreement.py +64 -0
- moovio_sdk/models/operations/getonboardinginvite.py +62 -0
- moovio_sdk/models/operations/getpaymentlink.py +71 -0
- moovio_sdk/models/operations/getpaymentlinkqrcode.py +84 -0
- moovio_sdk/models/operations/getpaymentmethod.py +71 -0
- moovio_sdk/models/operations/getrefund.py +84 -0
- moovio_sdk/models/operations/getrepresentative.py +75 -0
- moovio_sdk/models/operations/getscheduledoccurrence.py +92 -0
- moovio_sdk/models/operations/getschedules.py +71 -0
- moovio_sdk/models/operations/getsweep.py +78 -0
- moovio_sdk/models/operations/getsweepconfig.py +71 -0
- moovio_sdk/models/operations/getterminalapplication.py +66 -0
- moovio_sdk/models/operations/gettermsofservicetoken.py +75 -0
- moovio_sdk/models/operations/gettransfer.py +73 -0
- moovio_sdk/models/operations/getunderwriting.py +64 -0
- moovio_sdk/models/operations/getwallet.py +71 -0
- moovio_sdk/models/operations/getwallettransaction.py +80 -0
- moovio_sdk/models/operations/initiatebankaccountverification.py +89 -0
- moovio_sdk/models/operations/initiatemicrodeposits.py +67 -0
- moovio_sdk/models/operations/initiaterefund.py +131 -0
- moovio_sdk/models/operations/linkapplepaytoken.py +80 -0
- moovio_sdk/models/operations/linkbankaccount.py +96 -0
- moovio_sdk/models/operations/linkcard.py +96 -0
- moovio_sdk/models/operations/listaccounts.py +171 -0
- moovio_sdk/models/operations/listadjustments.py +78 -0
- moovio_sdk/models/operations/listbankaccounts.py +64 -0
- moovio_sdk/models/operations/listcapabilities.py +64 -0
- moovio_sdk/models/operations/listcards.py +64 -0
- moovio_sdk/models/operations/listdisputeevidence.py +73 -0
- moovio_sdk/models/operations/listdisputes.py +172 -0
- moovio_sdk/models/operations/listfeeplanagreements.py +101 -0
- moovio_sdk/models/operations/listfeeplans.py +78 -0
- moovio_sdk/models/operations/listfeesfetch.py +80 -0
- moovio_sdk/models/operations/listfiles.py +64 -0
- moovio_sdk/models/operations/listindustries.py +62 -0
- moovio_sdk/models/operations/listinstitutions.py +92 -0
- moovio_sdk/models/operations/listissuedcardauthorizationevents.py +94 -0
- moovio_sdk/models/operations/listissuedcardauthorizations.py +126 -0
- moovio_sdk/models/operations/listissuedcards.py +94 -0
- moovio_sdk/models/operations/listissuedcardtransactions.py +113 -0
- moovio_sdk/models/operations/listonboardinginvites.py +60 -0
- moovio_sdk/models/operations/listpartnerpricing.py +78 -0
- moovio_sdk/models/operations/listpartnerpricingagreements.py +101 -0
- moovio_sdk/models/operations/listpaymentlinks.py +64 -0
- moovio_sdk/models/operations/listpaymentmethods.py +98 -0
- moovio_sdk/models/operations/listreceipts.py +65 -0
- moovio_sdk/models/operations/listrefunds.py +75 -0
- moovio_sdk/models/operations/listrepresentatives.py +66 -0
- moovio_sdk/models/operations/listschedules.py +81 -0
- moovio_sdk/models/operations/listsweepconfigs.py +64 -0
- moovio_sdk/models/operations/listsweeps.py +108 -0
- moovio_sdk/models/operations/listterminalapplications.py +62 -0
- moovio_sdk/models/operations/listtransfers.py +145 -0
- moovio_sdk/models/operations/listwallets.py +64 -0
- moovio_sdk/models/operations/listwallettransactions.py +189 -0
- moovio_sdk/models/operations/ping.py +56 -0
- moovio_sdk/models/operations/registerapplepaymerchantdomains.py +80 -0
- moovio_sdk/models/operations/requestcapabilities.py +78 -0
- moovio_sdk/models/operations/requestcard.py +80 -0
- moovio_sdk/models/operations/retrievefees.py +117 -0
- moovio_sdk/models/operations/revokeaccesstoken.py +48 -0
- moovio_sdk/models/operations/revokeonboardinginvite.py +58 -0
- moovio_sdk/models/operations/submitdisputeevidence.py +71 -0
- moovio_sdk/models/operations/testendtoendtoken.py +56 -0
- moovio_sdk/models/operations/updateaccount.py +78 -0
- moovio_sdk/models/operations/updateapplepaymerchantdomains.py +78 -0
- moovio_sdk/models/operations/updatebrand.py +78 -0
- moovio_sdk/models/operations/updatecard.py +85 -0
- moovio_sdk/models/operations/updatedisputeevidence.py +92 -0
- moovio_sdk/models/operations/updateissuedcard.py +81 -0
- moovio_sdk/models/operations/updatepaymentlink.py +85 -0
- moovio_sdk/models/operations/updaterepresentative.py +89 -0
- moovio_sdk/models/operations/updateschedule.py +85 -0
- moovio_sdk/models/operations/updatesweepconfig.py +85 -0
- moovio_sdk/models/operations/updatetransfer.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencefile.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencetext.py +85 -0
- moovio_sdk/models/operations/uploadfile.py +80 -0
- moovio_sdk/models/operations/upsertbrand.py +75 -0
- moovio_sdk/models/operations/upsertunderwriting.py +78 -0
- moovio_sdk/onboarding.py +965 -0
- moovio_sdk/payment_links.py +1694 -0
- moovio_sdk/payment_methods.py +475 -0
- moovio_sdk/ping.py +233 -0
- moovio_sdk/py.typed +1 -0
- moovio_sdk/receipts.py +507 -0
- moovio_sdk/representatives.py +1513 -0
- moovio_sdk/scheduling.py +1565 -0
- moovio_sdk/sdk.py +242 -0
- moovio_sdk/sdkconfiguration.py +59 -0
- moovio_sdk/sweeps.py +1617 -0
- moovio_sdk/terminal_applications.py +1013 -0
- moovio_sdk/transfers.py +3040 -0
- moovio_sdk/types/__init__.py +21 -0
- moovio_sdk/types/basemodel.py +39 -0
- moovio_sdk/underwriting.py +581 -0
- moovio_sdk/utils/__init__.py +101 -0
- moovio_sdk/utils/annotations.py +55 -0
- moovio_sdk/utils/enums.py +34 -0
- moovio_sdk/utils/eventstreaming.py +238 -0
- moovio_sdk/utils/forms.py +202 -0
- moovio_sdk/utils/headers.py +136 -0
- moovio_sdk/utils/logger.py +27 -0
- moovio_sdk/utils/metadata.py +118 -0
- moovio_sdk/utils/queryparams.py +205 -0
- moovio_sdk/utils/requestbodies.py +66 -0
- moovio_sdk/utils/retries.py +217 -0
- moovio_sdk/utils/security.py +195 -0
- moovio_sdk/utils/serializers.py +215 -0
- moovio_sdk/utils/url.py +155 -0
- moovio_sdk/utils/values.py +137 -0
- moovio_sdk/wallet_transactions.py +558 -0
- moovio_sdk/wallets.py +465 -0
- moovio_sdk-0.3.8.dist-info/METADATA +1920 -0
- moovio_sdk-0.3.8.dist-info/RECORD +586 -0
- moovio_sdk-0.3.8.dist-info/WHEEL +4 -0
moovio_sdk/apple_pay.py
ADDED
@@ -0,0 +1,1417 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from moovio_sdk import utils
|
5
|
+
from moovio_sdk._hooks import HookContext
|
6
|
+
from moovio_sdk.models import components, errors, operations
|
7
|
+
from moovio_sdk.types import OptionalNullable, UNSET
|
8
|
+
from moovio_sdk.utils import get_security_from_env
|
9
|
+
from typing import Any, List, Mapping, Optional, Union
|
10
|
+
|
11
|
+
|
12
|
+
class ApplePay(BaseSDK):
|
13
|
+
def register_merchant_domains(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
account_id: str,
|
17
|
+
display_name: Optional[str] = None,
|
18
|
+
domains: Optional[List[str]] = None,
|
19
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
20
|
+
server_url: Optional[str] = None,
|
21
|
+
timeout_ms: Optional[int] = None,
|
22
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
23
|
+
) -> operations.RegisterApplePayMerchantDomainsResponse:
|
24
|
+
r"""Add domains to be registered with Apple Pay.
|
25
|
+
|
26
|
+
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
27
|
+
with Apple.
|
28
|
+
|
29
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
30
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
31
|
+
|
32
|
+
:param account_id: ID of the Moov account representing the merchant.
|
33
|
+
:param display_name: A UTF-8 string to display in the Buy button.
|
34
|
+
:param domains: A unique list of fully-qualified, top-level or sub-domain names where you will accept Apple Pay.
|
35
|
+
:param retries: Override the default retry configuration for this method
|
36
|
+
:param server_url: Override the default server URL for this method
|
37
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
38
|
+
:param http_headers: Additional headers to set or replace on requests.
|
39
|
+
"""
|
40
|
+
base_url = None
|
41
|
+
url_variables = None
|
42
|
+
if timeout_ms is None:
|
43
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
44
|
+
|
45
|
+
if server_url is not None:
|
46
|
+
base_url = server_url
|
47
|
+
else:
|
48
|
+
base_url = self._get_url(base_url, url_variables)
|
49
|
+
|
50
|
+
request = operations.RegisterApplePayMerchantDomainsRequest(
|
51
|
+
account_id=account_id,
|
52
|
+
register_apple_pay_merchant_domains=components.RegisterApplePayMerchantDomains(
|
53
|
+
display_name=display_name,
|
54
|
+
domains=domains,
|
55
|
+
),
|
56
|
+
)
|
57
|
+
|
58
|
+
req = self._build_request(
|
59
|
+
method="POST",
|
60
|
+
path="/accounts/{accountID}/apple-pay/domains",
|
61
|
+
base_url=base_url,
|
62
|
+
url_variables=url_variables,
|
63
|
+
request=request,
|
64
|
+
request_body_required=True,
|
65
|
+
request_has_path_params=True,
|
66
|
+
request_has_query_params=True,
|
67
|
+
user_agent_header="user-agent",
|
68
|
+
accept_header_value="application/json",
|
69
|
+
http_headers=http_headers,
|
70
|
+
_globals=operations.RegisterApplePayMerchantDomainsGlobals(
|
71
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
72
|
+
),
|
73
|
+
security=self.sdk_configuration.security,
|
74
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
75
|
+
request.register_apple_pay_merchant_domains,
|
76
|
+
False,
|
77
|
+
False,
|
78
|
+
"json",
|
79
|
+
components.RegisterApplePayMerchantDomains,
|
80
|
+
),
|
81
|
+
timeout_ms=timeout_ms,
|
82
|
+
)
|
83
|
+
|
84
|
+
if retries == UNSET:
|
85
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
86
|
+
retries = self.sdk_configuration.retry_config
|
87
|
+
|
88
|
+
retry_config = None
|
89
|
+
if isinstance(retries, utils.RetryConfig):
|
90
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
91
|
+
|
92
|
+
http_res = self.do_request(
|
93
|
+
hook_ctx=HookContext(
|
94
|
+
base_url=base_url or "",
|
95
|
+
operation_id="registerApplePayMerchantDomains",
|
96
|
+
oauth2_scopes=[],
|
97
|
+
security_source=get_security_from_env(
|
98
|
+
self.sdk_configuration.security, components.Security
|
99
|
+
),
|
100
|
+
),
|
101
|
+
request=req,
|
102
|
+
error_status_codes=[
|
103
|
+
"400",
|
104
|
+
"401",
|
105
|
+
"403",
|
106
|
+
"409",
|
107
|
+
"417",
|
108
|
+
"429",
|
109
|
+
"4XX",
|
110
|
+
"500",
|
111
|
+
"504",
|
112
|
+
"5XX",
|
113
|
+
],
|
114
|
+
retry_config=retry_config,
|
115
|
+
)
|
116
|
+
|
117
|
+
response_data: Any = None
|
118
|
+
if utils.match_response(http_res, "200", "application/json"):
|
119
|
+
return operations.RegisterApplePayMerchantDomainsResponse(
|
120
|
+
result=utils.unmarshal_json(
|
121
|
+
http_res.text, components.ApplePayMerchantDomains
|
122
|
+
),
|
123
|
+
headers=utils.get_response_headers(http_res.headers),
|
124
|
+
)
|
125
|
+
if utils.match_response(http_res, "400", "application/json"):
|
126
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
127
|
+
raise errors.GenericError(data=response_data)
|
128
|
+
if utils.match_response(http_res, ["401", "403", "409", "417", "429"], "*"):
|
129
|
+
http_res_text = utils.stream_to_text(http_res)
|
130
|
+
raise errors.APIError(
|
131
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
132
|
+
)
|
133
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
134
|
+
http_res_text = utils.stream_to_text(http_res)
|
135
|
+
raise errors.APIError(
|
136
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
137
|
+
)
|
138
|
+
if utils.match_response(http_res, "4XX", "*"):
|
139
|
+
http_res_text = utils.stream_to_text(http_res)
|
140
|
+
raise errors.APIError(
|
141
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
142
|
+
)
|
143
|
+
if utils.match_response(http_res, "5XX", "*"):
|
144
|
+
http_res_text = utils.stream_to_text(http_res)
|
145
|
+
raise errors.APIError(
|
146
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
147
|
+
)
|
148
|
+
|
149
|
+
content_type = http_res.headers.get("Content-Type")
|
150
|
+
http_res_text = utils.stream_to_text(http_res)
|
151
|
+
raise errors.APIError(
|
152
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
153
|
+
http_res.status_code,
|
154
|
+
http_res_text,
|
155
|
+
http_res,
|
156
|
+
)
|
157
|
+
|
158
|
+
async def register_merchant_domains_async(
|
159
|
+
self,
|
160
|
+
*,
|
161
|
+
account_id: str,
|
162
|
+
display_name: Optional[str] = None,
|
163
|
+
domains: Optional[List[str]] = None,
|
164
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
165
|
+
server_url: Optional[str] = None,
|
166
|
+
timeout_ms: Optional[int] = None,
|
167
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
168
|
+
) -> operations.RegisterApplePayMerchantDomainsResponse:
|
169
|
+
r"""Add domains to be registered with Apple Pay.
|
170
|
+
|
171
|
+
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
172
|
+
with Apple.
|
173
|
+
|
174
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
175
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
176
|
+
|
177
|
+
:param account_id: ID of the Moov account representing the merchant.
|
178
|
+
:param display_name: A UTF-8 string to display in the Buy button.
|
179
|
+
:param domains: A unique list of fully-qualified, top-level or sub-domain names where you will accept Apple Pay.
|
180
|
+
:param retries: Override the default retry configuration for this method
|
181
|
+
:param server_url: Override the default server URL for this method
|
182
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
183
|
+
:param http_headers: Additional headers to set or replace on requests.
|
184
|
+
"""
|
185
|
+
base_url = None
|
186
|
+
url_variables = None
|
187
|
+
if timeout_ms is None:
|
188
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
189
|
+
|
190
|
+
if server_url is not None:
|
191
|
+
base_url = server_url
|
192
|
+
else:
|
193
|
+
base_url = self._get_url(base_url, url_variables)
|
194
|
+
|
195
|
+
request = operations.RegisterApplePayMerchantDomainsRequest(
|
196
|
+
account_id=account_id,
|
197
|
+
register_apple_pay_merchant_domains=components.RegisterApplePayMerchantDomains(
|
198
|
+
display_name=display_name,
|
199
|
+
domains=domains,
|
200
|
+
),
|
201
|
+
)
|
202
|
+
|
203
|
+
req = self._build_request_async(
|
204
|
+
method="POST",
|
205
|
+
path="/accounts/{accountID}/apple-pay/domains",
|
206
|
+
base_url=base_url,
|
207
|
+
url_variables=url_variables,
|
208
|
+
request=request,
|
209
|
+
request_body_required=True,
|
210
|
+
request_has_path_params=True,
|
211
|
+
request_has_query_params=True,
|
212
|
+
user_agent_header="user-agent",
|
213
|
+
accept_header_value="application/json",
|
214
|
+
http_headers=http_headers,
|
215
|
+
_globals=operations.RegisterApplePayMerchantDomainsGlobals(
|
216
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
217
|
+
),
|
218
|
+
security=self.sdk_configuration.security,
|
219
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
220
|
+
request.register_apple_pay_merchant_domains,
|
221
|
+
False,
|
222
|
+
False,
|
223
|
+
"json",
|
224
|
+
components.RegisterApplePayMerchantDomains,
|
225
|
+
),
|
226
|
+
timeout_ms=timeout_ms,
|
227
|
+
)
|
228
|
+
|
229
|
+
if retries == UNSET:
|
230
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
231
|
+
retries = self.sdk_configuration.retry_config
|
232
|
+
|
233
|
+
retry_config = None
|
234
|
+
if isinstance(retries, utils.RetryConfig):
|
235
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
236
|
+
|
237
|
+
http_res = await self.do_request_async(
|
238
|
+
hook_ctx=HookContext(
|
239
|
+
base_url=base_url or "",
|
240
|
+
operation_id="registerApplePayMerchantDomains",
|
241
|
+
oauth2_scopes=[],
|
242
|
+
security_source=get_security_from_env(
|
243
|
+
self.sdk_configuration.security, components.Security
|
244
|
+
),
|
245
|
+
),
|
246
|
+
request=req,
|
247
|
+
error_status_codes=[
|
248
|
+
"400",
|
249
|
+
"401",
|
250
|
+
"403",
|
251
|
+
"409",
|
252
|
+
"417",
|
253
|
+
"429",
|
254
|
+
"4XX",
|
255
|
+
"500",
|
256
|
+
"504",
|
257
|
+
"5XX",
|
258
|
+
],
|
259
|
+
retry_config=retry_config,
|
260
|
+
)
|
261
|
+
|
262
|
+
response_data: Any = None
|
263
|
+
if utils.match_response(http_res, "200", "application/json"):
|
264
|
+
return operations.RegisterApplePayMerchantDomainsResponse(
|
265
|
+
result=utils.unmarshal_json(
|
266
|
+
http_res.text, components.ApplePayMerchantDomains
|
267
|
+
),
|
268
|
+
headers=utils.get_response_headers(http_res.headers),
|
269
|
+
)
|
270
|
+
if utils.match_response(http_res, "400", "application/json"):
|
271
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
272
|
+
raise errors.GenericError(data=response_data)
|
273
|
+
if utils.match_response(http_res, ["401", "403", "409", "417", "429"], "*"):
|
274
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
275
|
+
raise errors.APIError(
|
276
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
277
|
+
)
|
278
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
279
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
280
|
+
raise errors.APIError(
|
281
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
282
|
+
)
|
283
|
+
if utils.match_response(http_res, "4XX", "*"):
|
284
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
285
|
+
raise errors.APIError(
|
286
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
287
|
+
)
|
288
|
+
if utils.match_response(http_res, "5XX", "*"):
|
289
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
290
|
+
raise errors.APIError(
|
291
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
292
|
+
)
|
293
|
+
|
294
|
+
content_type = http_res.headers.get("Content-Type")
|
295
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
296
|
+
raise errors.APIError(
|
297
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
298
|
+
http_res.status_code,
|
299
|
+
http_res_text,
|
300
|
+
http_res,
|
301
|
+
)
|
302
|
+
|
303
|
+
def update_merchant_domains(
|
304
|
+
self,
|
305
|
+
*,
|
306
|
+
account_id: str,
|
307
|
+
add_domains: Optional[List[str]] = None,
|
308
|
+
remove_domains: Optional[List[str]] = None,
|
309
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
310
|
+
server_url: Optional[str] = None,
|
311
|
+
timeout_ms: Optional[int] = None,
|
312
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
313
|
+
) -> operations.UpdateApplePayMerchantDomainsResponse:
|
314
|
+
r"""Add or remove domains to be registered with Apple Pay.
|
315
|
+
|
316
|
+
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
317
|
+
with Apple.
|
318
|
+
|
319
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
320
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
321
|
+
|
322
|
+
:param account_id: ID of the Moov account representing the merchant.
|
323
|
+
:param add_domains: A unique list of fully-qualified, top-level or sub-domain names to add.
|
324
|
+
:param remove_domains: A unique list of fully-qualified, top-level or sub-domain names to remove.
|
325
|
+
:param retries: Override the default retry configuration for this method
|
326
|
+
:param server_url: Override the default server URL for this method
|
327
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
328
|
+
:param http_headers: Additional headers to set or replace on requests.
|
329
|
+
"""
|
330
|
+
base_url = None
|
331
|
+
url_variables = None
|
332
|
+
if timeout_ms is None:
|
333
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
334
|
+
|
335
|
+
if server_url is not None:
|
336
|
+
base_url = server_url
|
337
|
+
else:
|
338
|
+
base_url = self._get_url(base_url, url_variables)
|
339
|
+
|
340
|
+
request = operations.UpdateApplePayMerchantDomainsRequest(
|
341
|
+
account_id=account_id,
|
342
|
+
update_apple_pay_merchant_domains=components.UpdateApplePayMerchantDomains(
|
343
|
+
add_domains=add_domains,
|
344
|
+
remove_domains=remove_domains,
|
345
|
+
),
|
346
|
+
)
|
347
|
+
|
348
|
+
req = self._build_request(
|
349
|
+
method="PATCH",
|
350
|
+
path="/accounts/{accountID}/apple-pay/domains",
|
351
|
+
base_url=base_url,
|
352
|
+
url_variables=url_variables,
|
353
|
+
request=request,
|
354
|
+
request_body_required=True,
|
355
|
+
request_has_path_params=True,
|
356
|
+
request_has_query_params=True,
|
357
|
+
user_agent_header="user-agent",
|
358
|
+
accept_header_value="application/json",
|
359
|
+
http_headers=http_headers,
|
360
|
+
_globals=operations.UpdateApplePayMerchantDomainsGlobals(
|
361
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
362
|
+
),
|
363
|
+
security=self.sdk_configuration.security,
|
364
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
365
|
+
request.update_apple_pay_merchant_domains,
|
366
|
+
False,
|
367
|
+
False,
|
368
|
+
"json",
|
369
|
+
components.UpdateApplePayMerchantDomains,
|
370
|
+
),
|
371
|
+
timeout_ms=timeout_ms,
|
372
|
+
)
|
373
|
+
|
374
|
+
if retries == UNSET:
|
375
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
376
|
+
retries = self.sdk_configuration.retry_config
|
377
|
+
|
378
|
+
retry_config = None
|
379
|
+
if isinstance(retries, utils.RetryConfig):
|
380
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
381
|
+
|
382
|
+
http_res = self.do_request(
|
383
|
+
hook_ctx=HookContext(
|
384
|
+
base_url=base_url or "",
|
385
|
+
operation_id="updateApplePayMerchantDomains",
|
386
|
+
oauth2_scopes=[],
|
387
|
+
security_source=get_security_from_env(
|
388
|
+
self.sdk_configuration.security, components.Security
|
389
|
+
),
|
390
|
+
),
|
391
|
+
request=req,
|
392
|
+
error_status_codes=[
|
393
|
+
"400",
|
394
|
+
"401",
|
395
|
+
"403",
|
396
|
+
"404",
|
397
|
+
"409",
|
398
|
+
"417",
|
399
|
+
"429",
|
400
|
+
"4XX",
|
401
|
+
"500",
|
402
|
+
"504",
|
403
|
+
"5XX",
|
404
|
+
],
|
405
|
+
retry_config=retry_config,
|
406
|
+
)
|
407
|
+
|
408
|
+
response_data: Any = None
|
409
|
+
if utils.match_response(http_res, "204", "*"):
|
410
|
+
return operations.UpdateApplePayMerchantDomainsResponse(
|
411
|
+
headers=utils.get_response_headers(http_res.headers)
|
412
|
+
)
|
413
|
+
if utils.match_response(http_res, "400", "application/json"):
|
414
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
415
|
+
raise errors.GenericError(data=response_data)
|
416
|
+
if utils.match_response(
|
417
|
+
http_res, ["401", "403", "404", "409", "417", "429"], "*"
|
418
|
+
):
|
419
|
+
http_res_text = utils.stream_to_text(http_res)
|
420
|
+
raise errors.APIError(
|
421
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
422
|
+
)
|
423
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
424
|
+
http_res_text = utils.stream_to_text(http_res)
|
425
|
+
raise errors.APIError(
|
426
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
427
|
+
)
|
428
|
+
if utils.match_response(http_res, "4XX", "*"):
|
429
|
+
http_res_text = utils.stream_to_text(http_res)
|
430
|
+
raise errors.APIError(
|
431
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
432
|
+
)
|
433
|
+
if utils.match_response(http_res, "5XX", "*"):
|
434
|
+
http_res_text = utils.stream_to_text(http_res)
|
435
|
+
raise errors.APIError(
|
436
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
437
|
+
)
|
438
|
+
|
439
|
+
content_type = http_res.headers.get("Content-Type")
|
440
|
+
http_res_text = utils.stream_to_text(http_res)
|
441
|
+
raise errors.APIError(
|
442
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
443
|
+
http_res.status_code,
|
444
|
+
http_res_text,
|
445
|
+
http_res,
|
446
|
+
)
|
447
|
+
|
448
|
+
async def update_merchant_domains_async(
|
449
|
+
self,
|
450
|
+
*,
|
451
|
+
account_id: str,
|
452
|
+
add_domains: Optional[List[str]] = None,
|
453
|
+
remove_domains: Optional[List[str]] = None,
|
454
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
455
|
+
server_url: Optional[str] = None,
|
456
|
+
timeout_ms: Optional[int] = None,
|
457
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
458
|
+
) -> operations.UpdateApplePayMerchantDomainsResponse:
|
459
|
+
r"""Add or remove domains to be registered with Apple Pay.
|
460
|
+
|
461
|
+
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
462
|
+
with Apple.
|
463
|
+
|
464
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
465
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
466
|
+
|
467
|
+
:param account_id: ID of the Moov account representing the merchant.
|
468
|
+
:param add_domains: A unique list of fully-qualified, top-level or sub-domain names to add.
|
469
|
+
:param remove_domains: A unique list of fully-qualified, top-level or sub-domain names to remove.
|
470
|
+
:param retries: Override the default retry configuration for this method
|
471
|
+
:param server_url: Override the default server URL for this method
|
472
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
473
|
+
:param http_headers: Additional headers to set or replace on requests.
|
474
|
+
"""
|
475
|
+
base_url = None
|
476
|
+
url_variables = None
|
477
|
+
if timeout_ms is None:
|
478
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
479
|
+
|
480
|
+
if server_url is not None:
|
481
|
+
base_url = server_url
|
482
|
+
else:
|
483
|
+
base_url = self._get_url(base_url, url_variables)
|
484
|
+
|
485
|
+
request = operations.UpdateApplePayMerchantDomainsRequest(
|
486
|
+
account_id=account_id,
|
487
|
+
update_apple_pay_merchant_domains=components.UpdateApplePayMerchantDomains(
|
488
|
+
add_domains=add_domains,
|
489
|
+
remove_domains=remove_domains,
|
490
|
+
),
|
491
|
+
)
|
492
|
+
|
493
|
+
req = self._build_request_async(
|
494
|
+
method="PATCH",
|
495
|
+
path="/accounts/{accountID}/apple-pay/domains",
|
496
|
+
base_url=base_url,
|
497
|
+
url_variables=url_variables,
|
498
|
+
request=request,
|
499
|
+
request_body_required=True,
|
500
|
+
request_has_path_params=True,
|
501
|
+
request_has_query_params=True,
|
502
|
+
user_agent_header="user-agent",
|
503
|
+
accept_header_value="application/json",
|
504
|
+
http_headers=http_headers,
|
505
|
+
_globals=operations.UpdateApplePayMerchantDomainsGlobals(
|
506
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
507
|
+
),
|
508
|
+
security=self.sdk_configuration.security,
|
509
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
510
|
+
request.update_apple_pay_merchant_domains,
|
511
|
+
False,
|
512
|
+
False,
|
513
|
+
"json",
|
514
|
+
components.UpdateApplePayMerchantDomains,
|
515
|
+
),
|
516
|
+
timeout_ms=timeout_ms,
|
517
|
+
)
|
518
|
+
|
519
|
+
if retries == UNSET:
|
520
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
521
|
+
retries = self.sdk_configuration.retry_config
|
522
|
+
|
523
|
+
retry_config = None
|
524
|
+
if isinstance(retries, utils.RetryConfig):
|
525
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
526
|
+
|
527
|
+
http_res = await self.do_request_async(
|
528
|
+
hook_ctx=HookContext(
|
529
|
+
base_url=base_url or "",
|
530
|
+
operation_id="updateApplePayMerchantDomains",
|
531
|
+
oauth2_scopes=[],
|
532
|
+
security_source=get_security_from_env(
|
533
|
+
self.sdk_configuration.security, components.Security
|
534
|
+
),
|
535
|
+
),
|
536
|
+
request=req,
|
537
|
+
error_status_codes=[
|
538
|
+
"400",
|
539
|
+
"401",
|
540
|
+
"403",
|
541
|
+
"404",
|
542
|
+
"409",
|
543
|
+
"417",
|
544
|
+
"429",
|
545
|
+
"4XX",
|
546
|
+
"500",
|
547
|
+
"504",
|
548
|
+
"5XX",
|
549
|
+
],
|
550
|
+
retry_config=retry_config,
|
551
|
+
)
|
552
|
+
|
553
|
+
response_data: Any = None
|
554
|
+
if utils.match_response(http_res, "204", "*"):
|
555
|
+
return operations.UpdateApplePayMerchantDomainsResponse(
|
556
|
+
headers=utils.get_response_headers(http_res.headers)
|
557
|
+
)
|
558
|
+
if utils.match_response(http_res, "400", "application/json"):
|
559
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
560
|
+
raise errors.GenericError(data=response_data)
|
561
|
+
if utils.match_response(
|
562
|
+
http_res, ["401", "403", "404", "409", "417", "429"], "*"
|
563
|
+
):
|
564
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
565
|
+
raise errors.APIError(
|
566
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
567
|
+
)
|
568
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
569
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
570
|
+
raise errors.APIError(
|
571
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
572
|
+
)
|
573
|
+
if utils.match_response(http_res, "4XX", "*"):
|
574
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
575
|
+
raise errors.APIError(
|
576
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
577
|
+
)
|
578
|
+
if utils.match_response(http_res, "5XX", "*"):
|
579
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
580
|
+
raise errors.APIError(
|
581
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
582
|
+
)
|
583
|
+
|
584
|
+
content_type = http_res.headers.get("Content-Type")
|
585
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
586
|
+
raise errors.APIError(
|
587
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
588
|
+
http_res.status_code,
|
589
|
+
http_res_text,
|
590
|
+
http_res,
|
591
|
+
)
|
592
|
+
|
593
|
+
def get_merchant_domains(
|
594
|
+
self,
|
595
|
+
*,
|
596
|
+
account_id: str,
|
597
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
598
|
+
server_url: Optional[str] = None,
|
599
|
+
timeout_ms: Optional[int] = None,
|
600
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
601
|
+
) -> operations.GetApplePayMerchantDomainsResponse:
|
602
|
+
r"""Get domains registered with Apple Pay.
|
603
|
+
|
604
|
+
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
605
|
+
|
606
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
607
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.read` scope.
|
608
|
+
|
609
|
+
:param account_id: ID of the Moov account representing the merchant.
|
610
|
+
:param retries: Override the default retry configuration for this method
|
611
|
+
:param server_url: Override the default server URL for this method
|
612
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
613
|
+
:param http_headers: Additional headers to set or replace on requests.
|
614
|
+
"""
|
615
|
+
base_url = None
|
616
|
+
url_variables = None
|
617
|
+
if timeout_ms is None:
|
618
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
619
|
+
|
620
|
+
if server_url is not None:
|
621
|
+
base_url = server_url
|
622
|
+
else:
|
623
|
+
base_url = self._get_url(base_url, url_variables)
|
624
|
+
|
625
|
+
request = operations.GetApplePayMerchantDomainsRequest(
|
626
|
+
account_id=account_id,
|
627
|
+
)
|
628
|
+
|
629
|
+
req = self._build_request(
|
630
|
+
method="GET",
|
631
|
+
path="/accounts/{accountID}/apple-pay/domains",
|
632
|
+
base_url=base_url,
|
633
|
+
url_variables=url_variables,
|
634
|
+
request=request,
|
635
|
+
request_body_required=False,
|
636
|
+
request_has_path_params=True,
|
637
|
+
request_has_query_params=True,
|
638
|
+
user_agent_header="user-agent",
|
639
|
+
accept_header_value="application/json",
|
640
|
+
http_headers=http_headers,
|
641
|
+
_globals=operations.GetApplePayMerchantDomainsGlobals(
|
642
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
643
|
+
),
|
644
|
+
security=self.sdk_configuration.security,
|
645
|
+
timeout_ms=timeout_ms,
|
646
|
+
)
|
647
|
+
|
648
|
+
if retries == UNSET:
|
649
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
650
|
+
retries = self.sdk_configuration.retry_config
|
651
|
+
|
652
|
+
retry_config = None
|
653
|
+
if isinstance(retries, utils.RetryConfig):
|
654
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
655
|
+
|
656
|
+
http_res = self.do_request(
|
657
|
+
hook_ctx=HookContext(
|
658
|
+
base_url=base_url or "",
|
659
|
+
operation_id="getApplePayMerchantDomains",
|
660
|
+
oauth2_scopes=[],
|
661
|
+
security_source=get_security_from_env(
|
662
|
+
self.sdk_configuration.security, components.Security
|
663
|
+
),
|
664
|
+
),
|
665
|
+
request=req,
|
666
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
667
|
+
retry_config=retry_config,
|
668
|
+
)
|
669
|
+
|
670
|
+
if utils.match_response(http_res, "200", "application/json"):
|
671
|
+
return operations.GetApplePayMerchantDomainsResponse(
|
672
|
+
result=utils.unmarshal_json(
|
673
|
+
http_res.text, components.ApplePayMerchantDomains
|
674
|
+
),
|
675
|
+
headers=utils.get_response_headers(http_res.headers),
|
676
|
+
)
|
677
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
678
|
+
http_res_text = utils.stream_to_text(http_res)
|
679
|
+
raise errors.APIError(
|
680
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
681
|
+
)
|
682
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
683
|
+
http_res_text = utils.stream_to_text(http_res)
|
684
|
+
raise errors.APIError(
|
685
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
686
|
+
)
|
687
|
+
if utils.match_response(http_res, "4XX", "*"):
|
688
|
+
http_res_text = utils.stream_to_text(http_res)
|
689
|
+
raise errors.APIError(
|
690
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
691
|
+
)
|
692
|
+
if utils.match_response(http_res, "5XX", "*"):
|
693
|
+
http_res_text = utils.stream_to_text(http_res)
|
694
|
+
raise errors.APIError(
|
695
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
696
|
+
)
|
697
|
+
|
698
|
+
content_type = http_res.headers.get("Content-Type")
|
699
|
+
http_res_text = utils.stream_to_text(http_res)
|
700
|
+
raise errors.APIError(
|
701
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
702
|
+
http_res.status_code,
|
703
|
+
http_res_text,
|
704
|
+
http_res,
|
705
|
+
)
|
706
|
+
|
707
|
+
async def get_merchant_domains_async(
|
708
|
+
self,
|
709
|
+
*,
|
710
|
+
account_id: str,
|
711
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
712
|
+
server_url: Optional[str] = None,
|
713
|
+
timeout_ms: Optional[int] = None,
|
714
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
715
|
+
) -> operations.GetApplePayMerchantDomainsResponse:
|
716
|
+
r"""Get domains registered with Apple Pay.
|
717
|
+
|
718
|
+
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
719
|
+
|
720
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
721
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.read` scope.
|
722
|
+
|
723
|
+
:param account_id: ID of the Moov account representing the merchant.
|
724
|
+
:param retries: Override the default retry configuration for this method
|
725
|
+
:param server_url: Override the default server URL for this method
|
726
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
727
|
+
:param http_headers: Additional headers to set or replace on requests.
|
728
|
+
"""
|
729
|
+
base_url = None
|
730
|
+
url_variables = None
|
731
|
+
if timeout_ms is None:
|
732
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
733
|
+
|
734
|
+
if server_url is not None:
|
735
|
+
base_url = server_url
|
736
|
+
else:
|
737
|
+
base_url = self._get_url(base_url, url_variables)
|
738
|
+
|
739
|
+
request = operations.GetApplePayMerchantDomainsRequest(
|
740
|
+
account_id=account_id,
|
741
|
+
)
|
742
|
+
|
743
|
+
req = self._build_request_async(
|
744
|
+
method="GET",
|
745
|
+
path="/accounts/{accountID}/apple-pay/domains",
|
746
|
+
base_url=base_url,
|
747
|
+
url_variables=url_variables,
|
748
|
+
request=request,
|
749
|
+
request_body_required=False,
|
750
|
+
request_has_path_params=True,
|
751
|
+
request_has_query_params=True,
|
752
|
+
user_agent_header="user-agent",
|
753
|
+
accept_header_value="application/json",
|
754
|
+
http_headers=http_headers,
|
755
|
+
_globals=operations.GetApplePayMerchantDomainsGlobals(
|
756
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
757
|
+
),
|
758
|
+
security=self.sdk_configuration.security,
|
759
|
+
timeout_ms=timeout_ms,
|
760
|
+
)
|
761
|
+
|
762
|
+
if retries == UNSET:
|
763
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
764
|
+
retries = self.sdk_configuration.retry_config
|
765
|
+
|
766
|
+
retry_config = None
|
767
|
+
if isinstance(retries, utils.RetryConfig):
|
768
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
769
|
+
|
770
|
+
http_res = await self.do_request_async(
|
771
|
+
hook_ctx=HookContext(
|
772
|
+
base_url=base_url or "",
|
773
|
+
operation_id="getApplePayMerchantDomains",
|
774
|
+
oauth2_scopes=[],
|
775
|
+
security_source=get_security_from_env(
|
776
|
+
self.sdk_configuration.security, components.Security
|
777
|
+
),
|
778
|
+
),
|
779
|
+
request=req,
|
780
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
781
|
+
retry_config=retry_config,
|
782
|
+
)
|
783
|
+
|
784
|
+
if utils.match_response(http_res, "200", "application/json"):
|
785
|
+
return operations.GetApplePayMerchantDomainsResponse(
|
786
|
+
result=utils.unmarshal_json(
|
787
|
+
http_res.text, components.ApplePayMerchantDomains
|
788
|
+
),
|
789
|
+
headers=utils.get_response_headers(http_res.headers),
|
790
|
+
)
|
791
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
792
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
793
|
+
raise errors.APIError(
|
794
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
795
|
+
)
|
796
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
797
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
798
|
+
raise errors.APIError(
|
799
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
800
|
+
)
|
801
|
+
if utils.match_response(http_res, "4XX", "*"):
|
802
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
803
|
+
raise errors.APIError(
|
804
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
805
|
+
)
|
806
|
+
if utils.match_response(http_res, "5XX", "*"):
|
807
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
808
|
+
raise errors.APIError(
|
809
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
810
|
+
)
|
811
|
+
|
812
|
+
content_type = http_res.headers.get("Content-Type")
|
813
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
814
|
+
raise errors.APIError(
|
815
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
816
|
+
http_res.status_code,
|
817
|
+
http_res_text,
|
818
|
+
http_res,
|
819
|
+
)
|
820
|
+
|
821
|
+
def create_session(
|
822
|
+
self,
|
823
|
+
*,
|
824
|
+
account_id: str,
|
825
|
+
domain: str,
|
826
|
+
display_name: str,
|
827
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
828
|
+
server_url: Optional[str] = None,
|
829
|
+
timeout_ms: Optional[int] = None,
|
830
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
831
|
+
) -> operations.CreateApplePaySessionResponse:
|
832
|
+
r"""Create a session with Apple Pay to facilitate a payment.
|
833
|
+
|
834
|
+
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
835
|
+
A successful response from this endpoint should be passed through to Apple Pay unchanged.
|
836
|
+
|
837
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
838
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
839
|
+
|
840
|
+
:param account_id: ID of the Moov account representing the merchant.
|
841
|
+
:param domain: A fully qualified top-level or sub-domain name where you will accept Apple Pay. Should not include \"https\".
|
842
|
+
:param display_name: A UTF-8 string to display in the Buy button.
|
843
|
+
:param retries: Override the default retry configuration for this method
|
844
|
+
:param server_url: Override the default server URL for this method
|
845
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
846
|
+
:param http_headers: Additional headers to set or replace on requests.
|
847
|
+
"""
|
848
|
+
base_url = None
|
849
|
+
url_variables = None
|
850
|
+
if timeout_ms is None:
|
851
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
852
|
+
|
853
|
+
if server_url is not None:
|
854
|
+
base_url = server_url
|
855
|
+
else:
|
856
|
+
base_url = self._get_url(base_url, url_variables)
|
857
|
+
|
858
|
+
request = operations.CreateApplePaySessionRequest(
|
859
|
+
account_id=account_id,
|
860
|
+
create_apple_pay_session=components.CreateApplePaySession(
|
861
|
+
domain=domain,
|
862
|
+
display_name=display_name,
|
863
|
+
),
|
864
|
+
)
|
865
|
+
|
866
|
+
req = self._build_request(
|
867
|
+
method="POST",
|
868
|
+
path="/accounts/{accountID}/apple-pay/sessions",
|
869
|
+
base_url=base_url,
|
870
|
+
url_variables=url_variables,
|
871
|
+
request=request,
|
872
|
+
request_body_required=True,
|
873
|
+
request_has_path_params=True,
|
874
|
+
request_has_query_params=True,
|
875
|
+
user_agent_header="user-agent",
|
876
|
+
accept_header_value="application/json",
|
877
|
+
http_headers=http_headers,
|
878
|
+
_globals=operations.CreateApplePaySessionGlobals(
|
879
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
880
|
+
),
|
881
|
+
security=self.sdk_configuration.security,
|
882
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
883
|
+
request.create_apple_pay_session,
|
884
|
+
False,
|
885
|
+
False,
|
886
|
+
"json",
|
887
|
+
components.CreateApplePaySession,
|
888
|
+
),
|
889
|
+
timeout_ms=timeout_ms,
|
890
|
+
)
|
891
|
+
|
892
|
+
if retries == UNSET:
|
893
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
894
|
+
retries = self.sdk_configuration.retry_config
|
895
|
+
|
896
|
+
retry_config = None
|
897
|
+
if isinstance(retries, utils.RetryConfig):
|
898
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
899
|
+
|
900
|
+
http_res = self.do_request(
|
901
|
+
hook_ctx=HookContext(
|
902
|
+
base_url=base_url or "",
|
903
|
+
operation_id="createApplePaySession",
|
904
|
+
oauth2_scopes=[],
|
905
|
+
security_source=get_security_from_env(
|
906
|
+
self.sdk_configuration.security, components.Security
|
907
|
+
),
|
908
|
+
),
|
909
|
+
request=req,
|
910
|
+
error_status_codes=[
|
911
|
+
"400",
|
912
|
+
"401",
|
913
|
+
"403",
|
914
|
+
"404",
|
915
|
+
"409",
|
916
|
+
"422",
|
917
|
+
"429",
|
918
|
+
"4XX",
|
919
|
+
"500",
|
920
|
+
"504",
|
921
|
+
"5XX",
|
922
|
+
],
|
923
|
+
retry_config=retry_config,
|
924
|
+
)
|
925
|
+
|
926
|
+
response_data: Any = None
|
927
|
+
if utils.match_response(http_res, "200", "application/json"):
|
928
|
+
return operations.CreateApplePaySessionResponse(
|
929
|
+
result=utils.unmarshal_json(http_res.text, str),
|
930
|
+
headers=utils.get_response_headers(http_res.headers),
|
931
|
+
)
|
932
|
+
if utils.match_response(http_res, ["400", "409", "422"], "application/json"):
|
933
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
934
|
+
raise errors.GenericError(data=response_data)
|
935
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
936
|
+
http_res_text = utils.stream_to_text(http_res)
|
937
|
+
raise errors.APIError(
|
938
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
939
|
+
)
|
940
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
941
|
+
http_res_text = utils.stream_to_text(http_res)
|
942
|
+
raise errors.APIError(
|
943
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
944
|
+
)
|
945
|
+
if utils.match_response(http_res, "4XX", "*"):
|
946
|
+
http_res_text = utils.stream_to_text(http_res)
|
947
|
+
raise errors.APIError(
|
948
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
949
|
+
)
|
950
|
+
if utils.match_response(http_res, "5XX", "*"):
|
951
|
+
http_res_text = utils.stream_to_text(http_res)
|
952
|
+
raise errors.APIError(
|
953
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
954
|
+
)
|
955
|
+
|
956
|
+
content_type = http_res.headers.get("Content-Type")
|
957
|
+
http_res_text = utils.stream_to_text(http_res)
|
958
|
+
raise errors.APIError(
|
959
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
960
|
+
http_res.status_code,
|
961
|
+
http_res_text,
|
962
|
+
http_res,
|
963
|
+
)
|
964
|
+
|
965
|
+
async def create_session_async(
|
966
|
+
self,
|
967
|
+
*,
|
968
|
+
account_id: str,
|
969
|
+
domain: str,
|
970
|
+
display_name: str,
|
971
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
972
|
+
server_url: Optional[str] = None,
|
973
|
+
timeout_ms: Optional[int] = None,
|
974
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
975
|
+
) -> operations.CreateApplePaySessionResponse:
|
976
|
+
r"""Create a session with Apple Pay to facilitate a payment.
|
977
|
+
|
978
|
+
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
979
|
+
A successful response from this endpoint should be passed through to Apple Pay unchanged.
|
980
|
+
|
981
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
982
|
+
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
983
|
+
|
984
|
+
:param account_id: ID of the Moov account representing the merchant.
|
985
|
+
:param domain: A fully qualified top-level or sub-domain name where you will accept Apple Pay. Should not include \"https\".
|
986
|
+
:param display_name: A UTF-8 string to display in the Buy button.
|
987
|
+
:param retries: Override the default retry configuration for this method
|
988
|
+
:param server_url: Override the default server URL for this method
|
989
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
990
|
+
:param http_headers: Additional headers to set or replace on requests.
|
991
|
+
"""
|
992
|
+
base_url = None
|
993
|
+
url_variables = None
|
994
|
+
if timeout_ms is None:
|
995
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
996
|
+
|
997
|
+
if server_url is not None:
|
998
|
+
base_url = server_url
|
999
|
+
else:
|
1000
|
+
base_url = self._get_url(base_url, url_variables)
|
1001
|
+
|
1002
|
+
request = operations.CreateApplePaySessionRequest(
|
1003
|
+
account_id=account_id,
|
1004
|
+
create_apple_pay_session=components.CreateApplePaySession(
|
1005
|
+
domain=domain,
|
1006
|
+
display_name=display_name,
|
1007
|
+
),
|
1008
|
+
)
|
1009
|
+
|
1010
|
+
req = self._build_request_async(
|
1011
|
+
method="POST",
|
1012
|
+
path="/accounts/{accountID}/apple-pay/sessions",
|
1013
|
+
base_url=base_url,
|
1014
|
+
url_variables=url_variables,
|
1015
|
+
request=request,
|
1016
|
+
request_body_required=True,
|
1017
|
+
request_has_path_params=True,
|
1018
|
+
request_has_query_params=True,
|
1019
|
+
user_agent_header="user-agent",
|
1020
|
+
accept_header_value="application/json",
|
1021
|
+
http_headers=http_headers,
|
1022
|
+
_globals=operations.CreateApplePaySessionGlobals(
|
1023
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1024
|
+
),
|
1025
|
+
security=self.sdk_configuration.security,
|
1026
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1027
|
+
request.create_apple_pay_session,
|
1028
|
+
False,
|
1029
|
+
False,
|
1030
|
+
"json",
|
1031
|
+
components.CreateApplePaySession,
|
1032
|
+
),
|
1033
|
+
timeout_ms=timeout_ms,
|
1034
|
+
)
|
1035
|
+
|
1036
|
+
if retries == UNSET:
|
1037
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1038
|
+
retries = self.sdk_configuration.retry_config
|
1039
|
+
|
1040
|
+
retry_config = None
|
1041
|
+
if isinstance(retries, utils.RetryConfig):
|
1042
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1043
|
+
|
1044
|
+
http_res = await self.do_request_async(
|
1045
|
+
hook_ctx=HookContext(
|
1046
|
+
base_url=base_url or "",
|
1047
|
+
operation_id="createApplePaySession",
|
1048
|
+
oauth2_scopes=[],
|
1049
|
+
security_source=get_security_from_env(
|
1050
|
+
self.sdk_configuration.security, components.Security
|
1051
|
+
),
|
1052
|
+
),
|
1053
|
+
request=req,
|
1054
|
+
error_status_codes=[
|
1055
|
+
"400",
|
1056
|
+
"401",
|
1057
|
+
"403",
|
1058
|
+
"404",
|
1059
|
+
"409",
|
1060
|
+
"422",
|
1061
|
+
"429",
|
1062
|
+
"4XX",
|
1063
|
+
"500",
|
1064
|
+
"504",
|
1065
|
+
"5XX",
|
1066
|
+
],
|
1067
|
+
retry_config=retry_config,
|
1068
|
+
)
|
1069
|
+
|
1070
|
+
response_data: Any = None
|
1071
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1072
|
+
return operations.CreateApplePaySessionResponse(
|
1073
|
+
result=utils.unmarshal_json(http_res.text, str),
|
1074
|
+
headers=utils.get_response_headers(http_res.headers),
|
1075
|
+
)
|
1076
|
+
if utils.match_response(http_res, ["400", "409", "422"], "application/json"):
|
1077
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1078
|
+
raise errors.GenericError(data=response_data)
|
1079
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1080
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1081
|
+
raise errors.APIError(
|
1082
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1083
|
+
)
|
1084
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1085
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1086
|
+
raise errors.APIError(
|
1087
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1088
|
+
)
|
1089
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1090
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1091
|
+
raise errors.APIError(
|
1092
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1093
|
+
)
|
1094
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1095
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1096
|
+
raise errors.APIError(
|
1097
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1098
|
+
)
|
1099
|
+
|
1100
|
+
content_type = http_res.headers.get("Content-Type")
|
1101
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1102
|
+
raise errors.APIError(
|
1103
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1104
|
+
http_res.status_code,
|
1105
|
+
http_res_text,
|
1106
|
+
http_res,
|
1107
|
+
)
|
1108
|
+
|
1109
|
+
def link_token(
|
1110
|
+
self,
|
1111
|
+
*,
|
1112
|
+
account_id: str,
|
1113
|
+
token: Union[
|
1114
|
+
components.LinkApplePayToken, components.LinkApplePayTokenTypedDict
|
1115
|
+
],
|
1116
|
+
billing_contact: Optional[
|
1117
|
+
Union[
|
1118
|
+
components.AppleBillingContact, components.AppleBillingContactTypedDict
|
1119
|
+
]
|
1120
|
+
] = None,
|
1121
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1122
|
+
server_url: Optional[str] = None,
|
1123
|
+
timeout_ms: Optional[int] = None,
|
1124
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1125
|
+
) -> operations.LinkApplePayTokenResponse:
|
1126
|
+
r"""Connect an Apple Pay token to the specified account.
|
1127
|
+
|
1128
|
+
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
1129
|
+
The `token` data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.
|
1130
|
+
|
1131
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1132
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
1133
|
+
|
1134
|
+
:param account_id: ID of the Moov account representing the cardholder.
|
1135
|
+
:param token: Contains the user's payment information as returned from Apple Pay. Refer to [Apple's documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymenttoken) for more information.
|
1136
|
+
:param billing_contact: Billing contact information as returned from Apple Pay. Refer to [Apple's documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentcontact) for more information.
|
1137
|
+
:param retries: Override the default retry configuration for this method
|
1138
|
+
:param server_url: Override the default server URL for this method
|
1139
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1140
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1141
|
+
"""
|
1142
|
+
base_url = None
|
1143
|
+
url_variables = None
|
1144
|
+
if timeout_ms is None:
|
1145
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1146
|
+
|
1147
|
+
if server_url is not None:
|
1148
|
+
base_url = server_url
|
1149
|
+
else:
|
1150
|
+
base_url = self._get_url(base_url, url_variables)
|
1151
|
+
|
1152
|
+
request = operations.LinkApplePayTokenRequest(
|
1153
|
+
account_id=account_id,
|
1154
|
+
link_apple_pay=components.LinkApplePay(
|
1155
|
+
token=utils.get_pydantic_model(token, components.LinkApplePayToken),
|
1156
|
+
billing_contact=utils.get_pydantic_model(
|
1157
|
+
billing_contact, Optional[components.AppleBillingContact]
|
1158
|
+
),
|
1159
|
+
),
|
1160
|
+
)
|
1161
|
+
|
1162
|
+
req = self._build_request(
|
1163
|
+
method="POST",
|
1164
|
+
path="/accounts/{accountID}/apple-pay/tokens",
|
1165
|
+
base_url=base_url,
|
1166
|
+
url_variables=url_variables,
|
1167
|
+
request=request,
|
1168
|
+
request_body_required=True,
|
1169
|
+
request_has_path_params=True,
|
1170
|
+
request_has_query_params=True,
|
1171
|
+
user_agent_header="user-agent",
|
1172
|
+
accept_header_value="application/json",
|
1173
|
+
http_headers=http_headers,
|
1174
|
+
_globals=operations.LinkApplePayTokenGlobals(
|
1175
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1176
|
+
),
|
1177
|
+
security=self.sdk_configuration.security,
|
1178
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1179
|
+
request.link_apple_pay, False, False, "json", components.LinkApplePay
|
1180
|
+
),
|
1181
|
+
timeout_ms=timeout_ms,
|
1182
|
+
)
|
1183
|
+
|
1184
|
+
if retries == UNSET:
|
1185
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1186
|
+
retries = self.sdk_configuration.retry_config
|
1187
|
+
|
1188
|
+
retry_config = None
|
1189
|
+
if isinstance(retries, utils.RetryConfig):
|
1190
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1191
|
+
|
1192
|
+
http_res = self.do_request(
|
1193
|
+
hook_ctx=HookContext(
|
1194
|
+
base_url=base_url or "",
|
1195
|
+
operation_id="linkApplePayToken",
|
1196
|
+
oauth2_scopes=[],
|
1197
|
+
security_source=get_security_from_env(
|
1198
|
+
self.sdk_configuration.security, components.Security
|
1199
|
+
),
|
1200
|
+
),
|
1201
|
+
request=req,
|
1202
|
+
error_status_codes=[
|
1203
|
+
"400",
|
1204
|
+
"401",
|
1205
|
+
"403",
|
1206
|
+
"404",
|
1207
|
+
"409",
|
1208
|
+
"422",
|
1209
|
+
"429",
|
1210
|
+
"4XX",
|
1211
|
+
"500",
|
1212
|
+
"504",
|
1213
|
+
"5XX",
|
1214
|
+
],
|
1215
|
+
retry_config=retry_config,
|
1216
|
+
)
|
1217
|
+
|
1218
|
+
response_data: Any = None
|
1219
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1220
|
+
return operations.LinkApplePayTokenResponse(
|
1221
|
+
result=utils.unmarshal_json(
|
1222
|
+
http_res.text, components.LinkedApplePayPaymentMethod
|
1223
|
+
),
|
1224
|
+
headers=utils.get_response_headers(http_res.headers),
|
1225
|
+
)
|
1226
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1227
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1228
|
+
raise errors.GenericError(data=response_data)
|
1229
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1230
|
+
response_data = utils.unmarshal_json(
|
1231
|
+
http_res.text, errors.LinkApplePayErrorData
|
1232
|
+
)
|
1233
|
+
raise errors.LinkApplePayError(data=response_data)
|
1234
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1235
|
+
http_res_text = utils.stream_to_text(http_res)
|
1236
|
+
raise errors.APIError(
|
1237
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1238
|
+
)
|
1239
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1240
|
+
http_res_text = utils.stream_to_text(http_res)
|
1241
|
+
raise errors.APIError(
|
1242
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1243
|
+
)
|
1244
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1245
|
+
http_res_text = utils.stream_to_text(http_res)
|
1246
|
+
raise errors.APIError(
|
1247
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1248
|
+
)
|
1249
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1250
|
+
http_res_text = utils.stream_to_text(http_res)
|
1251
|
+
raise errors.APIError(
|
1252
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1253
|
+
)
|
1254
|
+
|
1255
|
+
content_type = http_res.headers.get("Content-Type")
|
1256
|
+
http_res_text = utils.stream_to_text(http_res)
|
1257
|
+
raise errors.APIError(
|
1258
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1259
|
+
http_res.status_code,
|
1260
|
+
http_res_text,
|
1261
|
+
http_res,
|
1262
|
+
)
|
1263
|
+
|
1264
|
+
async def link_token_async(
|
1265
|
+
self,
|
1266
|
+
*,
|
1267
|
+
account_id: str,
|
1268
|
+
token: Union[
|
1269
|
+
components.LinkApplePayToken, components.LinkApplePayTokenTypedDict
|
1270
|
+
],
|
1271
|
+
billing_contact: Optional[
|
1272
|
+
Union[
|
1273
|
+
components.AppleBillingContact, components.AppleBillingContactTypedDict
|
1274
|
+
]
|
1275
|
+
] = None,
|
1276
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1277
|
+
server_url: Optional[str] = None,
|
1278
|
+
timeout_ms: Optional[int] = None,
|
1279
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1280
|
+
) -> operations.LinkApplePayTokenResponse:
|
1281
|
+
r"""Connect an Apple Pay token to the specified account.
|
1282
|
+
|
1283
|
+
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
1284
|
+
The `token` data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.
|
1285
|
+
|
1286
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1287
|
+
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
1288
|
+
|
1289
|
+
:param account_id: ID of the Moov account representing the cardholder.
|
1290
|
+
:param token: Contains the user's payment information as returned from Apple Pay. Refer to [Apple's documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymenttoken) for more information.
|
1291
|
+
:param billing_contact: Billing contact information as returned from Apple Pay. Refer to [Apple's documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentcontact) for more information.
|
1292
|
+
:param retries: Override the default retry configuration for this method
|
1293
|
+
:param server_url: Override the default server URL for this method
|
1294
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1295
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1296
|
+
"""
|
1297
|
+
base_url = None
|
1298
|
+
url_variables = None
|
1299
|
+
if timeout_ms is None:
|
1300
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1301
|
+
|
1302
|
+
if server_url is not None:
|
1303
|
+
base_url = server_url
|
1304
|
+
else:
|
1305
|
+
base_url = self._get_url(base_url, url_variables)
|
1306
|
+
|
1307
|
+
request = operations.LinkApplePayTokenRequest(
|
1308
|
+
account_id=account_id,
|
1309
|
+
link_apple_pay=components.LinkApplePay(
|
1310
|
+
token=utils.get_pydantic_model(token, components.LinkApplePayToken),
|
1311
|
+
billing_contact=utils.get_pydantic_model(
|
1312
|
+
billing_contact, Optional[components.AppleBillingContact]
|
1313
|
+
),
|
1314
|
+
),
|
1315
|
+
)
|
1316
|
+
|
1317
|
+
req = self._build_request_async(
|
1318
|
+
method="POST",
|
1319
|
+
path="/accounts/{accountID}/apple-pay/tokens",
|
1320
|
+
base_url=base_url,
|
1321
|
+
url_variables=url_variables,
|
1322
|
+
request=request,
|
1323
|
+
request_body_required=True,
|
1324
|
+
request_has_path_params=True,
|
1325
|
+
request_has_query_params=True,
|
1326
|
+
user_agent_header="user-agent",
|
1327
|
+
accept_header_value="application/json",
|
1328
|
+
http_headers=http_headers,
|
1329
|
+
_globals=operations.LinkApplePayTokenGlobals(
|
1330
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1331
|
+
),
|
1332
|
+
security=self.sdk_configuration.security,
|
1333
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1334
|
+
request.link_apple_pay, False, False, "json", components.LinkApplePay
|
1335
|
+
),
|
1336
|
+
timeout_ms=timeout_ms,
|
1337
|
+
)
|
1338
|
+
|
1339
|
+
if retries == UNSET:
|
1340
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1341
|
+
retries = self.sdk_configuration.retry_config
|
1342
|
+
|
1343
|
+
retry_config = None
|
1344
|
+
if isinstance(retries, utils.RetryConfig):
|
1345
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1346
|
+
|
1347
|
+
http_res = await self.do_request_async(
|
1348
|
+
hook_ctx=HookContext(
|
1349
|
+
base_url=base_url or "",
|
1350
|
+
operation_id="linkApplePayToken",
|
1351
|
+
oauth2_scopes=[],
|
1352
|
+
security_source=get_security_from_env(
|
1353
|
+
self.sdk_configuration.security, components.Security
|
1354
|
+
),
|
1355
|
+
),
|
1356
|
+
request=req,
|
1357
|
+
error_status_codes=[
|
1358
|
+
"400",
|
1359
|
+
"401",
|
1360
|
+
"403",
|
1361
|
+
"404",
|
1362
|
+
"409",
|
1363
|
+
"422",
|
1364
|
+
"429",
|
1365
|
+
"4XX",
|
1366
|
+
"500",
|
1367
|
+
"504",
|
1368
|
+
"5XX",
|
1369
|
+
],
|
1370
|
+
retry_config=retry_config,
|
1371
|
+
)
|
1372
|
+
|
1373
|
+
response_data: Any = None
|
1374
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1375
|
+
return operations.LinkApplePayTokenResponse(
|
1376
|
+
result=utils.unmarshal_json(
|
1377
|
+
http_res.text, components.LinkedApplePayPaymentMethod
|
1378
|
+
),
|
1379
|
+
headers=utils.get_response_headers(http_res.headers),
|
1380
|
+
)
|
1381
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1382
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1383
|
+
raise errors.GenericError(data=response_data)
|
1384
|
+
if utils.match_response(http_res, "422", "application/json"):
|
1385
|
+
response_data = utils.unmarshal_json(
|
1386
|
+
http_res.text, errors.LinkApplePayErrorData
|
1387
|
+
)
|
1388
|
+
raise errors.LinkApplePayError(data=response_data)
|
1389
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1390
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1391
|
+
raise errors.APIError(
|
1392
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1393
|
+
)
|
1394
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1395
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1396
|
+
raise errors.APIError(
|
1397
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1398
|
+
)
|
1399
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1400
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1401
|
+
raise errors.APIError(
|
1402
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1403
|
+
)
|
1404
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1405
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1406
|
+
raise errors.APIError(
|
1407
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1408
|
+
)
|
1409
|
+
|
1410
|
+
content_type = http_res.headers.get("Content-Type")
|
1411
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1412
|
+
raise errors.APIError(
|
1413
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1414
|
+
http_res.status_code,
|
1415
|
+
http_res_text,
|
1416
|
+
http_res,
|
1417
|
+
)
|