Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
 def create(self, fees=None):
     transfer = Transfer()
     transfer.DebitedWalletId = self.mangopay_debited_wallet.mangopay_id
     transfer.CreditedWalletId = self.mangopay_credited_wallet.mangopay_id
     transfer.AuthorId =\
         self.mangopay_debited_wallet.mangopay_user.mangopay_id
     transfer.CreditedUserId =\
         self.mangopay_credited_wallet.mangopay_user.mangopay_id
     transfer.DebitedFunds = python_money_to_mangopay_money(
         self.debited_funds)
     transfer.Fees = python_money_to_mangopay_money(self.fees)
     client = get_mangopay_api_client()
     created_transfer = client.transfers.Create(transfer)
     self._update(created_transfer)
Esempio n. 4
0
 def create(self, fees=None):
     transfer = Transfer()
     transfer.DebitedWalletId = self.mangopay_debited_wallet.mangopay_id
     transfer.CreditedWalletId = self.mangopay_credited_wallet.mangopay_id
     transfer.AuthorId =\
         self.mangopay_debited_wallet.mangopay_user.mangopay_id
     transfer.CreditedUserId =\
         self.mangopay_credited_wallet.mangopay_user.mangopay_id
     transfer.DebitedFunds = python_money_to_mangopay_money(
         self.debited_funds)
     if not fees:
         fees = PythonMoney(0, self.debited_funds.currency)
     transfer.Fees = python_money_to_mangopay_money(fees)
     client = get_mangopay_api_client()
     created_transfer = client.transfers.Create(transfer)
     self._update(created_transfer)