From dde09300c32b4d2a15773692b455d8793c64cfe2 Mon Sep 17 00:00:00 2001 From: Vincent Kok Date: Sat, 17 Aug 2024 08:46:23 +0200 Subject: [PATCH] Add support for the cancelUrl, method, locale and testmode properties when updating a payment (#393) --- .../Payment/Request/PaymentUpdateRequest.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Mollie.Api/Models/Payment/Request/PaymentUpdateRequest.cs b/src/Mollie.Api/Models/Payment/Request/PaymentUpdateRequest.cs index 10a1df43..6c54f639 100644 --- a/src/Mollie.Api/Models/Payment/Request/PaymentUpdateRequest.cs +++ b/src/Mollie.Api/Models/Payment/Request/PaymentUpdateRequest.cs @@ -19,6 +19,11 @@ public record PaymentUpdateRequest { /// public string? RedirectUrl { get; set; } + /// + /// Can be updated while the payment is in an open state. + /// + public string? CancelUrl { get; set; } + /// /// Set the webhook URL, where we will send payment status updates to. /// @@ -31,6 +36,21 @@ public record PaymentUpdateRequest { [JsonConverter(typeof(RawJsonConverter))] public string? Metadata { get; set; } + /// + /// 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. + /// + public string? Method { get; set; } + + /// + /// 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 + /// + public string? Locale { get; set; } + /// /// 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 @@ -39,6 +59,11 @@ public record PaymentUpdateRequest { /// public string? RestrictPaymentMethodsToCountry { get; set; } + /// + /// Oauth only - Optional – Set this to true to make this payment a test payment. + /// + public bool? Testmode { get; set; } + public void SetMetadata(object metadataObj, JsonSerializerSettings? jsonSerializerSettings = null) { Metadata = JsonConvert.SerializeObject(metadataObj, jsonSerializerSettings); }