Пример #1
0
    def test_Users_GetAll(self):

        sorting = Sorting()
        sorting.AddField("CreationDate", SortDirection.DESC)
        users = self.sdk.users.GetAll(None, sorting)
        self.assertTrue(users[0].CreationDate > users[len(users) - 1].CreationDate)

        sorting = Sorting()
        sorting.AddField("CreationDate", SortDirection.ASC)
        users = self.sdk.users.GetAll(None, sorting)
        self.assertTrue(users[0].CreationDate < users[len(users) - 1].CreationDate)
    def test_KycDocuments_GetAll_SortByCreationDate(self):
        pagination = Pagination(1, 10)
        sorting = Sorting()
        sorting.AddField('CreationDate', SortDirection.DESC)

        list = self.sdk.kycdocuments.GetAll(pagination, sorting)

        self.assertTrue(list[0].CreationDate >= list[1].CreationDate)
    def test_Events_GetEvents(self):
        sorting = Sorting()
        sorting.AddField("Date", "desc")
        events = self.sdk.events.Get(None, None, sorting)
        self.assertTrue(events[0].Date > events[len(events) - 1].Date)

        sorting = Sorting()
        sorting.AddField("Date", "asc")
        events = self.sdk.events.Get(None, None, sorting)
        self.assertTrue(events[0].Date < events[len(events) - 1].Date)

        self.assertNotEqual(events[0].ResourceId, None)
        self.assertNotEqual(events[0].ResourceId, '')
        self.assertNotEqual(events[0].EventType, None)
        self.assertNotEqual(events[0].EventType, '')
        self.assertNotEqual(events[0].Date, None)
        self.assertNotEqual(events[0].Date, '')
Пример #4
0
    def test_Users_Transactions_SortByCreationDate(self):
        john = self.getJohn()
        self.getJohnsPayInCardDirect()
        self.getJohnsPayInCardDirect()
        pagination = Pagination(1, 10)
        sorting = Sorting()
        sorting.AddField('CreationDate', SortDirection.DESC)

        list = self.sdk.users.GetTransactions(john.Id, pagination, sorting)

        self.assertTrue(list[0].CreationDate > list[1].CreationDate)
Пример #5
0
    def test_Users_BankAccounts_SortByCreationDate(self):
        john = self.getJohn()
        self.getJohnsAccount()
        self._johnsAccount = None
        self.getJohnsAccount()
        pagination = Pagination(1, 10)
        sorting = Sorting()
        sorting.AddField('CreationDate', SortDirection.DESC)

        list = self.sdk.users.GetBankAccounts(john.Id, pagination, sorting)

        self.assertTrue(list[0].CreationDate >= list[1].CreationDate)
    def refreshClientDisputes(self):
        sorting = Sorting()
        sorting.AddField("CreationDate", SortDirection.DESC)
        pagination = Pagination(1, 100)
        self._clientDisputes = self.sdk.disputes.GetAll(
            pagination, None, sorting)

        self.assertIsNotNone(self._clientDisputes,
                             'INITIALIZATION FAILURE - cannot test disputes')
        self.assertTrue(
            len(self._clientDisputes) > 0,
            'INITIALIZATION FAILURE - cannot test disputes')
        return
Пример #7
0
    def test_Wallets_Transactions_SortByCreationDate(self):
        wallet = self.getJohnsWallet()
        #create 2 pay-in objects
        self.getJohnsPayInCardWeb()
        self.getJohnsPayInCardWeb()

        sorting = Sorting()
        sorting.AddField('CreationDate', SortDirection.DESC)
        pagination = Pagination(1, 20)
        filter = FilterTransactions()
        filter.Type = TransactionType.PAYIN

        transactions = self.sdk.wallets.GetTransactions(wallet.Id, pagination, filter, sorting)

        self.assertTrue(transactions[0].CreationDate > transactions[1].CreationDate)
Пример #8
0
    def test_Mandates_Get_For_Bank_Account(self):
        user = self.getJohn()
        bankAccountId = self.getJohnsAccount().Id
        returnUrl = 'http://test.test'

        mandatePost = Mandate()
        mandatePost.BankAccountId = bankAccountId
        mandatePost.Culture = 'EN'
        mandatePost.ReturnURL = returnUrl

        mandateCreated = self.sdk.mandates.Create(mandatePost)

        sorting = Sorting()
        sorting.AddField("CreationDate", SortDirection.DESC)
        mandates = self.sdk.mandates.GetForBankAccount(user.Id, bankAccountId, Pagination(), sorting)

        self.assertIsNotNone(mandates)
        self.assertIsNotNone(mandates[0])
        self.assertTrue(mandateCreated.Id == mandates[0].Id)