public void Should_Cancel_Subscription() { // Initializee(); CancelSubscriptionRequest request = new CancelSubscriptionRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", SubscriptionReferenceCode = AktifAbonelikKodu }; IyzipayResourceV2 response = Subscription.Cancel(request, Contento_Resources_Helper.options); if (response.Status == "success") { Toast.MakeText(this, "Aboneliğiniz İptal Edildi.", ToastLength.Long).Show(); this.RunOnUiThread(delegate() { MevcutPaketHanze.Visibility = ViewStates.Gone; MevcutAlinmisPaket.Text = ""; }); } else { Toast.MakeText(this, "Bir sorun oluştu lütfen daha sonra tekrar deneyin", ToastLength.Long).Show(); } }
public void Should_Cancel_Subscription() { if (SonAbonelik.Count > 0) { // Initializee(); CancelSubscriptionRequest request = new CancelSubscriptionRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", SubscriptionReferenceCode = SonAbonelik[SonAbonelik.Count - 1].iyzicoReferanceCode }; IyzipayResourceV2 response = Subscription.Cancel(request, IyzicoHelperCla.options); if (response.Status == "success") { Toast.MakeText(this, "Aboneliğiniz İptal Edildi.", ToastLength.Long).Show(); this.RunOnUiThread(delegate() { IptalButton.Visibility = ViewStates.Gone; // OdemeMetoduText.Text = ""; }); } else { Toast.MakeText(this, "Bir sorun oluştu lütfen daha sonra tekrar deneyin", ToastLength.Long).Show(); } } }
public void Should_Delete_IyziLink() { IyziLinkSaveRequest request = new IyziLinkSaveRequest(); request.Locale = Locale.TR.ToString(); request.ConversationId = "123456789"; request.Name = "ft-name"; request.Description = "ft-description"; request.Base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8H8BwGwAF0QIs4BDpAAAAAABJRU5ErkJggg=="; request.Price = "1"; request.Currency = Currency.TRY.ToString(); request.AddressIgnorable = false; request.SoldLimit = 1; request.InstallmentRequested = false; string token = IyziLink.Create(request, _options).Data.Token; BaseRequestV2 requestV2 = new BaseRequestV2(); requestV2.Locale = Locale.TR.ToString(); requestV2.ConversationId = "123456789"; IyzipayResourceV2 response = IyziLink.Delete(token, requestV2, _options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.AreEqual(Locale.TR.ToString(), response.Locale); Assert.AreEqual("123456789", response.ConversationId); Assert.NotNull(response.SystemTime); }
public void Should_Delete_Product() { string randomString = $"{DateTime.Now:yyyyMMddHHmmssfff}"; CreateProductRequest createProductRequest = new CreateProductRequest { Description = "product-description", Locale = Locale.TR.ToString(), Name = $"product-name-{randomString}", ConversationId = "123456789" }; ProductResource productResource = Product.Create(createProductRequest, _options).Data; DeleteProductRequest updateProductRequest = new DeleteProductRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", ProductReferenceCode = productResource.ReferenceCode }; IyzipayResourceV2 response = Product.Delete(updateProductRequest, _options); PrintResponse(response); Assert.AreEqual(response.Status, Status.SUCCESS.ToString()); Assert.IsNotNull(response.SystemTime); Assert.Null(response.ErrorMessage); }
public void Should_Delete_IyziLink() { BaseRequestV2 requestV2 = new BaseRequestV2(); requestV2.Locale = Locale.TR.ToString(); requestV2.ConversationId = "123456789"; IyzipayResourceV2 response = IyziLink.Delete("token", requestV2, options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.AreEqual(Locale.TR.ToString(), response.Locale); Assert.AreEqual("123456789", response.ConversationId); Assert.NotNull(response.SystemTime); }
public void Should_Delete_Plan() { DeletePlanRequest request = new DeletePlanRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", PricingPlanReferenceCode = "pricingPlanReferenceCode" }; IyzipayResourceV2 response = Plan.Delete(request, options); PrintResponse(response); Assert.AreEqual(response.Status, Status.SUCCESS.ToString()); Assert.IsNotNull(response.SystemTime); Assert.Null(response.ErrorMessage); }
public void Should_Cancel_Subscription() { CancelSubscriptionRequest request = new CancelSubscriptionRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", SubscriptionReferenceCode = "subscriptionReferenceCode" }; IyzipayResourceV2 response = Subscription.Cancel(request, options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.IsNotNull(response.SystemTime); Assert.Null(response.ErrorMessage); }
public void Should_Delete_Plan() { string randomString = DateTime.Now.ToString("yyyyMMddHHmmssfff"); CreateProductRequest createProductRequest = new CreateProductRequest { Description = "product-description", Locale = Locale.TR.ToString(), Name = $"product-name-{randomString}", ConversationId = "123456789" }; ResponseData <ProductResource> createProductResponse = Product.Create(createProductRequest, _options); CreatePlanRequest createPlanRequest = new CreatePlanRequest() { Locale = Locale.TR.ToString(), Name = $"plan-name-{randomString}", ConversationId = "123456789", TrialPeriodDays = 3, Price = "5.23", CurrencyCode = Currency.TRY.ToString(), PaymentInterval = PaymentInterval.WEEKLY.ToString(), RecurrenceCount = 12, PaymentIntervalCount = 1, PlanPaymentType = PlanPaymentType.RECURRING.ToString(), ProductReferenceCode = createProductResponse.Data.ReferenceCode }; ResponseData <PlanResource> createPlanResponse = Plan.Create(createPlanRequest, _options); DeletePlanRequest request = new DeletePlanRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", PricingPlanReferenceCode = createPlanResponse.Data.ReferenceCode }; IyzipayResourceV2 response = Plan.Delete(request, _options); PrintResponse(response); Assert.AreEqual(response.Status, Status.SUCCESS.ToString()); Assert.IsNotNull(response.SystemTime); Assert.Null(response.ErrorMessage); }
public void Should_Upgrade_Subscription() { UpgradeSubscriptionRequest request = new UpgradeSubscriptionRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", SubscriptionReferenceCode = "subscriptionReferenceCode", NewPricingPlanReferenceCode = "newPricingPlanReferenceCode", UseTrial = true, ResetRecurrenceCount = true, UpgradePeriod = SubscriptionUpgradePeriod.NOW.ToString() }; IyzipayResourceV2 response = Subscription.Upgrade(request, options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.IsNotNull(response.SystemTime); Assert.Null(response.ErrorMessage); }
public void Should_Cancel_Subscription() { string randomString = DateTime.Now.ToString("yyyyMMddHHmmssfff"); CreateProductRequest createProductRequest = new CreateProductRequest { Description = "product-description", Locale = Locale.TR.ToString(), Name = $"product-name-{randomString}", ConversationId = "123456789" }; ResponseData <ProductResource> createProductResponse = Product.Create(createProductRequest, _options); CreatePlanRequest createPlanRequest = new CreatePlanRequest() { Locale = Locale.TR.ToString(), Name = $"plan-name-{randomString}", ConversationId = "123456789", TrialPeriodDays = 3, Price = "5.23", CurrencyCode = Currency.TRY.ToString(), PaymentInterval = PaymentInterval.WEEKLY.ToString(), RecurrenceCount = 12, PaymentIntervalCount = 1, PlanPaymentType = PlanPaymentType.RECURRING.ToString(), ProductReferenceCode = createProductResponse.Data.ReferenceCode }; PlanResource planResource = Plan.Create(createPlanRequest, _options).Data; SubscriptionInitializeRequest subscriptionInitializeRequest = new SubscriptionInitializeRequest { Locale = Locale.TR.ToString(), Customer = new CheckoutFormCustomer { Email = $"iyzico-{randomString}@iyzico.com", Name = "customer-name", Surname = "customer-surname", BillingAddress = new Address { City = "İstanbul", Country = "Türkiye", Description = "billing-address-description", ContactName = "billing-contact-name", ZipCode = "010101" }, ShippingAddress = new Address { City = "İstanbul", Country = "Türkiye", Description = "shipping-address-description", ContactName = "shipping-contact-name", ZipCode = "010102" }, GsmNumber = "+905350000000", IdentityNumber = "55555555555" }, PaymentCard = new CardInfo { CardNumber = "5528790000000008", CardHolderName = "iyzico", ExpireMonth = "12", ExpireYear = "2029", Cvc = "123", RegisterConsumerCard = true }, ConversationId = "123456789", PricingPlanReferenceCode = planResource.ReferenceCode, SubscriptionInitialStatus = SubscriptionStatus.ACTIVE.ToString() }; ResponseData <SubscriptionCreatedResource> initializeResponse = Subscription.Initialize(subscriptionInitializeRequest, _options); CancelSubscriptionRequest request = new CancelSubscriptionRequest { Locale = Locale.TR.ToString(), ConversationId = "123456789", SubscriptionReferenceCode = initializeResponse.Data.ReferenceCode }; IyzipayResourceV2 response = Subscription.Cancel(request, _options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.IsNotNull(response.SystemTime); Assert.Null(response.ErrorMessage); }