Ejemplo n.º 1
0
        public static void CaptureImplicitTotal(PaySession sess)
        {
            var amount = new NFX.Financial.Amount("usd", 17.25M);
            var charge = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT,
              amount, false, "test payment");

            Assert.AreEqual(new NFX.Financial.Amount("usd", .0M), charge.AmountCaptured);

            charge.Capture(null);

            Assert.AreEqual(amount, charge.AmountCaptured);
        }
Ejemplo n.º 2
0
        public static void CapturePartial(PaySession sess)
        {
            var chargeAmount = new Financial.Amount("usd", 17.25M);

            var charge = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT,
              chargeAmount, false, "test payment");

            Assert.AreEqual(new Financial.Amount("usd", .0M), charge.AmountCaptured);

            var captureAmount = new Financial.Amount("usd", 10.00M);
            charge.Capture(null, amount: captureAmount);

            Assert.AreEqual(captureAmount, charge.AmountCaptured);
        }
Ejemplo n.º 3
0
 public static void ChargeCardLuhnErr(PaySession sess)
 {
     var ta = sess.Charge(null, FakePaySystemHost.CARD_LUHN_ERR, Account.EmptyInstance,
       new NFX.Financial.Amount("usd", 15.75M), true, "test payment");
 }
Ejemplo n.º 4
0
        public static void TransferToCard(PaySession sess)
        {
            var transferTA = sess.Transfer(null, Account.EmptyInstance, FakePaySystemHost.CARD_DEBIT_ACCOUNT_STRIPE_CORRECT,
            new NFX.Financial.Amount("usd", 27.00M));

              Assert.IsNotNull(transferTA);
        }
Ejemplo n.º 5
0
        public static void RefundFullTwoParts(PaySession sess)
        {
            var charge = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance,
              new NFX.Financial.Amount("usd", 20.00M), true, "Refund Full Explicit Charge");

            FakePaySystemHost.Instance.SaveTransaction(charge);

            var refund1 = charge.Refund(null, new NFX.Financial.Amount("usd", 15.00M), "fraudulent");

            Assert.IsNotNull(refund1);
            Assert.AreEqual(charge.ID, refund1.ParentTransactionID);

            FakePaySystemHost.Instance.SaveTransaction(refund1);

            var refund2 = charge.Refund(null, new NFX.Financial.Amount("usd", 5.00M), "requested_by_customer");

            Assert.IsNotNull(refund2);
            Assert.AreEqual(refund2.ParentTransactionID, charge.ID);
        }
Ejemplo n.º 6
0
        public static void RefundFullExplicit(PaySession sess)
        {
            var charge = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance,
              new NFX.Financial.Amount("usd", 20.00M), true, "Refund Full Explicit Charge");

            FakePaySystemHost.Instance.SaveTransaction(charge);

            var refundTA = charge.Refund(null, new NFX.Financial.Amount("usd", 20.00M));

            Assert.IsNotNull(refundTA);
        }
Ejemplo n.º 7
0
        public static void ChargeWithBillingAddressInfo(PaySession sess)
        {
            Assert.IsNotNull(sess);

            var ta = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT_WITH_ADDRESS, Account.EmptyInstance,
              new NFX.Financial.Amount("usd", 15.75M), true, "test payment");

            Assert.IsNotNull(ta);
        }
Ejemplo n.º 8
0
 public abstract Transaction Refund(PaySession session, ITransactionContext context, ref Transaction charge, Amount?amount = null, string description = null, object extraData = null);
Ejemplo n.º 9
0
 protected internal abstract Transaction DoFetchTransaction(PaySession session, object id);
Ejemplo n.º 10
0
 protected internal abstract object DoGenerateTransactionID(PaySession session, TransactionType type);
Ejemplo n.º 11
0
 public override object GenerateTransactionID(PaySession callerSession, ITransactionContext context, TransactionType type)
 {
     return 0;
 }
Ejemplo n.º 12
0
 protected internal abstract bool DoRefund(PaySession session, Transaction charge, decimal?amount   = null, string description = null, object extraData = null);
Ejemplo n.º 13
0
 protected internal abstract bool DoVoid(PaySession session, Transaction charge, string description = null, object extraData   = null);
Ejemplo n.º 14
0
 protected internal abstract Transaction DoCharge(PaySession session, Account from, Account to, Amount amount, bool capture         = true, string description = null, object extraData = null);
