Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.assertEqualInputProps(entity1.CreditedFunds, entity2.CreditedFunds)
self.assertEqualInputProps(entity1.Fees, entity2.Fees)
self.assertEqualInputProps(entity1.MeanOfPayment, entity2.MeanOfPayment)
elif (isinstance(entity1, Transfer)):
self.assertEqual(entity1.Tag, entity2.Tag)
self.assertEqual(entity1.AuthorId, entity2.AuthorId)
self.assertEqual(entity1.CreditedUserId, entity2.CreditedUserId)
self.assertEqualInputProps(entity1.DebitedFunds, entity2.DebitedFunds)
self.assertEqualInputProps(entity1.CreditedFunds, entity2.CreditedFunds)
self.assertEqualInputProps(entity1.Fees, entity2.Fees)
elif (isinstance(entity1, PayOutPaymentDetailsBankWire)):
self.assertEqual(entity1.BankAccountId, entity2.BankAccountId)
elif (isinstance(entity1, Transaction)):
self.assertEqual(entity1.Tag, entity2.Tag)
self.assertEqualInputProps(entity1.DebitedFunds, entity2.DebitedFunds)
self.assertEqualInputProps(entity1.CreditedFunds, entity2.CreditedFunds)
self.assertEqualInputProps(entity1.Fees, entity2.Fees)
self.assertEqual(entity1.Status, entity2.Status)
elif (isinstance(entity1, Money)):
self.assertEqual(entity1.Currency, entity2.Currency)
self.assertEqual(entity1.Amount, entity2.Amount)
elif (isinstance(entity1, KycDocument)):
self.assertEqual(entity1.Type, entity2.Type)
self.assertEqual(entity1.Status, entity2.Status)
self.assertEqual(entity1.UserId, entity2.UserId)
else:
raise Exception("Unsupported type")
def test_Wallets_Transactions(self):
john = self.getJohn()
wallet = self.getJohnsWallet()
payIn = self.getJohnsPayInCardWeb()
pagination = Pagination(1, 1)
filter = FilterTransactions()
filter.Type = TransactionType.PAYIN
transactions = self.sdk.wallets.GetTransactions(wallet.Id, pagination, filter)
self.assertEqual(len(transactions), 1)
self.assertIsInstance(transactions[0], Transaction)
self.assertEqual(transactions[0].AuthorId, john.Id)
self.assertEqualInputProps(transactions[0], payIn)
from mangopaysdk.entities.transaction import Transaction
class Refund(Transaction):
"""Refund entity"""
def __init__(self, id = None):
self.InitialTransactionId = None
self.DebitedWalletId = None
self.CreditedWalletId = None
self.InitialTransactionType = None
self.RefundReason = None
return super(Refund, self).__init__(id)
def GetSubObjects(self):
"""Get array with mapping which property is object and what type of object."""
subobjects = super(Refund, self).GetSubObjects()
subobjects['DebitedFunds'] = 'Money'
subobjects['RefundReason'] = 'RefundReason'
return subobjects
from mangopaysdk.entities.transaction import Transaction
class Transfer (Transaction):
def __init__(self, id = None):
self.DebitedWalletId = None
self.CreditedWalletId = None
return super(Transfer, self).__init__(id)
from mangopaysdk.entities.transaction import Transaction
class PayOut (Transaction):
def __init__(self, id = None):
self.DebitedWalletId = None
# PayInPaymentType (BANK_WIRE, MERCHANT_EXPENSE, AMAZON_GIFTCARD)
self.PaymentType = None
# One of PayOutPaymentDetails implementations, depending on PaymentType
self.MeanOfPaymentDetails = None
return super(PayOut, self).__init__(id)
def GetDependsObjects(self):
return {
'PaymentType': {'_property_name': 'MeanOfPaymentDetails', 'BANK_WIRE': 'PayOutPaymentDetailsBankWire'}
}
def GetReadOnlyProperties(self):
properties = super(PayOut, self).GetReadOnlyProperties()
# Money
self.DebitedFunds = None
# Money
self.CreditedFunds = None
# Money
self.Fees = None
# TransactionType {PAYIN, PAYOUT, TRANSFER}
self.Type = None
# TransactionNature {REGULAR, REFUND, REPUDIATION}
self.Nature = None
# TransactionStatus {CREATED, SUCCEEDED, FAILED}
self.Status = None
self.ResultCode = None
# timestamp
self.ExecutionDate = None
return super(Transaction, self).__init__(id)
from mangopaysdk.entities.transaction import Transaction
class PayIn (Transaction):
def __init__(self, id = None):
self.CreditedWalletId = None
# PayInPaymentType {CARD, BANK_WIRE, AUTOMATIC_DEBIT, DIRECT_DEBIT, PREAUTHORIZED, PAYPAL }
self.PaymentType = None
# One of PayInPaymentDetails implementations, depending on PaymentType
self.PaymentDetails = None
# ExecutionType { WEB, TOKEN, DIRECT, PREAUTHORIZED, RECURRING_ORDER_EXECUTION }
self.ExecutionType = None
# One of PayInExecutionDetails implementations, depending on ExecutionType
self.ExecutionDetails = None
return super(PayIn, self).__init__(id)
def GetDependsObjects(self):
return {
'PaymentType': {