Skip to content

Commit

Permalink
Add DD mandate ID to payreq evt model. Fix bug where jsonproperty was…
Browse files Browse the repository at this point in the history
… being used instead of jsonignore. (#436)
  • Loading branch information
sipsorcery authored Oct 16, 2024
1 parent 95a0639 commit f2a6336
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/NoFrixion.MoneyMoov/Models/Mandates/Mandate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class Mandate
/// used to do a balance check on the payer's account. We don't currenlty support the AIS workflow.
/// </summary>
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public decimal Amount { get; set; }

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/NoFrixion.MoneyMoov/Models/Mandates/MandateCreate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public class MandateCreate
/// This is an optional field that with mandates created via Account Information Services can be
/// used to do a balance check on the payer's account. We don't currenlty support the AIS workflow.
/// </summary>
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
public decimal Amount { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public PaymentMethodTypeEnum PaymentMethodTypes
public string? CardStripePaymentIntentSecret { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public Merchant? Merchant { get; set; }

public List<PaymentRequestAddress> Addresses { get; set; } = new List<PaymentRequestAddress>();
Expand Down Expand Up @@ -287,7 +287,7 @@ public PaymentMethodTypeEnum PaymentMethodTypes
/// </summary>
/// <returns>The billing address or null if it's not set.</returns>
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public PaymentRequestAddress? BillingAddress =>
Addresses?.Where(x => x.AddressType == AddressTypesEnum.Billing).FirstOrDefault();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,15 @@ public string? OriginUrl
public string? CustomerEmailAddress { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public PaymentProcessorsEnum PaymentProcessor { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? LightningInvoice { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public DateTimeOffset? LightningInvoiceExpiresAt { get; set; }

[EmailAddressMultiple(ErrorMessage = PaymentRequestConstants.NOTIFICATION_EMAIL_ADDRESSES_ERROR_MESSAGE)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// MIT.
//-----------------------------------------------------------------------------

using System.Text.Json.Serialization;
using System.ComponentModel.DataAnnotations;

namespace NoFrixion.MoneyMoov.Models;
Expand All @@ -44,11 +43,11 @@ public class PaymentRequestEvent
public string? ErrorMessage { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? RawResponse { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? RawResponseHash { get; set; }

public string? CardRequestID { get; set; }
Expand Down Expand Up @@ -101,7 +100,7 @@ public class PaymentRequestEvent
/// between submitting and finalising a payment initiation attempt.
/// </summary>
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? PispToken { get; set; }

/// <summary>
Expand Down Expand Up @@ -139,7 +138,7 @@ public class PaymentRequestEvent
/// of the tokenised card record that can be used with the pay with card token method.
/// </summary>
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public Guid? TokenisedCardID { get; set; }

/// <summary>
Expand All @@ -164,6 +163,11 @@ public class PaymentRequestEvent
/// </summary>
public string? DirectDebitPaymentReference { get; set; }

/// <summary>
/// The ID of the mandate that was used wehn requesting payment.
/// </summary>
public Guid? DrirectDebitMandateID { get; set; }

/// <summary>
/// Gets the amount to display with the correct number of decimal places based on the currency type.
/// </summary>
Expand Down
12 changes: 6 additions & 6 deletions src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class Payout : IValidatableObject, IWebhookPayload

[Obsolete("Please use Destination.")]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public Guid? DestinationAccountID
{
get => Destination?.AccountID;
Expand All @@ -115,7 +115,7 @@ public Guid? DestinationAccountID

[Obsolete("Please use Destination.")]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? DestinationIBAN
{
get => Destination?.Identifier?.IBAN;
Expand All @@ -129,7 +129,7 @@ public string? DestinationIBAN

[Obsolete("Please use Destination.")]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? DestinationAccountNumber
{
get => Destination?.Identifier?.AccountNumber;
Expand All @@ -143,7 +143,7 @@ public string? DestinationAccountNumber

[Obsolete("Please use Destination.")]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? DestinationSortCode
{
get => Destination?.Identifier?.SortCode;
Expand All @@ -157,7 +157,7 @@ public string? DestinationSortCode

[Obsolete("Please use Destination.")]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public string? DestinationAccountName
{
get => Destination?.Name;
Expand Down Expand Up @@ -265,7 +265,7 @@ public AccountIdentifier? SourceAccountIdentifier

[Obsolete("Please use Destination.")]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
public Counterparty? DestinationAccount
{
get => Destination;
Expand Down
4 changes: 2 additions & 2 deletions src/NoFrixion.MoneyMoov/NoFrixionProblem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ public static NoFrixionProblem Empty
/// unknown, on non-JSON, format.
/// </summary>
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
[IgnoreDataMember]
public string RawError { get; set; } = string.Empty;

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonProperty]
[Newtonsoft.Json.JsonIgnore]
[IgnoreDataMember]
public bool IsEmpty => _isEmpty;

Expand Down

0 comments on commit f2a6336

Please sign in to comment.