public async Task <DeletePlanResponse> Handle(DeletePlanRequest request, CancellationToken cancellationToken) { var response = await _planRepository.DeletePlanAsync(request.PlanId); return(new DeletePlanResponse() { Response = response }); }
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_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 static IyzipayResourceV2 Delete(DeletePlanRequest request, Options options) { string uri = $"{options.BaseUrl}/v2/subscription/pricing-plans/{request.PricingPlanReferenceCode}"; return(RestHttpClientV2.Create().Delete <IyzipayResourceV2>(uri, GetHttpHeadersWithRequestBody(request, uri, options), request)); }
public bool DeletePlan(DeletePlanRequest deleteplanrequest) { return(planService.DeletePlan(deleteplanrequest.PlanId)); }