From 26152ee1d576d606c088f8656997e856e0eba62c Mon Sep 17 00:00:00 2001 From: Aaron Clauson Date: Mon, 6 Nov 2023 09:40:55 +0000 Subject: [PATCH] Adds BeneficiaryID property to the Payout model (#226) * Use payout create beneficiary. * wip: display payout beneficiary. * Payout with beneificiary update now working. --- .../Models/PaymentRequests/PaymentRequestCreate.cs | 2 +- src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs | 5 +++++ src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs | 6 ++++++ src/NoFrixion.MoneyMoov/Models/Payouts/PayoutUpdate.cs | 7 ++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/NoFrixion.MoneyMoov/Models/PaymentRequests/PaymentRequestCreate.cs b/src/NoFrixion.MoneyMoov/Models/PaymentRequests/PaymentRequestCreate.cs index f1ce46d8..533efd87 100755 --- a/src/NoFrixion.MoneyMoov/Models/PaymentRequests/PaymentRequestCreate.cs +++ b/src/NoFrixion.MoneyMoov/Models/PaymentRequests/PaymentRequestCreate.cs @@ -327,7 +327,7 @@ public string? OriginUrl /// tag exists it will be created. /// public List? Tags { get; set; } - + public NoFrixionProblem Validate() { var context = new ValidationContext(this, serviceProvider: null, items: null); diff --git a/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs b/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs index e725dc68..dc9fbc06 100755 --- a/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs +++ b/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs @@ -275,6 +275,11 @@ public Counterparty? DestinationAccount /// public List? AuthorisedBy { get; set; } + /// + /// If the payout destination is a beneficairy this will be the ID of it. + /// + public Guid? BeneficiaryID { get; set; } + public NoFrixionProblem Validate() { var context = new ValidationContext(this, serviceProvider: null, items: null); diff --git a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs index 9487e6cc..41b8daec 100755 --- a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs +++ b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs @@ -151,6 +151,11 @@ public Counterparty? DestinationAccount /// public int BitcoinFeeSatsPerVbyte { get; set; } + /// + /// Optional. The ID of the beneficiary to use for the payout destination. + /// + public Guid? BeneficiaryID { get; set; } + /// /// Places all the payout's properties into a dictionary. /// @@ -169,6 +174,7 @@ public Dictionary ToDictionary() { nameof(TheirReference), TheirReference ?? string.Empty}, { nameof(InvoiceID), InvoiceID ?? string.Empty }, { nameof(AllowIncomplete), AllowIncomplete.ToString() }, + { nameof(BeneficiaryID), BeneficiaryID?.ToString() ?? string.Empty } }; if (Destination != null) diff --git a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutUpdate.cs b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutUpdate.cs index 98071a5c..816bba67 100755 --- a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutUpdate.cs +++ b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutUpdate.cs @@ -126,7 +126,7 @@ public Counterparty? DestinationAccount /// /// For Bitcoin payouts, when this flag is set the network fee will be deducted from the send amount. - /// THis is particularly useful for sweeps where it can be difficult to calculate the exact fee required. + /// This is particularly useful for sweeps where it can be difficult to calculate the exact fee required. /// public bool? BitcoinSubtractFeeFromAmount { get; set; } @@ -135,6 +135,11 @@ public Counterparty? DestinationAccount /// public int? BitcoinFeeSatsPerVbyte { get; set; } + /// + /// Optional. The ID of the beneficiary to use for the payout destination. + /// + public Guid? BeneficiaryID { get; set; } + /// /// Places all the payout's properties into a dictionary. ///