1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-05 10:02:47 -05:00

ipn updates

This commit is contained in:
Kyle Spearrin
2019-02-21 21:08:45 -05:00
parent de2ca2ff95
commit 532c23d58b
2 changed files with 22 additions and 2 deletions

View File

@ -186,7 +186,25 @@ namespace Bit.Billing.Controllers
}
var ipnTransaction = new PayPalIpnClient.IpnTransaction(body);
if(ipnTransaction.ReceiverId != _billingSettings.PayPal.BusinessId || ipnTransaction.McCurrency != "USD")
if(ipnTransaction.ReceiverId != _billingSettings.PayPal.BusinessId)
{
return new BadRequestResult();
}
if(ipnTransaction.TxnType != "web_accept" && ipnTransaction.TxnType != "merch_pmt" &&
ipnTransaction.PaymentStatus != "Refunded")
{
// Only processing billing agreement payments, buy now button payments, and refunds for now.
return new OkResult();
}
if(ipnTransaction.PaymentType == "echeck")
{
// Not accepting eChecks
return new OkResult();
}
if(ipnTransaction.McCurrency != "USD")
{
return new BadRequestResult();
}
@ -197,9 +215,9 @@ namespace Bit.Billing.Controllers
return new OkResult();
}
// Only processing credits via IPN for now
if(!ipnTransaction.IsAccountCredit())
{
// Only processing credits via IPN for now
return new OkResult();
}