本文整理汇总了Python中mangopaysdk.entities.wallet.Wallet类的典型用法代码示例。如果您正苦于以下问题:Python Wallet类的具体用法?Python Wallet怎么用?Python Wallet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Wallet类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getJohnsTransfer
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
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
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
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: create_wallet
def create_wallet(db, participant):
w = Wallet()
w.Owners.append(participant.mangopay_user_id)
w.Description = str(participant.id)
w.Currency = 'EUR'
w = mangoapi.wallets.Create(w)
db.run("""
UPDATE participants
SET mangopay_wallet_id = %s
WHERE id = %s
""", (w.Id, participant.id))
participant.set_attributes(mangopay_wallet_id=w.Id)
return w.Id
示例6: getJohnsWalletWithMoney
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
示例7: Get
def Get(self, wallet_id):
wallet = Wallet()
wallet.id = wallet_id
wallet.Balance = Money(10000, currency="EUR")
return wallet
示例8: make_wallet
def make_wallet(mangopay_user_id):
w = Wallet()
w.Owners.append(mangopay_user_id)
w.Description = 'test wallet'
w.Currency = 'EUR'
return mangoapi.wallets.Create(w)