public void Run()
        {
            var apiContext      = ApiContext.Restore();
            var paymentBatchMap = new Dictionary <string, object>
            {
                {
                    PaymentBatch.FIELD_PAYMENTS,
                    new List <object>
                    {
                        new Dictionary <string, object>
                        {
                            { Payment.FIELD_AMOUNT, new Amount(PAYMENT_AMOUNT, PAYMENT_CURRENCY) },
                            {
                                Payment.FIELD_COUNTERPARTY_ALIAS,
                                new Pointer(COUNTERPARTY_POINTER_TYPE, COUNTERPARTY_EMAIL)
                            },
                            { Payment.FIELD_DESCRIPTION, PAYMENT_DESCRIPTION }
                        }
                    }
                }
            };
            var allPayment = new List <Payment>();
            var payment    = new Payment
            {
                Amount            = new Amount(PAYMENT_AMOUNT, PAYMENT_CURRENCY),
                CounterpartyAlias =
                    new MonetaryAccountReference(new Pointer(COUNTERPARTY_POINTER_TYPE, COUNTERPARTY_EMAIL)),
                Description = PAYMENT_DESCRIPTION
            };

            var paymentBatchId = PaymentBatch.Create(allPayment).Value;

            Console.WriteLine(PaymentBatch.Get(paymentBatchId));
        }
Example #2
0
        private const int MONETARY_ACCOUNT_ITEM_ID = 0; // Put your monetary account ID here

        public void Run()
        {
            var apiContext      = ApiContext.Restore();
            var paymentBatchMap = new Dictionary <string, object>
            {
                {
                    PaymentBatch.FIELD_PAYMENTS,
                    new List <object>
                    {
                        new Dictionary <string, object>
                        {
                            { Payment.FIELD_AMOUNT, new Amount(PAYMENT_AMOUNT, PAYMENT_CURRENCY) },
                            {
                                Payment.FIELD_COUNTERPARTY_ALIAS,
                                new Pointer(COUNTERPARTY_POINTER_TYPE, COUNTERPARTY_EMAIL)
                            },
                            { Payment.FIELD_DESCRIPTION, PAYMENT_DESCRIPTION }
                        }
                    }
                }
            };

            var paymentBatchId = PaymentBatch.Create(apiContext, paymentBatchMap, USER_ITEM_ID,
                                                     MONETARY_ACCOUNT_ITEM_ID).Value;

            Console.WriteLine(PaymentBatch.Get(apiContext, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID, paymentBatchId));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            PaymentBatch paymentBatch = db.PaymentBatches.Find(id);

            db.PaymentBatches.Remove(paymentBatch);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
 public bool deletepaymentbatch(PaymentBatch paymentbatch)
 {
     if (paymentbatch != null)
     {
         _session.Transact(session => session.Delete(paymentbatch));
         return(true);
     }
     return(false);;
 }
Example #5
0
 public bool addPaymentBatch(PaymentBatch paymentbatch)
 {
     if (paymentbatch != null)
     {
         _session.Transact(session => session.SaveOrUpdate(paymentbatch));
         return(true);
     }
     return(false);;
 }
 public ActionResult Edit([Bind(Include = "Id,Title,Description,Note,status,datepaymentstarted,datepaymentcompleted,terminationdate,paidby,createdBy,Guid,CreatedOn,UpdatedOn,IsDeleted,SiteId,terminatedby")] PaymentBatch paymentBatch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(paymentBatch).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(paymentBatch));
 }
        // GET: PaymentBatches/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PaymentBatch paymentBatch = db.PaymentBatches.Find(id);

            if (paymentBatch == null)
            {
                return(HttpNotFound());
            }
            return(View(paymentBatch));
        }