本文整理匯總了Python中mangopaysdk.entities.bankaccount.BankAccount.UserId方法的典型用法代碼示例。如果您正苦於以下問題:Python BankAccount.UserId方法的具體用法?Python BankAccount.UserId怎麽用?Python BankAccount.UserId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mangopaysdk.entities.bankaccount.BankAccount
的用法示例。
在下文中一共展示了BankAccount.UserId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create
# 需要導入模塊: from mangopaysdk.entities.bankaccount import BankAccount [as 別名]
# 或者: from mangopaysdk.entities.bankaccount.BankAccount import UserId [as 別名]
def create(self):
client = get_mangopay_api_client()
mangopay_bank_account = BankAccount()
mangopay_bank_account.UserId = self.mangopay_user.mangopay_id
mangopay_bank_account.OwnerName = \
self.mangopay_user.user.get_full_name()
mangopay_bank_account.OwnerAddress = unicode(self.address)
if self.account_type == BA_BIC_IBAN:
# BIC / IBAN type requires setting IBAN and BIC codes only
mangopay_bank_account.Details = BankAccountDetailsIBAN()
mangopay_bank_account.Details.Type = "IBAN"
mangopay_bank_account.Details.IBAN = self.iban
elif self.account_type == BA_US:
mangopay_bank_account.Details = BankAccountDetailsUS()
mangopay_bank_account.Details.Type = "US"
mangopay_bank_account.Details.ABA = self.aba
mangopay_bank_account.Details.DepositAccountType = \
self.deposit_account_type
mangopay_bank_account.Details.AccountNumber = self.account_number
elif self.account_type == BA_OTHER:
# OTHER type requires setting Details object with Account number
# country and BIC code.
mangopay_bank_account.Details = BankAccountDetailsOTHER()
mangopay_bank_account.Details.Type = "OTHER"
mangopay_bank_account.Details.AccountNumber = self.account_number
else:
if self.account_type in BA_NOT_IMPLEMENTED:
raise NotImplementedError(
"Bank Account Type ({0}) not implemeneted.".format(
self.account_type
))
else:
raise Exception(
"Bank Account Type ({0}) is not valid.".format(
self.account_type
))
# Shared Details for IBAN and Other
mangopay_bank_account.Details.BIC = self.bic
if self.country:
mangopay_bank_account.Details.Country = self.country.code
else:
if self.account_type != BA_BIC_IBAN:
raise Exception("Country is required for Bank Accounts of "
"types other than BIC/IBAN")
created_bank_account = client.users.CreateBankAccount(
str(self.mangopay_user.mangopay_id),
mangopay_bank_account)
self.mangopay_id = created_bank_account.Id
self.save()
示例2: create
# 需要導入模塊: from mangopaysdk.entities.bankaccount import BankAccount [as 別名]
# 或者: from mangopaysdk.entities.bankaccount.BankAccount import UserId [as 別名]
def create(self):
client = get_mangopay_api_client()
mangopay_bank_account = BankAccount()
mangopay_bank_account.UserId = self.mangopay_user.mangopay_id
mangopay_bank_account.OwnerName = \
self.mangopay_user.user.get_full_name()
mangopay_bank_account.OwnerAddress = self.address
mangopay_bank_account.IBAN = self.iban
mangopay_bank_account.BIC = self.bic
created_bank_account = client.users.CreateBankAccount(
str(self.mangopay_user.mangopay_id), mangopay_bank_account)
self.mangopay_id = created_bank_account.Id
self.save()
示例3: getJohnsAccount
# 需要導入模塊: from mangopaysdk.entities.bankaccount import BankAccount [as 別名]
# 或者: from mangopaysdk.entities.bankaccount.BankAccount import UserId [as 別名]
def getJohnsAccount(self):
"""Creates TestBase._johnsAccount (bank account belonging to John) if not created yet"""
if self._johnsAccount == None:
john = self.getJohn()
account = BankAccount()
account.OwnerName = john.FirstName + ' ' + john.LastName
account.OwnerAddress = john.Address
account.UserId = john.Id
account.Type = 'IBAN'
account.Details = BankAccountDetailsIBAN()
account.Details.IBAN = 'FR7618829754160173622224154'
account.Details.BIC = 'CMBRFR2BCME'
self._johnsAccount = self.sdk.users.CreateBankAccount(john.Id, account)
self.assertEqualInputProps(self._johnsAccount, account, True)
return self._johnsAccount
示例4: create
# 需要導入模塊: from mangopaysdk.entities.bankaccount import BankAccount [as 別名]
# 或者: from mangopaysdk.entities.bankaccount.BankAccount import UserId [as 別名]
def create(self):
client = get_mangopay_api_client()
mangopay_bank_account = BankAccount()
mangopay_bank_account.UserId = self.mangopay_user.mangopay_id
mangopay_bank_account.OwnerName = \
self.mangopay_user.user.get_full_name()
mangopay_bank_account.OwnerAddress = self.address
mangopay_bank_account.IBAN = self.iban
mangopay_bank_account.BIC = self.bic
if not mangopay_bank_account.IBAN:
mangopay_bank_account.Type = 'OTHER'
bank_details = BankAccountDetailsOTHER()
bank_details.AccountNumber = self.account_number
bank_details.Country = self.country
else:
bank_details = BankAccountDetailsIBAN()
mangopay_bank_account.Details = bank_details
created_bank_account = client.users.CreateBankAccount(
str(self.mangopay_user.mangopay_id), mangopay_bank_account)
self.mangopay_id = created_bank_account.Id
self.save()