diff --git a/src/Billing/Controllers/BitPayController.cs b/src/Billing/Controllers/BitPayController.cs index 60c9b4503f..f8a5fbafe2 100644 --- a/src/Billing/Controllers/BitPayController.cs +++ b/src/Billing/Controllers/BitPayController.cs @@ -108,7 +108,7 @@ namespace Bit.Billing.Controllers CreationDate = GetTransactionDate(invoice), OrganizationId = ids.Item1, UserId = ids.Item2, - Type = TransactionType.Charge, + Type = TransactionType.Credit, Gateway = GatewayType.BitPay, GatewayId = invoice.Id, PaymentMethodType = PaymentMethodType.BitPay, diff --git a/src/Billing/Controllers/PayPalController.cs b/src/Billing/Controllers/PayPalController.cs index 042d9319e4..78008b2b60 100644 --- a/src/Billing/Controllers/PayPalController.cs +++ b/src/Billing/Controllers/PayPalController.cs @@ -226,7 +226,8 @@ namespace Bit.Billing.Controllers return new OkResult(); } - if(!ipnTransaction.IsAccountCredit()) + var isAccountCredit = ipnTransaction.IsAccountCredit(); + if(!isAccountCredit) { // Only processing credits via IPN for now return new OkResult(); @@ -250,7 +251,7 @@ namespace Bit.Billing.Controllers CreationDate = ipnTransaction.PaymentDate, OrganizationId = ids.Item1, UserId = ids.Item2, - Type = TransactionType.Charge, + Type = isAccountCredit ? TransactionType.Credit : TransactionType.Charge, Gateway = GatewayType.PayPal, GatewayId = ipnTransaction.TxnId, PaymentMethodType = PaymentMethodType.PayPal,