Exemple #1
0
        public void Should_Retrieve_Sub_Merchant()
        {
            string subMerchantExternalId = RandomGenerator.RandomId;
            CreateSubMerchantRequest createLimitedCompanySubMerchantRequest = CreateSubMerchantRequestBuilder.Create()
                                                                              .LimitedCompanySubMerchantRequest()
                                                                              .SubMerchantExternalId(subMerchantExternalId)
                                                                              .Build();

            SubMerchant.Create(createLimitedCompanySubMerchantRequest, _options);

            RetrieveSubMerchantRequest request = RetrieveSubMerchantRequestBuilder.Create()
                                                 .SubMerchantExternalId(subMerchantExternalId)
                                                 .Build();

            SubMerchant subMerchant = SubMerchant.Retrieve(request, _options);

            PrintResponse(subMerchant);

            Assert.AreEqual(Status.SUCCESS.ToString(), subMerchant.Status);
            Assert.AreEqual(Locale.TR.ToString(), subMerchant.Locale);
            Assert.AreEqual("123456789", subMerchant.ConversationId);
            Assert.AreEqual("9261877", subMerchant.TaxNumber);
            Assert.AreEqual("TR180006200119000006672315", subMerchant.Iban);
            Assert.AreEqual("Tax office", subMerchant.TaxOffice);
            Assert.AreEqual(subMerchantExternalId, subMerchant.SubMerchantExternalId);
            Assert.NotNull(subMerchant.SystemTime);
            Assert.Null(subMerchant.ErrorCode);
            Assert.Null(subMerchant.ErrorMessage);
            Assert.Null(subMerchant.ErrorGroup);
        }
        public void Should_Retrieve_Sub_Merchant()
        {
            RetrieveSubMerchantRequest request = new RetrieveSubMerchantRequest();

            request.ConversationId        = "123456789";
            request.Locale                = Locale.TR.GetName();
            request.SubMerchantExternalId = "AS49224";

            SubMerchant subMerchant = SubMerchant.Retrieve(request, options);

            PrintResponse <SubMerchant>(subMerchant);

            Assert.IsNotNull(subMerchant.SystemTime);
            Assert.AreEqual(Status.SUCCESS.ToString(), subMerchant.Status);
            Assert.AreEqual(Locale.TR.GetName(), subMerchant.Locale);
            Assert.AreEqual("123456789", subMerchant.ConversationId);
        }