1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-22 21:51:22 +01:00

Update stripe lib (#793)

This commit is contained in:
Kyle Spearrin 2020-06-24 21:24:19 -04:00 committed by GitHub
parent 0f2ea43454
commit f23a8edc45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -54,18 +54,17 @@ namespace Bit.Api.Utilities
errorMessage = badRequestException.Message;
}
}
else if (exception is StripeException stripeException &&
stripeException?.StripeError?.ErrorType == "card_error")
else if (exception is StripeException stripeException && stripeException?.StripeError?.Type == "card_error")
{
context.HttpContext.Response.StatusCode = 400;
if (_publicApi)
{
publicErrorModel = new PublicApi.ErrorResponseModel(stripeException.StripeError.Parameter,
publicErrorModel = new PublicApi.ErrorResponseModel(stripeException.StripeError.Param,
stripeException.Message);
}
else
{
internalErrorModel = new InternalApi.ErrorResponseModel(stripeException.StripeError.Parameter,
internalErrorModel = new InternalApi.ErrorResponseModel(stripeException.StripeError.Param,
stripeException.Message);
}
}

View File

@ -53,7 +53,7 @@
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="AspNetCoreRateLimit" Version="2.1.0" />
<PackageReference Include="Braintree" Version="4.17.0" />
<PackageReference Include="Stripe.net" Version="36.9.0" />
<PackageReference Include="Stripe.net" Version="37.13.0" />
<PackageReference Include="U2F.Core" Version="1.0.4" />
<PackageReference Include="Otp.NET" Version="1.2.2" />
<PackageReference Include="YubicoDotNetClient" Version="1.2.0" />

View File

@ -835,7 +835,7 @@ namespace Bit.Core.Services
if (charges?.Data != null)
{
var refundService = new RefundService();
foreach (var charge in charges.Data.Where(c => c.Captured.GetValueOrDefault() && !c.Refunded))
foreach (var charge in charges.Data.Where(c => c.Captured && !c.Refunded))
{
await refundService.CreateAsync(new RefundCreateOptions { Charge = charge.Id });
}