Skip to content

Commit

Permalink
Merge pull request #240 from nofrixion/MOOV-2493-Disable-beneficiary-…
Browse files Browse the repository at this point in the history
…endpoint
  • Loading branch information
sauravmaiti22 authored Nov 21, 2023
2 parents 9d562a5 + 103a69a commit ad8b382
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/NoFrixion.MoneyMoov/Enums/BeneficiaryEventTypeEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ namespace NoFrixion.MoneyMoov.Enums;
public enum BeneficiaryEventTypeEnum
{
Authorise,
Update
Update,
Disable
}
5 changes: 5 additions & 0 deletions src/NoFrixion.MoneyMoov/Enums/PayoutEventTypesEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,10 @@ public enum PayoutEventTypesEnum
/// A payout's associated beneficiary was updated.
/// </summary>
BeneficiaryUpdated = 9,

/// <summary>
/// A payout's associated beneficiary was disabled.
/// </summary>
BeneficiaryDisabled = 10,
}
}
7 changes: 5 additions & 2 deletions src/NoFrixion.MoneyMoov/Models/Beneficiary/Beneficiary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public class Beneficiary : IValidatableObject
public string ApprovalCallbackUrl { get; set; }

public bool IsEnabled { get; set; }

public DateTimeOffset LastUpdated { get; set; }

// Don't serialize the events if there are none.
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
Expand All @@ -74,11 +76,12 @@ public bool ShouldSerializeBeneficiaryEvents()
public string GetApprovalHash()
{
var input =
MerchantID + (AccountID != null && AccountID != Guid.Empty
Name + MerchantID + (AccountID != null && AccountID != Guid.Empty
? AccountID.ToString()
: string.Empty) +
Currency +
Destination.GetApprovalHash();
Destination.GetApprovalHash()
+ LastUpdated.ToString("o");

return HashHelper.CreateHash(input);
}
Expand Down

0 comments on commit ad8b382

Please sign in to comment.