diff --git a/src/Billing/Controllers/PayPalController.cs b/src/Billing/Controllers/PayPalController.cs index 61c0b7758c..042d9319e4 100644 --- a/src/Billing/Controllers/PayPalController.cs +++ b/src/Billing/Controllers/PayPalController.cs @@ -193,12 +193,6 @@ namespace Bit.Billing.Controllers } var ipnTransaction = new PayPalIpnClient.IpnTransaction(body); - if(ipnTransaction.ReceiverId != _billingSettings.PayPal.BusinessId) - { - _logger.LogWarning("Receiver was not proper business id. " + ipnTransaction.ReceiverId); - return new BadRequestResult(); - } - if(ipnTransaction.TxnType != "web_accept" && ipnTransaction.TxnType != "merch_pmt" && ipnTransaction.PaymentStatus != "Refunded") { @@ -206,6 +200,12 @@ namespace Bit.Billing.Controllers return new OkResult(); } + if(ipnTransaction.ReceiverId != _billingSettings.PayPal.BusinessId) + { + _logger.LogWarning("Receiver was not proper business id. " + ipnTransaction.ReceiverId); + return new BadRequestResult(); + } + if(ipnTransaction.PaymentType == "echeck") { // Not accepting eChecks