Ejemplo n.º 15
0
 protected internal abstract Transaction DoTransfer(PaySession session, Account from, Account to, Amount amount, string description = null, object extraData   = null);
Ejemplo n.º 16
0
 protected internal virtual bool DoRefresh(PaySession session, Transaction transaction, object extraData = null)
 {
     return(false);
 }
Ejemplo n.º 17
0
 public abstract Transaction Charge(PaySession session, ITransactionContext context, Account from, Account to, Amount amount, bool capture = true, string description = null, object extraData = null);
Ejemplo n.º 18
0
 protected internal abstract IActualAccountData DoFetchAccountData(PaySession session, Account account);
Ejemplo n.º 19
0
 public abstract Transaction Transfer(PaySession session, ITransactionContext context, Account from, Account to, Amount amount, string description = null, object extraData = null);
Ejemplo n.º 20
0
 protected internal abstract void DoStoreTransaction(PaySession session, Transaction tran);
Ejemplo n.º 21
0
        public static void RefundDifferentCurrency(PaySession sess)
        {
            var chargeTA = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance,
              new NFX.Financial.Amount("usd", 20.00M), true, "Refund Full Explicit Charge");

            var refundTA = chargeTA.Refund(null, new NFX.Financial.Amount("eur", 15.00M), "duplicate");
        }
Ejemplo n.º 22
0
 protected internal abstract void DoStoreAccountData(PaySession session, IActualAccountData accoundData);
Ejemplo n.º 23
0
        public static void RefundFullImplicit(PaySession sess)
        {
            var amountToRefund = new NFX.Financial.Amount("usd", 17.25M);

            var charge = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance, amountToRefund, true, "test payment");

            Assert.AreEqual(new NFX.Financial.Amount("usd", .0M), charge.AmountRefunded);

            FakePaySystemHost.Instance.SaveTransaction(charge);

            var refund = charge.Refund(null);

            Assert.AreEqual(amountToRefund, charge.AmountRefunded);
            Assert.AreEqual(charge.ID, refund.ParentTransactionID);
        }
Ejemplo n.º 24
0
        public static void ChargeCommon(PaySession sess)
        {
            Assert.IsNotNull(sess);

            var ta = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance,
              new Financial.Amount("usd", 15.75M), true, "test payment");

            Assert.IsNotNull(ta);
        }
Ejemplo n.º 25
0
        public static void TransferToBank(PaySession sess)
        {
            var transferTA = sess.Transfer(null, Account.EmptyInstance, FakePaySystemHost.BANK_ACCOUNT_STRIPE_CORRECT, new NFX.Financial.Amount("usd", 183.90M));

            Assert.IsNotNull(transferTA);
        }
Ejemplo n.º 26
0
 public static void ChargeCardExpYearErr(PaySession sess)
 {
     var ta = sess.Charge(null, FakePaySystemHost.CARD_EXP_YEAR_ERR, Account.EmptyInstance,
       new Financial.Amount("usd", 15.75M), true, "test payment");
 }
Ejemplo n.º 27
0
        public static void TransferToCardWithBillingAddressInfo(PaySession sess)
        {
            var transferTA = sess.Transfer(null, Account.EmptyInstance, FakePaySystemHost.CARD_DEBIT_ACCOUNT_STRIPE_CORRECT_WITH_ADDRESS,
              new NFX.Financial.Amount("usd", 55.00M));

            Assert.IsNotNull(transferTA);
        }
Ejemplo n.º 28
0
 public abstract object GenerateTransactionID(PaySession callerSession, ITransactionContext context, TransactionType type);
Ejemplo n.º 29
0
 public static void ChargeCardDeclined(PaySession sess)
 {
     var ta = sess.Charge(null, FakePaySystemHost.CARD_DECLINED, Account.EmptyInstance,
       new NFX.Financial.Amount("usd", 15.75M), true, "test payment");
 }
Ejemplo n.º 30
0
 public abstract PaymentException VerifyPotentialTransaction(PaySession session, ITransactionContext context, bool transfer, IActualAccountData from, IActualAccountData to, Amount amount);
Ejemplo n.º 31
0
 public object GenerateTransactionID(PaySession callerSession, ITransactionContext context, TransactionType type)
 {
   return generateUniqueID();
 }
Ejemplo n.º 32
0
 protected internal virtual PaymentException DoVerifyPotentialTransaction(PaySession session, TransactionType type, Account from, Account to, Amount amount)
 {
     return(null);
 }