Exemple #1
0
        public void FetchDirectDebitShouldBeSuccessful()
        {
            var response1 = DirectDebit.Create("012-084", "123123123", "Max Smith", 123.00m, Guid.NewGuid().ToString(), "DotNet DE", DateTime.Today);
            var response2 = DirectDebit.Find(response1.Result.ID);

            Assert.IsNotNull(response2);
            Assert.AreEqual(response1.Result.AccountName, response2.AccountName);
        }
Exemple #2
0
        public void NewDirectDebitShouldBeSuccessful()
        {
            var response = DirectDebit.Create("012-084", "123123123", "Max Smith", 123.00m, Guid.NewGuid().ToString(), "DotNet DE", DateTime.Today);

            Assert.IsTrue(response.Successful);
            Assert.IsTrue(response.Result.Successful);
            Assert.IsNotNull(((DirectDebit)response.Result).ID);

            Assert.AreEqual(((DirectDebit)response.Result).BSB, "012-084");
            Assert.IsTrue(((DirectDebit)response.Result).ID.Contains("-DD-"));
        }
        protected override void PopulateControl()
        {
            base.PopulateControl();

            this.InvAddress.DataSource     = this.DataSource.InvAddress;
            this.InvAddress.OrganisationId = this.DataSource.InvOrganisationId;
            this.InvAddress.PersonId       = this.DataSource.InvoiceRole.PersonId;

            if (this.DataSource.DirectDebits.Count > 0)
            {
                DirectDebit directDebit = this.DataSource.DirectDebits.OfType <DirectDebit>().LastOrDefault();
                if (directDebit != null && directDebit.Status != null)
                {
                    this.DDStatus.FieldValue = GetDDStatusString(directDebit.Status.Value);
                }
                else
                {
                    this.DDStatus.Visible = false;
                }
            }
            else
            {
                this.DDStatus.Visible = false;
            }

            int nonInvoicedCount = 0;

            foreach (MemberLocation loc in this.DataSource.MemberLocations)
            {
                if (loc.SyType >= 0 && loc.SyType < 5 && loc.Invoiced == 0)
                {
                    nonInvoicedCount++;
                }
            }

            this.Invoiced.FieldValue = nonInvoicedCount == 0;
        }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="directDebit"></param>
 /// <param name="creditBankingAccount"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 /// <exception cref="Exceptions.FinTsApiException">Thrown when an API call fails.</exception>
 public async Task DirectDebitAsync(DirectDebit directDebit, IBankingAccount creditBankingAccount, CancellationToken cancellationToken = default)
 {
     await ExWrapAsync(async() => await _apiClient.DoDirectDebit(directDebit.BankingAccount, directDebit.SepaDirectDebitMandate, creditBankingAccount, this._tanRequestHandler, cancellationToken));
 }
Exemple #5
0
        public void DeleteDirectDebitShouldBeSuccessful()
        {
            var response1 = DirectDebit.Create("012-084", "123123123", "Max Smith", 123.00m, Guid.NewGuid().ToString(), "DotNet DE", DateTime.Today);

            Assert.IsTrue(response1.Result.Delete());
        }
Exemple #6
0
        public override bool payScheduled(DateTime pPayOnDate)
        {
            LogRequest("payScheduled", "start");
            Errors.Clear();
            if ((bool) PaymentData["is3DS"])
            {
            }

            var DB = new DataClassesDataContext();
            Payment CurrentPayment = Payment.GetByID(DB, (int) PaymentData["PaymentID"]);
            Invoice CurrentInvoice = Invoice.GetByID(DB, (int) PaymentData["InvoiceID"]);
            var directDebit = new DirectDebit
                                  {
                                      ddd_BillID = null,
                                      ddd_InvoiceID = CurrentInvoice.inv_ID,
                                      ddd_IsSingle = true,
                                      ddd_IsRecurring = false,
                                      ddd_IsNoExpiryDate = true,
                                      ddd_IsExpiryDate = false,
                                      ddd_ExpiryDate = null,
                                      ddd_IsNumberOfPayments = false,
                                      ddd_NumberOfPayments = 0,
                                      ddd_PaymentsCommited = 0,
                                      ddd_IsPayFullAmount = false,
                                      ddd_IsAmountLimited = false,
                                      ddd_AmountLimit = null,
                                      ddd_ScheduledPaymentAmount = CurrentPayment.pay_Amount,
                                      ddd_IsPayUponPresentment = false,
                                      ddd_IsPayOnLastDay = false,
                                      ddd_IsPayOnFirstDay = false,
                                      ddd_IsFixedDate = true,
                                      ddd_FixedDate = pPayOnDate,
                                      ddd_IsActive = true,
                                      ddd_TechnicalFailures = 0,
                                      ddd_NonTechnicalFailures = 0,
                                      ddd_DateCreated = DateTime.Now,
                                      ddd_CreditCardID = (int) CurrentPayment.pay_CreditCardID
                                  };

            directDebit.Add(DB);
            return Errors.Count == 0;
        }