Exemplo n.º 1
0
        public static Payment CreateSingle (Organization organization, DateTime dateTime, Currency currency, Int64 amountCents, OutboundInvoice invoice, Person createdByPerson)
        {
            // TODO: Verify that invoice is not already closed; if so, issue refund

            // TODO: Verify correct amount

            invoice.SetPaid();

            PaymentGroup group = PaymentGroup.Create(organization, dateTime, currency, createdByPerson);
            Payment newPayment = FromIdentity(SwarmDb.GetDatabaseForWriting().CreatePayment(group.Identity, amountCents, string.Empty, string.Empty, string.Empty, false,
                                                 invoice.Identity));
            group.AmountCents = amountCents;

            return newPayment;
        }
Exemplo n.º 2
0
        public static Payment CreateSingle(Organization organization, DateTime dateTime, Currency currency, Int64 amountCents, OutboundInvoice invoice, Person createdByPerson)
        {
            // TODO: Verify that invoice is not already closed; if so, issue refund

            // TODO: Verify correct amount

            invoice.SetPaid();

            PaymentGroup group      = PaymentGroup.Create(organization, dateTime, currency, createdByPerson);
            Payment      newPayment = FromIdentity(SwarmDb.GetDatabaseForWriting().CreatePayment(group.Identity, amountCents, string.Empty, string.Empty, string.Empty, false,
                                                                                                 invoice.Identity));

            group.AmountCents = amountCents;

            return(newPayment);
        }