Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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, PayInPaymentDetailsCard)):
self.assertEqual(entity1.CardType, entity2.CardType)
self.assertEqual(entity1.RedirectURL, entity2.RedirectURL)
self.assertEqual(entity1.ReturnURL, entity2.ReturnURL)
elif (isinstance(entity1, PayInExecutionDetailsWeb)):
self.assertEqual(entity1.TemplateURL, entity2.TemplateURL)
self.assertEqual(entity1.Culture, entity2.Culture)
self.assertEqual(entity1.SecureMode, entity2.SecureMode)
elif (isinstance(entity1, PayOut)):
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)
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)
def getJohnsPayOutBankWire(self):
"""Creates Pay-Out Bank Wire object"""
if self._johnsPayOutBankWire == None:
wallet = self.getJohnsWallet()
user = self.getJohn()
account = self.getJohnsAccount()
payOut = PayOut()
payOut.Tag = 'DefaultTag'
payOut.AuthorId = user.Id
payOut.CreditedUserId = user.Id
payOut.DebitedFunds = Money()
payOut.DebitedFunds.Currency = 'EUR'
payOut.DebitedFunds.Amount = 10
payOut.Fees = Money()
payOut.Fees.Currency = 'EUR'
payOut.Fees.Amount = 5
payOut.DebitedWalletId = wallet.Id
payOut.MeanOfPaymentDetails = PayOutPaymentDetailsBankWire()
payOut.MeanOfPaymentDetails.BankAccountId = account.Id
self._johnsPayOutBankWire = self.sdk.payOuts.Create(payOut)
return self._johnsPayOutBankWire
def test_Idempotency(self):
key = random.randrange(100000000000000000, 999999999999999999)
wallet = self.getJohnsWallet()
user = self.getJohn()
account = self.getJohnsAccount()
payOutPost = PayOut()
payOutPost.AuthorId = user.Id
payOutPost.DebitedWalletId = wallet.Id
payOutPost.DebitedFunds = Money(10, 'EUR')
payOutPost.Fees = Money(5, 'EUR')
payOutPost.MeanOfPaymentDetails = PayOutPaymentDetailsBankWire()
payOutPost.MeanOfPaymentDetails.BankAccountId = account.Id
payOutPost.MeanOfPaymentDetails.BankWireRef = 'Johns bank wire ref'
payOutPost.Tag = 'DefaultTag'
payOutPost.CreditedUserId = user.Id
payOut = self.sdk.payOuts.CreateIdempotent(key, payOutPost)
self.assertIsNotNone(payOut)
# test existing key
result = self.sdk.idempotency.Get(key)
def _canReadSubRequestData (self, entity, propertyName):
"""Get array with request data.
param object Entity object to send as request data
return array
"""
if isinstance(entity, PayIn) and (propertyName == 'PaymentDetails' or propertyName == 'ExecutionDetails'):
return True
if isinstance(entity, PayOut) and propertyName == 'MeanOfPaymentDetails':
return True
if isinstance(entity, BankAccount) and propertyName == 'Details':
return True
return False
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)