From 73e049f878a29339fcfb6b3f15cd81ccde47c6d1 Mon Sep 17 00:00:00 2001 From: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:50:12 -0400 Subject: [PATCH] [AC-2378] Added `ProviderId` to PayPal transaction model (#3995) * Added ProviderId to PayPal transaction model * Fixed issue with parsing provider id --- src/Billing/Models/PayPalIPNTransactionModel.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Billing/Models/PayPalIPNTransactionModel.cs b/src/Billing/Models/PayPalIPNTransactionModel.cs index 6820119930..6fd0dfa0c4 100644 --- a/src/Billing/Models/PayPalIPNTransactionModel.cs +++ b/src/Billing/Models/PayPalIPNTransactionModel.cs @@ -17,6 +17,7 @@ public class PayPalIPNTransactionModel public DateTime PaymentDate { get; } public Guid? UserId { get; } public Guid? OrganizationId { get; } + public Guid? ProviderId { get; } public bool IsAccountCredit { get; } public PayPalIPNTransactionModel(string formData) @@ -72,6 +73,12 @@ public class PayPalIPNTransactionModel OrganizationId = organizationId; } + if (metadata.TryGetValue("provider_id", out var providerIdStr) && + Guid.TryParse(providerIdStr, out var providerId)) + { + ProviderId = providerId; + } + IsAccountCredit = custom.Contains("account_credit:1"); }