public void Test_SubmitDisputeDocument() { DisputeDTO dispute = null; DisputeDocumentDTO disputeDocument = null; FilterDisputeDocuments filter = new FilterDisputeDocuments(); filter.Status = DisputeDocumentStatus.CREATED; // search for dispute having any documents created foreach (DisputeDTO d in _clientDisputes.Where(x => x.Status == DisputeStatus.PENDING_CLIENT_ACTION || x.Status == DisputeStatus.REOPENED_PENDING_CLIENT_ACTION)) { DisputeDocumentDTO dd = Api.Disputes.GetDocumentsForDispute(d.Id, new Pagination(1, 1), filter).FirstOrDefault(); if (dd != null) { // found dispute = d; disputeDocument = dd; break; } } if (dispute == null) { dispute = _clientDisputes.FirstOrDefault(x => x.Status == DisputeStatus.PENDING_CLIENT_ACTION || x.Status == DisputeStatus.REOPENED_PENDING_CLIENT_ACTION); if (dispute == null) { Assert.Fail("Cannot test submitting dispute's documents because there's no dispute with expected status in the disputes list."); } DisputeDocumentPostDTO documentPost = new DisputeDocumentPostDTO(DisputeDocumentType.DELIVERY_PROOF); disputeDocument = Api.Disputes.CreateDisputeDocument(documentPost, dispute.Id); } DisputeDocumentDTO result = null; try { if (disputeDocument == null) { Assert.Fail("Cannot test submitting dispute's documents because there's no dispute document that can be updated."); } DisputeDocumentPutDTO disputeDocumentPut = new DisputeDocumentPutDTO { Status = DisputeDocumentStatus.VALIDATION_ASKED }; result = Api.Disputes.SubmitDisputeDocument(disputeDocumentPut, dispute.Id, disputeDocument.Id); } catch (Exception ex) { Assert.Fail(ex.Message); } Assert.IsNotNull(result); Assert.IsTrue(disputeDocument.Type == result.Type); Assert.IsTrue(result.Status == DisputeDocumentStatus.VALIDATION_ASKED); }
/// <summary>Gets dispute's documents for client.</summary> /// <param name="pagination">Pagination.</param> /// <param name="filters">Filters.</param> /// <param name="sort">Sort.</param> /// <returns>List of dispute documents returned from API.</returns> public ListPaginated <DisputeDocumentDTO> GetDocumentsForClient(Pagination pagination, FilterDisputeDocuments filters, Sort sort = null) { if (filters == null) { filters = new FilterDisputeDocuments(); } return(this.GetList <DisputeDocumentDTO>(MethodKey.DisputesDocumentGetForClient, pagination, null, sort, filters.GetValues())); }
/// <summary>Gets documents for dispute.</summary> /// <param name="disputeId">Dispute identifier.</param> /// <param name="pagination">Pagination.</param> /// <param name="filters">Filters.</param> /// <param name="sort">Sort.</param> /// <returns>List of DisputeDocument instances returned from API.</returns> public ListPaginated <DisputeDocumentDTO> GetDocumentsForDispute(String disputeId, Pagination pagination, FilterDisputeDocuments filters, Sort sort = null) { if (filters == null) { filters = new FilterDisputeDocuments(); } return(this.GetList <DisputeDocumentDTO>(MethodKey.DisputesDocumentGetForDispute, pagination, sort, filters.GetValues(), disputeId)); }
/// <summary>Gets dispute's documents for client.</summary> /// <param name="pagination">Pagination.</param> /// <param name="filters">Filters.</param> /// <param name="sort">Sort.</param> /// <returns>List of dispute documents returned from API.</returns> public async Task <ListPaginated <DisputeDocumentDTO> > GetDocumentsForClientAsync(Pagination pagination, FilterDisputeDocuments filters, Sort sort = null) { if (filters == null) { filters = new FilterDisputeDocuments(); } return(await this.GetListAsync <DisputeDocumentDTO>(MethodKey.DisputesDocumentGetForClient, pagination, sort, filters.GetValues())); }
/// <summary>Gets documents for dispute.</summary> /// <param name="disputeId">Dispute identifier.</param> /// <param name="pagination">Pagination.</param> /// <param name="filters">Filters.</param> /// <param name="sort">Sort.</param> /// <returns>List of DisputeDocument instances returned from API.</returns> public ListPaginated<DisputeDocumentDTO> GetDocumentsForDispute(String disputeId, Pagination pagination, FilterDisputeDocuments filters, Sort sort = null) { if (filters == null) filters = new FilterDisputeDocuments(); return this.GetList<DisputeDocumentDTO>(MethodKey.DisputesDocumentGetForDispute, pagination, disputeId, sort, filters.GetValues()); }