mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
Address Analyzer Warnings (#2078)
* Address potential errors * Add tests * Add clarity * Run formatting
This commit is contained in:
@ -139,7 +139,6 @@ namespace Bit.Core.Models.Business
|
||||
{
|
||||
public BillingInvoice(Invoice inv)
|
||||
{
|
||||
Amount = inv.AmountDue / 100M;
|
||||
Date = inv.Created;
|
||||
Url = inv.HostedInvoiceUrl;
|
||||
PdfUrl = inv.InvoicePdf;
|
||||
|
@ -85,15 +85,16 @@ namespace Bit.Core.Services
|
||||
receipt.ContainsKey("UserId") ? new Guid(receipt["UserId"]) : (Guid?)null);
|
||||
}
|
||||
|
||||
private async Task<AppleReceiptStatus> GetReceiptStatusAsync(string receiptData, bool prod = true,
|
||||
// Internal for testing
|
||||
internal async Task<AppleReceiptStatus> GetReceiptStatusAsync(string receiptData, bool prod = true,
|
||||
int attempt = 0, AppleReceiptStatus lastReceiptStatus = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (attempt > 4)
|
||||
{
|
||||
throw new Exception("Failed verifying Apple IAP after too many attempts. Last attempt status: " +
|
||||
lastReceiptStatus?.Status ?? "null");
|
||||
throw new Exception(
|
||||
$"Failed verifying Apple IAP after too many attempts. Last attempt status: {lastReceiptStatus?.Status.ToString() ?? "null"}");
|
||||
}
|
||||
|
||||
var url = string.Format("https://{0}.itunes.apple.com/verifyReceipt", prod ? "buy" : "sandbox");
|
||||
|
Reference in New Issue
Block a user