Beispiel #1
0
        public void RedeemStandingOrdersAccessTokenTest()
        {
            using (var tokenClient = TestUtil.CreateClient())
            {
                UserMember grantor      = TestUtil.CreateUserMember();
                string     accountId    = grantor.GetAccountsBlocking()[0].Id();
                Alias      granteeAlias = TestUtil.RandomAlias();
                TppMember  grantee      = tokenClient.CreateMemberBlocking(granteeAlias);

                // make some standing orders
                Alias     payeeAlias = TestUtil.RandomAlias();
                TppMember payee      = tokenClient.CreateMemberBlocking(payeeAlias);
                for (int i = 0; i < 5; i++)
                {
                    Token token = CreateStandingOrderTokenSample.CreateStandingOrderToken(
                        grantor,
                        payeeAlias,
                        Key.Types.Level.Standard);
                    RedeemStandingOrderTokenSample.RedeemStandingOrderToken(
                        payee,
                        token.Id);
                }

                Token accessToken =
                    CreateAndEndorseAccessTokenSample.CreateStandingOrdersAccessToken(grantor, accountId, granteeAlias);
                IList <StandingOrder> standingOrders =
                    RedeemAccessTokenSample.RedeemStandingOrdersAccessToken(grantee, accessToken.Id);

                Assert.Equal(5, standingOrders.Count);
            }
        }
Beispiel #2
0
        public void RedeemStandingOrderTokenTest()
        {
            using (var tokenClient = TestUtil.CreateClient())
            {
                UserMember payer      = TestUtil.CreateUserMember();
                Alias      payeeAlias = TestUtil.RandomAlias();
                TppMember  payee      = tokenClient.CreateMemberBlocking(payeeAlias);

                Account payeeAccount = payee.CreateTestBankAccountBlocking(1000, "EUR");

                Token token =
                    CreateStandingOrderTokenSample.CreateStandingOrderToken(payer, payeeAlias, Level.Standard);

                StandingOrderSubmission submission = RedeemStandingOrderTokenSample
                                                     .RedeemStandingOrderToken(payee, token.Id);
                Assert.NotNull(submission);
            }
        }