Beispiel #1
0
        public void Test_007b_CreditCharge_ScheduleIdWithCOF()
        {
            RecurringPaymentMethod paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod);

            Schedule schedule = Schedule.Find(PaymentId("Credit"));

            Assert.IsNotNull(schedule);

            Transaction response = paymentMethod.Charge(19m)
                                   .WithCurrency("USD")
                                   .WithScheduleId(schedule.Key)
                                   .WithAllowDuplicates(true)
                                   .WithOneTimePayment(false)
                                   .WithCardBrandStorage(StoredCredentialInitiator.CardHolder)
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
            Assert.IsNotNull(response.CardBrandTransactionId);

            Transaction nextResponse = paymentMethod.Charge(15m)
                                       .WithCurrency("USD")
                                       .WithScheduleId(schedule.Key)
                                       .WithAllowDuplicates(true)
                                       .WithOneTimePayment(false)
                                       .WithCardBrandStorage(StoredCredentialInitiator.Merchant, response.CardBrandTransactionId)
                                       .Execute();

            Assert.IsNotNull(nextResponse);
            Assert.AreEqual("00", nextResponse.ResponseCode);
        }
Beispiel #2
0
        public void Test_008e_DeletePaymentMethod()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("ACH"));

            Assert.IsNotNull(paymentMethod);
            paymentMethod.Delete();
        }
Beispiel #3
0
        public void Test_006b_GetPaymentMethod()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod);

            paymentMethod = RecurringService.Get <RecurringPaymentMethod>(paymentMethod.Key);
            Assert.IsNotNull(paymentMethod);
        }
Beispiel #4
0
        public void Test_004b_EditPaymentMethod()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod);

            paymentMethod.PreferredPayment = false;
            paymentMethod.SaveChanges();
        }
Beispiel #5
0
        public void Test_007e_CreditCharge_Declined()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod, "Payment method missing.");

            var response = paymentMethod.Charge(10.08m)
                           .WithCurrency("USD")
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("51", response.ResponseCode);
        }
Beispiel #6
0
        public void Test_007c_ACHCharge_OneTime()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("ACH"));

            Assert.IsNotNull(paymentMethod, "Payment method missing.");

            var response = paymentMethod.Charge(11m)
                           .WithCurrency("USD")
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode, response.ResponseMessage);
        }
Beispiel #7
0
        public void Test_007a_CreditCharge_OneTime()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod, "Payment method missing.");

            var response = paymentMethod.Charge(9m)
                           .WithCurrency("USD")
                           .WithShippingAmt(5m)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Beispiel #8
0
        public void Test_008g_CreditCharge_WithNewCryptoURL()
        {
            ServicesContainer.ConfigureService(new PorticoConfig {
                SecretApiKey = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A"
            });
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod);

            var response = paymentMethod.Charge(17.01m)
                           .WithCurrency("USD")
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("51", response.ResponseCode);
        }
Beispiel #9
0
        public void Test_001i_CreateSchedule_ACH()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("ACH"));

            Assert.IsNotNull(paymentMethod, "Payment method does not exist.");

            var schedule = paymentMethod.AddSchedule(PaymentId("ACH"))
                           .WithAmount(11m)
                           .WithStartDate(DateTime.Now.AddDays(7))
                           .WithFrequency(ScheduleFrequency.MONTHLY)
                           .WithStatus("Active")
                           .Create();

            Assert.IsNotNull(schedule);
            Assert.IsNotNull(schedule.Key);
        }
Beispiel #10
0
        public void Test_007d_ACHCharge_ScheduleId()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("ACH"));

            Assert.IsNotNull(paymentMethod, "Payment method missing.");

            var schedule = Schedule.Find(PaymentId("ACH"));

            Assert.IsNotNull(schedule, "Schedule is missing.");

            var response = paymentMethod.Charge(12m)
                           .WithCurrency("USD")
                           .WithScheduleId(schedule.Key)
                           .WithOneTimePayment(false)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Beispiel #11
0
        public void Test_001h_CreateSchedule_Credit()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod);

            var schedule = paymentMethod.AddSchedule(PaymentId("Credit"))
                           .WithAmount(30.02m)
                           .WithCurrency("USD")
                           .WithStartDate(DateTime.Parse("02/01/2027"))
                           .WithFrequency(ScheduleFrequency.WEEKLY)
                           .WithStatus("Active")
                           .WithReprocessingCount(2)
                           .WithEndDate(DateTime.Parse("04/01/2027"))
                           .Create();

            Assert.IsNotNull(schedule);
            Assert.IsNotNull(schedule.Key);
        }
Beispiel #12
0
        public void Test_002b_FindPaymentMethod()
        {
            var paymentMethod = RecurringPaymentMethod.Find(PaymentId("Credit"));

            Assert.IsNotNull(paymentMethod);
        }