Example #1
0
        public void Should_Update_Personal_Sub_Merchant()
        {
            CreateSubMerchantRequest createPersonalSubMerchantRequest = CreateSubMerchantRequestBuilder.Create()
                                                                        .PersonalSubMerchantRequest()
                                                                        .Build();

            string subMerchantKey = SubMerchant.Create(createPersonalSubMerchantRequest, _options).SubMerchantKey;

            UpdateSubMerchantRequest updateSubMerchantRequest = UpdateSubMerchantRequestBuilder.Create()
                                                                .SubMerchantKey(subMerchantKey)
                                                                .ContactName("Jane")
                                                                .ContactSurname("Doe")
                                                                .IdentityNumber("31300864726")
                                                                .Name("Jane's market")
                                                                .Build();

            SubMerchant subMerchant = SubMerchant.Update(updateSubMerchantRequest, _options);

            PrintResponse(subMerchant);

            Assert.AreEqual(Status.SUCCESS.ToString(), subMerchant.Status);
            Assert.AreEqual(Locale.TR.ToString(), subMerchant.Locale);
            Assert.AreEqual("123456789", subMerchant.ConversationId);
            Assert.NotNull(subMerchant.SystemTime);
            Assert.Null(subMerchant.ErrorCode);
            Assert.Null(subMerchant.ErrorMessage);
            Assert.Null(subMerchant.ErrorGroup);
        }
Example #2
0
        public async Task Should_Update_Limited_Company_Sub_Merchant()
        {
            CreateSubMerchantRequest createLimitedCompanySubMerchantRequest = CreateSubMerchantRequestBuilder.Create()
                                                                              .LimitedCompanySubMerchantRequest()
                                                                              .Build();

            var merchant = await SubMerchant.CreateAsync(createLimitedCompanySubMerchantRequest, Options);

            string subMerchantKey = merchant.SubMerchantKey;

            UpdateSubMerchantRequest updateSubMerchantRequest = UpdateSubMerchantRequestBuilder.Create()
                                                                .SubMerchantKey(subMerchantKey)
                                                                .Name("Jane's market")
                                                                .IdentityNumber("31300864726")
                                                                .TaxOffice("Tax office")
                                                                .LegalCompanyTitle("ABC inc")
                                                                .Build();

            SubMerchant subMerchant = await SubMerchant.UpdateAsync(updateSubMerchantRequest, Options);

            PrintResponse(subMerchant);

            Assert.AreEqual(Status.SUCCESS.ToString(), subMerchant.Status);
            Assert.AreEqual(Locale.TR.ToString(), subMerchant.Locale);
            Assert.AreEqual("123456789", subMerchant.ConversationId);
            Assert.NotNull(subMerchant.SystemTime);
            Assert.Null(subMerchant.ErrorCode);
            Assert.Null(subMerchant.ErrorMessage);
            Assert.Null(subMerchant.ErrorGroup);
        }
Example #3
0
        public void Should_Update_Private_Sub_Merchant()
        {
            CreateSubMerchantRequest createPrivateSubMerchantRequest = CreateSubMerchantRequestBuilder.Create()
                                                                       .PrivateSubMerchantRequest()
                                                                       .Build();

            string subMerchantKey = SubMerchant.Create(createPrivateSubMerchantRequest, _options).SubMerchantKey;

            UpdateSubMerchantRequest updateSubMerchantRequest = UpdateSubMerchantRequestBuilder.Create()
                                                                .SubMerchantKey(subMerchantKey)
                                                                .IdentityNumber("31300864726")
                                                                .TaxOffice("Tax office")
                                                                .LegalCompanyTitle("Jane Doe inc")
                                                                .Build();

            SubMerchant subMerchant = SubMerchant.Update(updateSubMerchantRequest, _options);

            PrintResponse(subMerchant);

            Assert.AreEqual(Status.SUCCESS.ToString(), subMerchant.Status);
            Assert.AreEqual(Locale.TR.ToString(), subMerchant.Locale);
            Assert.AreEqual("123456789", subMerchant.ConversationId);
            Assert.NotNull(subMerchant.SystemTime);
            Assert.Null(subMerchant.ErrorCode);
            Assert.Null(subMerchant.ErrorMessage);
            Assert.Null(subMerchant.ErrorGroup);
        }