コード例 #1
0
        public void Test_CreateSettlementTransfer()
        {
            DisputeDTO dispute = _clientDisputes.FirstOrDefault(x => x.Status == DisputeStatus.CLOSED && x.DisputeType == DisputeType.NOT_CONTESTABLE);

            RepudiationDTO repudiation = null;
            SettlementDTO  result      = null;

            if (dispute == null)
            {
                Assert.Fail("Cannot test creating settlement transfer because there's no closed disputes in the disputes list.");
            }

            try
            {
                string repudiationId = Api.Disputes.GetTransactions(dispute.Id, new Pagination(1, 1), null)[0].Id;

                repudiation = Api.Disputes.GetRepudiation(repudiationId);

                SettlementTransferPostDTO post = new SettlementTransferPostDTO(repudiation.AuthorId, new Money {
                    Currency = CurrencyIso.EUR, Amount = 1
                }, new Money {
                    Currency = CurrencyIso.EUR, Amount = 0
                });

                result = Api.Disputes.CreateSettlementTransfer(post, repudiationId);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }

            Assert.IsNotNull(result);
        }
コード例 #2
0
        public async Task Test_GetRepudiation()
        {
            DisputeDTO dispute = _clientDisputes.FirstOrDefault(x => x.InitialTransactionId != null && x.DisputeType.HasValue && x.DisputeType.Value == DisputeType.NOT_CONTESTABLE);

            RepudiationDTO result = null;

            if (dispute == null)
            {
                Assert.Fail("Cannot test getting repudiation because there's no not contestable disputes with transaction ID in the disputes list.");
            }

            try
            {
                var temp = await Api.Disputes.GetTransactions(dispute.Id, new Pagination(1, 1), null);

                string repudiationId = temp[0].Id;

                result = await Api.Disputes.GetRepudiation(repudiationId);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }

            Assert.IsNotNull(result);
        }
コード例 #3
0
        public async Task Test_GetSettlementTransfer()
        {
            DisputeDTO dispute = _clientDisputes.FirstOrDefault(x => x.Status == DisputeStatus.CLOSED && x.DisputeType.HasValue && x.DisputeType.Value == DisputeType.NOT_CONTESTABLE);

            RepudiationDTO repudiation = null;
            SettlementDTO  transfer    = null;

            if (dispute == null)
            {
                Assert.Fail("Cannot test getting settlement transfer because there's no closed and not contestable disputes in the disputes list.");
            }

            try
            {
                var temp = await Api.Disputes.GetTransactions(dispute.Id, new Pagination(1, 1), null);

                string repudiationId = temp[0].Id;

                repudiation = await Api.Disputes.GetRepudiation(repudiationId);

                SettlementTransferPostDTO post = new SettlementTransferPostDTO(repudiation.AuthorId, new Money {
                    Currency = CurrencyIso.EUR, Amount = 1
                }, new Money {
                    Currency = CurrencyIso.EUR, Amount = 0
                });

                transfer = await Api.Disputes.CreateSettlementTransfer(post, repudiationId);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }

            Assert.IsNotNull(transfer);


            SettlementDTO result = null;

            try
            {
                result = await Api.Disputes.GetSettlementTransfer(transfer.Id);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }

            Assert.IsNotNull(result);
            Assert.IsInstanceOf <SettlementDTO>(result);
            Assert.IsNotNull(result.RepudiationId);
            Assert.AreEqual(result.RepudiationId, repudiation.Id);
        }