public async Task <ActionResult> CancelSubscription([FromBody] SubscriptionCancelRequest cancelRequest) { var subscription = await GetSubscriptionByNumberAsync(cancelRequest.Number); var retVal = (await _subscriptionService.CancelSubscriptionAsync(new SubscriptionCancelRequest { CancelReason = cancelRequest.CancelReason, SubscriptionId = subscription.Id })); return(Json(retVal)); }
public async Task <ActionResult <Subscription> > CancelSubscription([FromBody] SubscriptionCancelRequest cancelRequest) { var subscription = await GetSubscriptionByNumberAsync(cancelRequest.Number); var retVal = (await _subscriptionService.CancelSubscriptionAsync(new SubscriptionCancelRequest { CancelReason = cancelRequest.CancelReason, SubscriptionId = subscription.Id, CustomerId = WorkContext.CurrentUser.Id })); return(retVal); }
private async Task CancelSubscriptionAsync() { try { Console.Write("Enter a subscription ARN: "); var subscriptionArn = Console.ReadLine(); var cancellation = await _subscriptionService.CancelSubscriptionAsync(subscriptionArn); Console.WriteLine(JsonConvert.SerializeObject(cancellation, Formatting.Indented)); } catch (Exception e) { Console.ForegroundColor = ErrorForegroundColor; Console.WriteLine(e); Console.ForegroundColor = ForegroundColor; } }
private async Task CancelSubscriptionAsync() { try { Console.Write("Enter a subscription ARN: "); var subscriptionArn = Console.ReadLine() ?? string.Empty; var cancellation = await _subscriptionService.CancelSubscriptionAsync(subscriptionArn); Console.WriteLine(JsonSerializer.Serialize(cancellation, new JsonSerializerOptions { WriteIndented = true })); } catch (Exception e) { Console.ForegroundColor = ErrorForegroundColor; Console.WriteLine(e); Console.ForegroundColor = ForegroundColor; } }