public void CreatePaymentTokenWithOtherOptionsTest() { using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient()) { UserMember payer = TestUtil.CreateMemberAndLinkAccounts(tokenClient); UserMember payee = tokenClient.CreateMemberBlocking(TestUtil.RandomAlias()); Token token = CreateTransferTokenSample.CreateTransferTokenWithOtherOptions(payer, payee.MemberId()); Assert.NotNull(token); } }
public void CreatePaymentTokenScheduledTest() { using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient()) { UserMember payer = TestUtil.CreateMemberAndLinkAccounts(tokenClient); Alias payeeAlias = TestUtil.RandomAlias(); UserMember payee = tokenClient.CreateMemberBlocking(payeeAlias); Token token = CreateTransferTokenSample.CreateTransferTokenScheduled(payer, payeeAlias); Assert.NotNull(token); } }
public void CancelTransferTokenByGrantorTest() { using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient()) { UserMember payer = TestUtil.CreateMemberAndLinkAccounts(tokenClient); Alias granteeAlias = TestUtil.RandomAlias(); UserMember payee = tokenClient.CreateMemberBlocking(granteeAlias); Token token = CreateTransferTokenSample.CreateTransferToken(payer, granteeAlias, Level.Low); TokenOperationResult result = CancelTokenSample.CancelTransferToken(payer, token.Id); Assert.Equal(TokenOperationResult.Types.Status.Success, result.Status); } }
public void GetTransferTokensTest() { using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient()) { UserMember payer = TestUtil.CreateMemberAndLinkAccounts(tokenClient); Alias payeeAlias = TestUtil.RandomAlias(); UserMember payee = tokenClient.CreateMemberBlocking(payeeAlias); Account payeeAccount = LinkMemberAndBankSample.LinkBankAccounts(payee); Token token = CreateTransferTokenSample.CreateTransferToken(payer, payeeAlias, Level.Low); Transfer transfer = RedeemTransferTokenSample.RedeemTransferToken( payee, payeeAccount.Id(), token.Id); GetTransfersSample.GetTransferTokensSample(payer); } }
public void GetTokenTest() { using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient()) { UserMember payer = TestUtil.CreateMemberAndLinkAccounts(tokenClient); Alias granteeAlias = TestUtil.RandomAlias(); UserMember payee = tokenClient.CreateMemberBlocking(granteeAlias); Token token = CreateTransferTokenSample.CreateTransferToken(payer, granteeAlias, Level.Low); Assert.Equal(GetTokensSample.GetToken(payer, token.Id).Id, token.Id); var sigList = GetTokensSample.GetToken(payer, token.Id).PayloadSignatures.Where(sig => sig.Action == TokenSignature.Types.Action.Cancelled).ToList(); Assert.Empty(sigList); // cancel token payer.CancelTokenBlocking(token); sigList = GetTokensSample.GetToken(payer, token.Id).PayloadSignatures.Where(sig => sig.Action == TokenSignature.Types.Action.Cancelled).ToList(); Assert.NotEmpty(sigList); } }
public void RedeemScheduledPaymentTokenTest() { using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient()) { UserMember payer = TestUtil.CreateMemberAndLinkAccounts(tokenClient); Alias payeeAlias = TestUtil.RandomAlias(); UserMember payee = tokenClient.CreateMemberBlocking(payeeAlias); Account payeeAccount = LinkMemberAndBankSample.LinkBankAccounts(payee); Token token = CreateTransferTokenSample.CreateTransferTokenScheduled(payer, payeeAlias); Transfer transfer = RedeemTransferTokenSample.RedeemTransferToken( payee, payeeAccount.Id(), token.Id); Assert.NotNull(transfer); Assert.NotEmpty(transfer.ExecutionDate); } }