Esempio n. 1
0
        public static void RefundFullExplicit(PaySession sess)
        {
            var charge = sess.Charge(FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance,
                                     new NFX.Financial.Amount("usd", 20.00M), true, "Refund Full Explicit Charge");

            sess.Refund(charge, 20.00M);
        }
Esempio n. 2
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");
        }
Esempio n. 3
0
        public static void RefundFullTwoParts(PaySession sess)
        {
            var charge = sess.Charge(FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance,
                                     new NFX.Financial.Amount("usd", 20.00M), true, "Refund Full Explicit Charge");

            sess.Refund(charge, 15.00M, "fraudulent");
            sess.Refund(charge, 5.00M, "requested_by_customer");
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        public static void ChargeCommon(PaySession sess)
        {
            Assert.IsNotNull(sess);

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

            Assert.IsNotNull(ta);
        }
Esempio 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);
        }
Esempio n. 7
0
        public static void CaptureImplicitTotal(PaySession sess)
        {
            var charge = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT,
                                     new Financial.Amount("usd", 17.25M), false, "test payment");

            Assert.IsFalse(charge.IsCaptured);

            charge.Capture(null);

            Assert.IsTrue(charge.IsCaptured);
        }
Esempio n. 8
0
        public static void CaptureExplicitTotal(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, amount);

            Assert.AreEqual(amount, charge.AmountCaptured);
        }
Esempio n. 9
0
        public static void RefundFullImplicit(PaySession sess)
        {
            var amountToRefund = new NFX.Financial.Amount("usd", 17.25M);

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

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

            sess.StoreTransaction(charge);

            sess.Refund(charge);

            Assert.AreEqual(amountToRefund, charge.AmountRefunded);
        }
Esempio n. 10
0
        public static void RefundFullImplicit(PaySession sess)
        {
            var charge = sess.Charge(null, FakePaySystemHost.CARD_ACCOUNT_STRIPE_CORRECT, Account.EmptyInstance,
                                     new Financial.Amount("usd", 17.25M), true, "test payment");

            Assert.IsFalse(charge.IsRefunded);

            FakePaySystemHost.Instance.SaveTransaction(charge);

            var refund = charge.Refund(null);

            Assert.IsTrue(charge.IsRefunded);
            Assert.AreEqual(charge.ID, refund.ParentTransactionID);
        }
Esempio n. 11
0
        public static void CapturePartial(PaySession sess)
        {
            var chargeAmount = new NFX.Financial.Amount("usd", 17.25M);

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

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

            var captureAmount = 10.00M;

            sess.Capture(charge, amount: captureAmount);

            Assert.AreEqual(captureAmount, charge.AmountCaptured);
        }
Esempio n. 12
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);
        }
Esempio n. 13
0
 public static void ChargeCardVCErr(PaySession sess)
 {
     var ta = sess.Charge(null, FakePaySystemHost.CARD_CVC_ERR, Account.EmptyInstance,
                          new NFX.Financial.Amount("usd", 15.75M), true, "test payment");
 }
Esempio n. 14
0
 public static void ChargeCardExpMonthErr(PaySession sess)
 {
     var ta = sess.Charge(FakePaySystemHost.CARD_EXP_MONTH_ERR, Account.EmptyInstance,
                          new NFX.Financial.Amount("usd", 15.75M), true, "test payment");
 }
Esempio n. 15
0
 public static void ChargeCardDeclined(PaySession sess)
 {
     var ta = sess.Charge(FakePaySystemHost.CARD_DECLINED, Account.EmptyInstance,
                          new NFX.Financial.Amount("usd", 15.75M), true, "test payment");
 }
Esempio n. 16
0
        private Transaction charge(PaySession pss, Account acc, Amount amount, bool capture, string descr)
        {
            var ta = pss.Charge(acc, Account.EmptyInstance, amount, capture, descr);

            return(ta);
        }