Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reusable payment links #415

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading