示例#1
0
 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);
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 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);
     }
 }
示例#4
0
 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);
     }
 }
示例#5
0
 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);
     }
 }
示例#6
0
 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);
     }
 }