Skip to content

Commit

Permalink
Add support for reusable payment links (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt authored Jan 29, 2025
1 parent d7d2e03 commit 5fc56fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public record PaymentLinkRequest
/// </summary>
public string? ProfileId { get; set; }

/// <summary>
/// Indicates whether the payment link is reusable. If this field is set to true, customers can make multiple
/// payments using the same link. If no value is specified, the field defaults to false, allowing only a single
/// payment per link.
/// </summary>
public bool? Reusable { get; set; }

/// <summary>
/// The expiry date of the payment link in ISO 8601 format. For example: 2021-12-24T12:00:16+01:00.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public record PaymentLinkResponse
/// </summary>
public string? ProfileId { get; set; }

/// <summary>
/// Indicates whether the payment link is reusable. If this field is set to true, customers can make multiple
/// payments using the same link. If no value is specified, the field defaults to false, allowing only a single
/// payment per link.
/// </summary>
public bool? Reusable { get; set; }

/// <summary>
/// The payment link’s date and time of creation, in ISO 8601 format.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions tests/Mollie.Tests.Integration/Api/PaymentLinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public async Task CanCreatePaymentLinkAndRetrieveIt() {
Amount = new Amount(Currency.EUR, 50),
WebhookUrl = DefaultWebhookUrl,
RedirectUrl = DefaultRedirectUrl,
Reusable = true,
ExpiresAt = DateTime.Now.AddDays(1)
};
var createdPaymentLinkResponse = await _paymentLinkClient.CreatePaymentLinkAsync(paymentLinkRequest);
Expand All @@ -55,6 +56,7 @@ public async Task CanCreatePaymentLinkAndRetrieveIt() {
response.Description.ShouldBe(paymentLinkRequest.Description);
response.RedirectUrl.ShouldBe(paymentLinkRequest.RedirectUrl);
response.Archived.ShouldBeFalse();
response.Reusable.ShouldBe(paymentLinkRequest.Reusable);
});

verifyPaymentLinkResponse(createdPaymentLinkResponse);
Expand Down

0 comments on commit 5fc56fb

Please sign in to comment.