mirror of
https://github.com/bitwarden/server.git
synced 2025-05-20 11:04:31 -05:00
log json formatted
This commit is contained in:
parent
8340b22c2a
commit
8d29eefb3a
@ -1,12 +1,9 @@
|
|||||||
using Bit.Billing.Utilities;
|
using Bit.Core;
|
||||||
using Bit.Core;
|
|
||||||
using Bit.Core.Enums;
|
|
||||||
using Bit.Core.Models.Table;
|
|
||||||
using Bit.Core.Repositories;
|
|
||||||
using Bit.Core.Services;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -17,28 +14,13 @@ namespace Bit.Billing.Controllers
|
|||||||
public class AppleController : Controller
|
public class AppleController : Controller
|
||||||
{
|
{
|
||||||
private readonly BillingSettings _billingSettings;
|
private readonly BillingSettings _billingSettings;
|
||||||
private readonly ITransactionRepository _transactionRepository;
|
|
||||||
private readonly IOrganizationRepository _organizationRepository;
|
|
||||||
private readonly IUserRepository _userRepository;
|
|
||||||
private readonly IMailService _mailService;
|
|
||||||
private readonly IPaymentService _paymentService;
|
|
||||||
private readonly ILogger<AppleController> _logger;
|
private readonly ILogger<AppleController> _logger;
|
||||||
|
|
||||||
public AppleController(
|
public AppleController(
|
||||||
IOptions<BillingSettings> billingSettings,
|
IOptions<BillingSettings> billingSettings,
|
||||||
ITransactionRepository transactionRepository,
|
|
||||||
IOrganizationRepository organizationRepository,
|
|
||||||
IUserRepository userRepository,
|
|
||||||
IMailService mailService,
|
|
||||||
IPaymentService paymentService,
|
|
||||||
ILogger<AppleController> logger)
|
ILogger<AppleController> logger)
|
||||||
{
|
{
|
||||||
_billingSettings = billingSettings?.Value;
|
_billingSettings = billingSettings?.Value;
|
||||||
_transactionRepository = transactionRepository;
|
|
||||||
_organizationRepository = organizationRepository;
|
|
||||||
_userRepository = userRepository;
|
|
||||||
_mailService = mailService;
|
|
||||||
_paymentService = paymentService;
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,10 +50,17 @@ namespace Bit.Billing.Controllers
|
|||||||
return new BadRequestResult();
|
return new BadRequestResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Got IAP Status Update");
|
try
|
||||||
_logger.LogInformation(Constants.BypassFiltersEventId, body);
|
{
|
||||||
|
var json = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(body), Formatting.Indented);
|
||||||
return new OkResult();
|
_logger.LogInformation("Apple IAP Notification:\n\n" + Constants.BypassFiltersEventId, json);
|
||||||
|
return new OkResult();
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e, "Error processing IAP status notification.");
|
||||||
|
return new BadRequestResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user