Skip to content

Commit

Permalink
Add support for the cancelUrl, method, locale and testmode properties…
Browse files Browse the repository at this point in the history
… when updating a payment (#393)
  • Loading branch information
Viincenttt authored Aug 17, 2024
1 parent 56894df commit dde0930
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Mollie.Api/Models/Payment/Request/PaymentUpdateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public record PaymentUpdateRequest {
/// </summary>
public string? RedirectUrl { get; set; }

/// <summary>
/// Can be updated while the payment is in an open state.
/// </summary>
public string? CancelUrl { get; set; }

/// <summary>
/// Set the webhook URL, where we will send payment status updates to.
/// </summary>
Expand All @@ -31,6 +36,21 @@ public record PaymentUpdateRequest {
[JsonConverter(typeof(RawJsonConverter))]
public string? Metadata { get; set; }

/// <summary>
/// Can be updated while no payment method has been chosen yet.
/// See the Mollie.Api.Models.Payment.PaymentMethod class for a full list of known values.
/// </summary>
public string? Method { get; set; }

/// <summary>
/// Allows you to preset the language to be used in the payment screens shown to the consumer. Setting a locale is highly
/// recommended and will greatly improve your conversion rate. When this parameter is omitted, the browser language will
/// be used instead if supported by the payment method. You can provide any ISO 15897 locale, but our payment screen currently
/// only supports the following languages: en_US nl_NL nl_BE fr_FR fr_BE de_DE de_AT de_CH es_ES ca_ES pt_PT it_IT nb_NO
/// sv_SE fi_FI da_DK is_IS hu_HU pl_PL lv_LV lt_LT
/// </summary>
public string? Locale { get; set; }

/// <summary>
/// For digital goods in most jurisdictions, you must apply the VAT rate from your customer’s country. Choose the VAT rates
/// you have used for the order to ensure your customer’s country matches the VAT country. Use this parameter to restrict the
Expand All @@ -39,6 +59,11 @@ public record PaymentUpdateRequest {
/// </summary>
public string? RestrictPaymentMethodsToCountry { get; set; }

/// <summary>
/// Oauth only - Optional – Set this to true to make this payment a test payment.
/// </summary>
public bool? Testmode { get; set; }

public void SetMetadata(object metadataObj, JsonSerializerSettings? jsonSerializerSettings = null) {
Metadata = JsonConvert.SerializeObject(metadataObj, jsonSerializerSettings);
}
Expand Down

0 comments on commit dde0930

Please sign in to comment.