示例#1
0
        public void RefundReceiptAddAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the RefundReceipt for Add
            RefundReceipt entity = QBOHelper.CreateRefundReceipt(qboContextoAuth);

            RefundReceipt added = Helper.AddAsync <RefundReceipt>(qboContextoAuth, entity);
        }
示例#2
0
 public void RefundReceiptAddTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the RefundReceipt for Add
     RefundReceipt refundReceipt = QBOHelper.CreateRefundReceipt(qboContextoAuth);
     //Adding the RefundReceipt
     RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, refundReceipt);
 }
示例#3
0
        public void RefundReceiptDeleteAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the RefundReceipt for Adding
            RefundReceipt entity = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, entity);

            Helper.DeleteAsync <RefundReceipt>(qboContextoAuth, added);
        }
        public void RefundReceiptQueryUsingoAuth()
        {
            QueryService <RefundReceipt> entityQuery = new QueryService <RefundReceipt>(qboContextoAuth);
            RefundReceipt existing = Helper.FindOrAdd <RefundReceipt>(qboContextoAuth, new RefundReceipt());
            //List<RefundReceipt> entities = entityQuery.Where(c => c.Id == existing.Id).ToList();
            List <RefundReceipt> entities = entityQuery.ExecuteIdsQuery("SELECT * FROM RefundReceipt where Id='" + existing.Id + "'").ToList <RefundReceipt>();

            Assert.IsTrue(entities.Count() > 0);
        }
示例#5
0
        public void RefundReceiptFindByIdAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the RefundReceipt for Adding
            RefundReceipt entity = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, entity);

            //FindById and verify
            Helper.FindByIdAsync <RefundReceipt>(qboContextoAuth, added);
        }
        public void RefundReceiptFindbyIdTestUsingoAuth()
        {
            //Creating the RefundReceipt for Adding
            RefundReceipt refundReceipt = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, refundReceipt);
            RefundReceipt found = Helper.FindById <RefundReceipt>(qboContextoAuth, added);

            QBOHelper.VerifyRefundReceipt(found, added);
        }
        public void RefundReceiptAddTestUsingoAuth()
        {
            //Creating the RefundReceipt for Add
            RefundReceipt refundReceipt = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, refundReceipt);

            //Verify the added RefundReceipt
            QBOHelper.VerifyRefundReceipt(refundReceipt, added);
        }
示例#8
0
 public void RefundReceiptSparseUpdateTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the RefundReceipt for Adding
     RefundReceipt refundReceipt = QBOHelper.CreateRefundReceipt(qboContextoAuth);
     //Adding the RefundReceipt
     RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, refundReceipt);
     //Change the data of added entity
     RefundReceipt changed = QBOHelper.UpdateRefundReceiptSparse(qboContextoAuth, added.Id, added.SyncToken);
     //Update the returned entity data
     RefundReceipt updated = Helper.Update <RefundReceipt>(qboContextoAuth, changed);//Verify the updated RefundReceipt
 }
示例#9
0
        public void RefundReceiptUpdatedAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the RefundReceipt for Adding
            RefundReceipt entity = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, entity);

            //Update the RefundReceipt
            RefundReceipt updated = QBOHelper.UpdateRefundReceipt(qboContextoAuth, added);
            //Call the service
            RefundReceipt updatedReturned = Helper.UpdateAsync <RefundReceipt>(qboContextoAuth, updated);
        }
        public void RefundReceiptUpdateTestUsingoAuth()
        {
            //Creating the RefundReceipt for Adding
            RefundReceipt refundReceipt = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, refundReceipt);
            //Change the data of added entity
            RefundReceipt changed = QBOHelper.UpdateRefundReceipt(qboContextoAuth, added);
            //Update the returned entity data
            RefundReceipt updated = Helper.Update <RefundReceipt>(qboContextoAuth, changed);//Verify the updated RefundReceipt

            QBOHelper.VerifyRefundReceipt(changed, updated);
        }
示例#11
0
        RefundReceipt IPurchasesCommand.RefundOrder(Guid orderId, string externalTransactionId)
        {
            // Find it.

            var receipt = new RefundReceipt
            {
                Id   = Guid.NewGuid(),
                Time = DateTime.Now,
                ExternalTransactionId   = Guid.NewGuid().ToString(),
                ExternalTransactionTime = DateTime.Now,
            };

            return(receipt);
        }
