Skip to content

Commit

Permalink
Merge pull request #250 from nofrixion/feature/MOOV-1183-payelement-l…
Browse files Browse the repository at this point in the history
…ightning

[MOOV-1183]: Added Lightning props to PR models
  • Loading branch information
agranillonf authored Dec 1, 2023
2 parents fd21828 + ca19af4 commit 12f8d37
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/NoFrixion.MoneyMoov/Enums/PaymentRequestEventTypesEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,9 @@ public enum PaymentRequestEventTypesEnum
/// A card payment was refunded.
/// </summary>
card_refund = 18,

/// <summary>
/// A previously generated Bitcoin Lightning invoice has expired.
/// </summary>
lightning_invoice_expired = 19,
}
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ public class PaymentRequest : IPaymentRequest, IWebhookPayload

public string FormattedAmount => PaymentAmount.DisplayCurrencyAndAmount(Currency, Amount);

/// <summary>
/// Date and time of expiration of the lightning invoice.
/// </summary>
public DateTimeOffset? LightningInvoiceExpiresAt { get; set; }

public string CustomerName =>
Addresses.Any() ? $"{Addresses.First().FirstName} {Addresses.First().LastName}" : string.Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ public string? OriginUrl

[JsonIgnore]
public string? LightningInvoice { get; set; }

[JsonIgnore]
public DateTimeOffset? LightningInvoiceExpiresAt { get; set; }

[EmailAddressMultiple(ErrorMessage = PaymentRequestConstants.NOTIFICATION_EMAIL_ADDRESSES_ERROR_MESSAGE)]
public string? NotificationEmailAddresses { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ public class PaymentRequestMinimal
/// Account ID of connected customers in Stripe
/// </summary>
public string? StripeAccountID { get; set; }

/// <summary>
/// Lightning invoice ID, if any.
/// </summary>
public string? LightningInvoice { get; set; }

/// <summary>
/// Date and time of expiration of the lightning invoice.
/// </summary>
public DateTimeOffset? LightningInvoiceExpiresAt { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ public class PaymentRequestUpdate
/// An optional list of tag ids to add to the payment request
/// </summary>
public List<Guid>? TagIds { get; set; }

/// <summary>
/// Bitcoin Lightning invoice for the payment request.
/// </summary>
public string? LightningInvoice { get; set; }

/// <summary>
/// Date and time of expiration of the lightning invoice.
/// </summary>
public DateTimeOffset? LightningInvoiceExpiresAt { get; set; }

/// <summary>
/// Places all the payment request's properties into a dictionary. Useful for testing
Expand Down

0 comments on commit 12f8d37

Please sign in to comment.