Skip to content

Commit

Permalink
Adds BeneficiaryID property to the Payout model (#226)
Browse files Browse the repository at this point in the history
* Use payout create beneficiary.

* wip: display payout beneficiary.

* Payout with beneificiary update now working.
  • Loading branch information
sipsorcery authored Nov 6, 2023
1 parent b873d2f commit 26152ee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public string? OriginUrl
/// tag exists it will be created.
/// </summary>
public List<string>? Tags { get; set; }

public NoFrixionProblem Validate()
{
var context = new ValidationContext(this, serviceProvider: null, items: null);
Expand Down
5 changes: 5 additions & 0 deletions src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ public Counterparty? DestinationAccount
/// </summary>
public List<string>? AuthorisedBy { get; set; }

/// <summary>
/// If the payout destination is a beneficairy this will be the ID of it.
/// </summary>
public Guid? BeneficiaryID { get; set; }

public NoFrixionProblem Validate()
{
var context = new ValidationContext(this, serviceProvider: null, items: null);
Expand Down
6 changes: 6 additions & 0 deletions src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public Counterparty? DestinationAccount
/// </summary>
public int BitcoinFeeSatsPerVbyte { get; set; }

/// <summary>
/// Optional. The ID of the beneficiary to use for the payout destination.
/// </summary>
public Guid? BeneficiaryID { get; set; }

/// <summary>
/// Places all the payout's properties into a dictionary.
/// </summary>
Expand All @@ -169,6 +174,7 @@ public Dictionary<string, string> ToDictionary()
{ nameof(TheirReference), TheirReference ?? string.Empty},
{ nameof(InvoiceID), InvoiceID ?? string.Empty },
{ nameof(AllowIncomplete), AllowIncomplete.ToString() },
{ nameof(BeneficiaryID), BeneficiaryID?.ToString() ?? string.Empty }
};

if (Destination != null)
Expand Down
7 changes: 6 additions & 1 deletion src/NoFrixion.MoneyMoov/Models/Payouts/PayoutUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public Counterparty? DestinationAccount

/// <summary>
/// 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.
/// </summary>
public bool? BitcoinSubtractFeeFromAmount { get; set; }

Expand All @@ -135,6 +135,11 @@ public Counterparty? DestinationAccount
/// </summary>
public int? BitcoinFeeSatsPerVbyte { get; set; }

/// <summary>
/// Optional. The ID of the beneficiary to use for the payout destination.
/// </summary>
public Guid? BeneficiaryID { get; set; }

/// <summary>
/// Places all the payout's properties into a dictionary.
/// </summary>
Expand Down

0 comments on commit 26152ee

Please sign in to comment.