1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-27 13:05:23 +01:00

add a delay to invoice.payment_succeeded hook

This commit is contained in:
Kyle Spearrin 2019-09-02 08:41:06 -04:00
parent f37f335120
commit ed86a5f9d5

View File

@ -333,6 +333,11 @@ namespace Bit.Billing.Controllers
var subscription = await subscriptionService.GetAsync(invoice.SubscriptionId); var subscription = await subscriptionService.GetAsync(invoice.SubscriptionId);
if(subscription?.Status == "active") if(subscription?.Status == "active")
{ {
if(DateTime.UtcNow - invoice.Created < TimeSpan.FromMinutes(1))
{
await Task.Delay(5000);
}
var ids = GetIdsFromMetaData(subscription.Metadata); var ids = GetIdsFromMetaData(subscription.Metadata);
// org // org
if(ids.Item1.HasValue) if(ids.Item1.HasValue)