示例#12
0
        public void RefundReceiptBatchUsingoAuth(ServiceContext qboContextoAuth)
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

            RefundReceipt existing = Helper.FindOrAdd(qboContextoAuth, new RefundReceipt());

            batchEntries.Add(OperationEnum.create, QBOHelper.CreateRefundReceipt(qboContextoAuth));

            batchEntries.Add(OperationEnum.update, QBOHelper.UpdateRefundReceipt(qboContextoAuth, existing));

            batchEntries.Add(OperationEnum.query, "select * from RefundReceipt");

            batchEntries.Add(OperationEnum.delete, existing);

            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.Batch <RefundReceipt>(qboContextoAuth, batchEntries);
        }
示例#13
0
        public void RefundReceiptDeleteTestUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the RefundReceipt for Adding
            RefundReceipt refundReceipt = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, refundReceipt);

            //Delete the returned entity
            try
            {
                RefundReceipt deleted = Helper.Delete <RefundReceipt>(qboContextoAuth, added);
            }
            catch (IdsException ex)
            {
            }
        }
        public void RefundReceiptDeleteTestUsingoAuth()
        {
            //Creating the RefundReceipt for Adding
            RefundReceipt refundReceipt = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the RefundReceipt
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, refundReceipt);

            //Delete the returned entity
            try
            {
                RefundReceipt deleted = Helper.Delete <RefundReceipt>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Deleted, deleted.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
        public void RefundReceiptVoidTestUsingoAuth()
        {
            //Creating the entity for Adding
            RefundReceipt entity = QBOHelper.CreateRefundReceipt(qboContextoAuth);
            //Adding the entity
            RefundReceipt added = Helper.Add <RefundReceipt>(qboContextoAuth, entity);

            //Void the returned entity
            try
            {
                RefundReceipt voided = Helper.Void <RefundReceipt>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Voided, voided.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
        public void RefundReceiptBatchUsingoAuth()
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

            RefundReceipt existing = Helper.FindOrAdd(qboContextoAuth, new RefundReceipt());

            batchEntries.Add(OperationEnum.create, QBOHelper.CreateRefundReceipt(qboContextoAuth));

            batchEntries.Add(OperationEnum.update, QBOHelper.UpdateRefundReceipt(qboContextoAuth, existing));

            batchEntries.Add(OperationEnum.query, "select * from RefundReceipt");

            batchEntries.Add(OperationEnum.delete, existing);

            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.BatchTest <RefundReceipt>(qboContextoAuth, batchEntries);

            int position = 0;

            foreach (IntuitBatchResponse resp in batchResponses)
            {
                if (resp.ResponseType == ResponseType.Exception)
                {
                    Assert.Fail(resp.Exception.ToString());
                }

                if (resp.ResponseType == ResponseType.Entity)
                {
                    Assert.IsFalse(string.IsNullOrEmpty((resp.Entity as RefundReceipt).Id));
                }
                else if (resp.ResponseType == ResponseType.Query)
                {
                    Assert.IsTrue(resp.Entities != null && resp.Entities.Count > 0);
                }
                else if (resp.ResponseType == ResponseType.CdcQuery)
                {
                    Assert.IsTrue(resp.CDCResponse != null && resp.CDCResponse.entities != null && resp.CDCResponse.entities.Count > 0);
                }

                position++;
            }
        }
示例#17
0
 public void RefundReceiptQueryUsingoAuth(ServiceContext qboContextoAuth)
 {
     QueryService <RefundReceipt> entityQuery = new QueryService <RefundReceipt>(qboContextoAuth);
     RefundReceipt        existing            = Helper.FindOrAdd <RefundReceipt>(qboContextoAuth, new RefundReceipt());
     List <RefundReceipt> test = entityQuery.ExecuteIdsQuery("SELECT * FROM RefundReceipt where Id='" + existing.Id + "'").ToList <RefundReceipt>();
 }
示例#18
0
 public OrderRefundedEventArgs(Order order, RefundReceipt receipt)
 {
     Order   = order;
     Receipt = receipt;
 }