1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-14 20:31:23 +01:00

handle refund echecks

This commit is contained in:
Kyle Spearrin 2019-04-01 09:46:02 -04:00
parent 7d47dac65f
commit 4b6edace09

View File

@ -92,9 +92,15 @@ namespace Bit.Billing.Controllers
return new BadRequestResult();
}
if(ipnTransaction.PaymentType == "echeck")
if(ipnTransaction.PaymentStatus == "Refunded" && ipnTransaction.ParentTxnId == null)
{
// Not accepting eChecks
// Refunds require parent transaction
return new OkResult();
}
if(ipnTransaction.PaymentType == "echeck" && ipnTransaction.PaymentStatus != "Refunded")
{
// Not accepting eChecks, unless it is a refund
_logger.LogWarning("Got an eCheck payment. " + ipnTransaction.TxnId);
return new OkResult();
}