forked from Kieran/void.cat
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)
|
if (order?.Status == PaywallOrderStatus.Paid)
|
||||||
{
|
{
|
||||||
return true;
|
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…
Reference in New Issue
Block a user