예제 #1
0
        public async Task PostUpgrade(string id, [FromBody] OrganizationUpgradeRequestModel model)
        {
            var orgIdGuid = new Guid(id);

            if (!_currentContext.OrganizationOwner(orgIdGuid))
            {
                throw new NotFoundException();
            }

            await _organizationService.UpgradePlanAsync(orgIdGuid, model.PlanType, model.AdditionalSeats);
        }
예제 #2
0
        public async Task <PaymentResponseModel> PostUpgrade(string id, [FromBody] OrganizationUpgradeRequestModel model)
        {
            var orgIdGuid = new Guid(id);

            if (!await _currentContext.OrganizationOwner(orgIdGuid))
            {
                throw new NotFoundException();
            }

            var result = await _organizationService.UpgradePlanAsync(orgIdGuid, model.ToOrganizationUpgrade());

            return(new PaymentResponseModel
            {
                Success = result.Item1,
                PaymentIntentClientSecret = result.Item2
            });
        }