Exemple #1
0
        public void ValidNonce()
        {
            var ps = PaySystem;

            var wt  = ps.WebTerminal;
            var acc = new Account(wt, NONCE);
            var ctx = new FakeBraintreeTransactionContext {
                IsNewCustomer = true, OrderId = "TEST"
            };
            Transaction tran = null;

            using (var session = ps.StartSession())
                tran = session.Charge(ctx, acc, Account.EmptyInstance, new Amount("usd", 99M), capture: false);

            var split = tran.ProcessorToken.AsString().Split(':');

            tran.Capture(ctx);

            ctx.IsNewCustomer = false;
            ctx.CustomerId    = split[0];
            acc = new Account("Existing", "User", split[1]);
            using (var session = ps.StartSession())
                tran = session.Charge(ctx, acc, Account.EmptyInstance, new Amount("usd", 1000M), capture: false);

            tran.Refund(ctx);
        }
Exemple #2
0
        public void ValidNonce()
        {
            var ps = PaySystem;

              var wt = ps.WebTerminal;
              var acc = new Account(wt, NONCE);
              var ctx = new FakeBraintreeTransactionContext { IsNewCustomer = true, OrderId = "TEST" };
              Transaction tran = null;
              using (var session = ps.StartSession())
            tran = session.Charge(ctx, acc, Account.EmptyInstance, new Amount("usd", 99M), capture: false);

              var split = tran.ProcessorToken.AsString().Split(':');

              tran.Capture(ctx);

              ctx.IsNewCustomer = false;
              ctx.CustomerId = split[0];
              acc = new Account("Existing", "User", split[1]);
              using (var session = ps.StartSession())
            tran = session.Charge(ctx, acc, Account.EmptyInstance, new Amount("usd", 1000M), capture: false);

              tran.Refund(ctx);
        }