1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

change payment API

This commit is contained in:
Kyle Spearrin
2017-04-08 16:41:40 -04:00
parent 6467cafde3
commit 18d2715c71
6 changed files with 87 additions and 8 deletions

View File

@ -115,6 +115,19 @@ namespace Bit.Api.Controllers
return new OrganizationResponseModel(organization);
}
[HttpPut("{id}/payment")]
[HttpPost("{id}/payment")]
public async Task PutPayment(string id, [FromBody]OrganizationPaymentRequestModel model)
{
var orgIdGuid = new Guid(id);
if(!_currentContext.OrganizationOwner(orgIdGuid))
{
throw new NotFoundException();
}
await _organizationService.ReplacePaymentMethodAsync(orgIdGuid, model.PaymentToken);
}
[HttpDelete("{id}")]
[HttpPost("{id}/delete")]
public async Task Delete(string id)