Пример #1
0
        public void TestCharge()
        {
            StripeToken token    = CreateTestToken();
            string      chargeId = StripeManager.Charge(token.Id, 78.90f, "Test naked charge");

            Assert.IsNotNull(chargeId);
        }
Пример #2
0
        public void TestChargeWithCustomer()
        {
            // Arrange
            ICustomerEntity customer = CreateMockCustomer();
            IChargeEntity   charge   = CreateMockCharge();

            StripeToken token = CreateTestToken(customer);

            StripeManager.CreateCustomer(customer, token.Id);

            // Act - charge customer
            string chargeId = StripeManager.Charge(customer, charge);

            Assert.IsNotNull(chargeId);

            chargeId = StripeManager.Charge(customer, 12.34f, "Test charge with customer");
            Assert.IsNotNull(chargeId);
        }