本文整理汇总了Python中mangopaysdk.entities.wallet.Wallet.Owners方法的典型用法代码示例。如果您正苦于以下问题:Python Wallet.Owners方法的具体用法?Python Wallet.Owners怎么用?Python Wallet.Owners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mangopaysdk.entities.wallet.Wallet
的用法示例。
在下文中一共展示了Wallet.Owners方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getJohnsTransfer
# 需要导入模块: from mangopaysdk.entities.wallet import Wallet [as 别名]
# 或者: from mangopaysdk.entities.wallet.Wallet import Owners [as 别名]
def getJohnsTransfer(self, walletWithMoney = None, wallet = None):
"""Creates Pay-Out Bank Wire object"""
if walletWithMoney == None:
walletWithMoney = self.getJohnsWalletWithMoney()
if wallet == None:
wallet = Wallet()
wallet.Owners = [walletWithMoney.Owners[0]]
wallet.Currency = 'EUR'
wallet.Description = 'WALLET IN EUR'
wallet = self.sdk.wallets.Create(wallet)
transfer = Transfer()
transfer.Tag = 'DefaultTag'
transfer.AuthorId = walletWithMoney.Owners[0]
transfer.CreditedUserId = walletWithMoney.Owners[0]
transfer.DebitedFunds = Money()
transfer.DebitedFunds.Currency = 'EUR'
transfer.DebitedFunds.Amount = 100
transfer.Fees = Money()
transfer.Fees.Currency = 'EUR'
transfer.Fees.Amount = 0
transfer.DebitedWalletId = walletWithMoney.Id
transfer.CreditedWalletId = wallet.Id
return self.sdk.transfers.Create(transfer)
示例2: get_or_create_wallet
# 需要导入模块: from mangopaysdk.entities.wallet import Wallet [as 别名]
# 或者: from mangopaysdk.entities.wallet.Wallet import Owners [as 别名]
def get_or_create_wallet(mp_user, startup_id):
# FIXME startup_id, and get before create
wallet = Wallet()
wallet.Owners = [mp_user.Id]
wallet.Currency = 'EUR'
wallet.Description = "user ID %d's Wallet, for the startup ID %d" % (dj_user.id, startup_id)
return self.sdk.wallets.Create(wallet)
示例3: create
# 需要导入模块: from mangopaysdk.entities.wallet import Wallet [as 别名]
# 或者: from mangopaysdk.entities.wallet.Wallet import Owners [as 别名]
def create(self, currency, description=""):
mangopay_wallet = Wallet()
mangopay_wallet.Owners = [str(self.mangopay_user.mangopay_id)]
mangopay_wallet.Description = description
mangopay_wallet.Currency = currency
client = get_mangopay_api_client()
created_mangopay_wallet = client.wallets.Create(mangopay_wallet)
self.mangopay_id = created_mangopay_wallet.Id
self.save()
示例4: getJohnsWallet
# 需要导入模块: from mangopaysdk.entities.wallet import Wallet [as 别名]
# 或者: from mangopaysdk.entities.wallet.Wallet import Owners [as 别名]
def getJohnsWallet(self):
"""Creates TestBase._johnsWallet (wallets belonging to John) if not created yet"""
if self._johnsWallet == None:
john = self.getJohn()
wallet = Wallet()
wallet.Owners = [john.Id]
wallet.Currency = 'EUR'
wallet.Description = 'WALLET IN EUR'
self._johnsWallet = self.sdk.wallets.Create(wallet)
#TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#self.assertEqualInputProps(self._johnsWallet, wallet, True)
return self._johnsWallet
示例5: getJohnsWalletWithMoney
# 需要导入模块: from mangopaysdk.entities.wallet import Wallet [as 别名]
# 或者: from mangopaysdk.entities.wallet.Wallet import Owners [as 别名]
def getJohnsWalletWithMoney(self, amount = 10000):
"""Creates static JohnsWallet (wallets belonging to John) if not created yet
return Wallet
"""
if self._johnsWalletWithMoney == None:
john = self.getJohn()
wallet = Wallet()
wallet.Owners = [john.Id]
wallet.Currency = 'EUR'
wallet.Description = 'WALLET IN EUR'
wallet = self.sdk.wallets.Create(wallet)
cardRegistration = CardRegistration()
cardRegistration.UserId = wallet.Owners[0]
cardRegistration.Currency = 'EUR'
cardRegistration = self.sdk.cardRegistrations.Create(cardRegistration)
cardRegistration.RegistrationData = self.getPaylineCorrectRegistartionData(cardRegistration)
cardRegistration = self.sdk.cardRegistrations.Update(cardRegistration)
card = self.sdk.cards.Get(cardRegistration.CardId)
# create pay-in CARD DIRECT
payIn = PayIn()
payIn.CreditedWalletId = wallet.Id
payIn.AuthorId = cardRegistration.UserId
payIn.DebitedFunds = Money()
payIn.DebitedFunds.Amount = amount
payIn.DebitedFunds.Currency = 'EUR'
payIn.Fees = Money()
payIn.Fees.Amount = 0
payIn.Fees.Currency = 'EUR'
# payment type as CARD
payIn.PaymentDetails = PayInPaymentDetailsCard()
if (card.CardType == 'CB' or card.CardType == 'VISA' or card.CardType == 'MASTERCARD' or card.CardType == CardType.CB_VISA_MASTERCARD):
payIn.PaymentDetails.CardType = CardType.CB_VISA_MASTERCARD
# elif (card.CardType == CardType.AMEX):
# payIn.PaymentDetails.CardType = CardType.AMEX
# execution type as DIRECT
payIn.ExecutionDetails = PayInExecutionDetailsDirect()
payIn.ExecutionDetails.CardId = card.Id
payIn.ExecutionDetails.SecureModeReturnURL = 'http://test.com'
# create Pay-In
self.sdk.payIns.Create(payIn)
self._johnsWalletWithMoney = self.sdk.wallets.Get(wallet.Id)
return self._johnsWalletWithMoney