mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-03-19 21:41:43 +01:00
Check order status on demand
This commit is contained in:
parent
bfc133bdc9
commit
79f6bcc37f
@ -181,6 +181,20 @@ public class DownloadController : Controller
|
||||
if (order?.Status == PaywallOrderStatus.Paid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (order?.Status is PaywallOrderStatus.Unpaid)
|
||||
{
|
||||
// check status
|
||||
var svc = await _paymentFactory.CreateProvider(order.Service);
|
||||
var status = await svc.GetOrderStatus(order.Id);
|
||||
if (status != default && status.Status != order.Status)
|
||||
{
|
||||
await _paymentOrders.UpdateStatus(order.Id, status.Status);
|
||||
}
|
||||
if (status?.Status == PaywallOrderStatus.Paid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user