mirror of
https://github.com/bitwarden/server.git
synced 2025-05-20 11:04:31 -05:00
ipn updates
This commit is contained in:
parent
de2ca2ff95
commit
532c23d58b
@ -186,7 +186,25 @@ namespace Bit.Billing.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ipnTransaction = new PayPalIpnClient.IpnTransaction(body);
|
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();
|
return new BadRequestResult();
|
||||||
}
|
}
|
||||||
@ -197,9 +215,9 @@ namespace Bit.Billing.Controllers
|
|||||||
return new OkResult();
|
return new OkResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only processing credits via IPN for now
|
|
||||||
if(!ipnTransaction.IsAccountCredit())
|
if(!ipnTransaction.IsAccountCredit())
|
||||||
{
|
{
|
||||||
|
// Only processing credits via IPN for now
|
||||||
return new OkResult();
|
return new OkResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ namespace Bit.Billing.Utilities
|
|||||||
TxnType = GetDictValue(dataDict, "txn_type");
|
TxnType = GetDictValue(dataDict, "txn_type");
|
||||||
ParentTxnId = GetDictValue(dataDict, "parent_txn_id");
|
ParentTxnId = GetDictValue(dataDict, "parent_txn_id");
|
||||||
PaymentStatus = GetDictValue(dataDict, "payment_status");
|
PaymentStatus = GetDictValue(dataDict, "payment_status");
|
||||||
|
PaymentType = GetDictValue(dataDict, "payment_type");
|
||||||
McCurrency = GetDictValue(dataDict, "mc_currency");
|
McCurrency = GetDictValue(dataDict, "mc_currency");
|
||||||
Custom = GetDictValue(dataDict, "custom");
|
Custom = GetDictValue(dataDict, "custom");
|
||||||
ItemName = GetDictValue(dataDict, "item_name");
|
ItemName = GetDictValue(dataDict, "item_name");
|
||||||
@ -105,6 +106,7 @@ namespace Bit.Billing.Utilities
|
|||||||
public string TxnType { get; set; }
|
public string TxnType { get; set; }
|
||||||
public string ParentTxnId { get; set; }
|
public string ParentTxnId { get; set; }
|
||||||
public string PaymentStatus { get; set; }
|
public string PaymentStatus { get; set; }
|
||||||
|
public string PaymentType { get; set; }
|
||||||
public decimal McGross { get; set; }
|
public decimal McGross { get; set; }
|
||||||
public decimal McFee { get; set; }
|
public decimal McFee { get; set; }
|
||||||
public string McCurrency { get; set; }
|
public string McCurrency { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user