|
| 1 | +using System.Text.Json.Serialization; |
| 2 | + |
| 3 | +namespace Monnify.Collections; |
| 4 | + |
| 5 | +public sealed class Mandate |
| 6 | +{ |
| 7 | + [JsonPropertyName("mandateCode")] |
| 8 | + public string MandateCode { get; set; } = string.Empty; |
| 9 | + |
| 10 | + /// <summary> |
| 11 | + /// The merchant-generated reference supplied as <c>mandateReference</c> at creation time. Our |
| 12 | + /// docs' sample for this endpoint shows the field as <c>externalMandateReference</c>; the real |
| 13 | + /// sandbox returns <c>mandateReference</c> instead. |
| 14 | + /// </summary> |
| 15 | + [JsonPropertyName("mandateReference")] |
| 16 | + public string MandateReference { get; set; } = string.Empty; |
| 17 | + |
| 18 | + /// <summary>Format: <c>YYYY-MM-DDTHH:MM:SS</c> (with milliseconds and a timezone offset on responses).</summary> |
| 19 | + [JsonPropertyName("startDate")] |
| 20 | + public string StartDate { get; set; } = string.Empty; |
| 21 | + |
| 22 | + /// <summary>Format: <c>YYYY-MM-DDTHH:MM:SS</c> (with milliseconds and a timezone offset on responses).</summary> |
| 23 | + [JsonPropertyName("endDate")] |
| 24 | + public string EndDate { get; set; } = string.Empty; |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// E.g. <c>ACTIVE</c>, <c>FAILED</c>, <c>CANCELLED</c>, <c>EXPIRED</c>. Sandbox-observed values |
| 28 | + /// include <c>PENDING_AUTHORIZATION</c> as well, which isn't in our docs' status list |
| 29 | + /// (<c>PENDING</c>, <c>ACTIVE</c>, <c>FAILED</c>, <c>CANCELLED</c>, <c>EXPIRED</c>) - treat that |
| 30 | + /// list as non-exhaustive. |
| 31 | + /// </summary> |
| 32 | + [JsonPropertyName("mandateStatus")] |
| 33 | + public string MandateStatus { get; set; } = string.Empty; |
| 34 | + |
| 35 | + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] |
| 36 | + [JsonPropertyName("mandateAmount")] |
| 37 | + public decimal MandateAmount { get; set; } |
| 38 | + |
| 39 | + [JsonPropertyName("contractCode")] |
| 40 | + public string ContractCode { get; set; } = string.Empty; |
| 41 | + |
| 42 | + [JsonPropertyName("autoRenew")] |
| 43 | + public bool AutoRenew { get; set; } |
| 44 | + |
| 45 | + [JsonPropertyName("customerPhoneNumber")] |
| 46 | + public string CustomerPhoneNumber { get; set; } = string.Empty; |
| 47 | + |
| 48 | + [JsonPropertyName("customerEmailAddress")] |
| 49 | + public string CustomerEmailAddress { get; set; } = string.Empty; |
| 50 | + |
| 51 | + [JsonPropertyName("customerAddress")] |
| 52 | + public string CustomerAddress { get; set; } = string.Empty; |
| 53 | + |
| 54 | + [JsonPropertyName("customerName")] |
| 55 | + public string CustomerName { get; set; } = string.Empty; |
| 56 | + |
| 57 | + /// <summary>The account name Monnify resolved for <see cref="CustomerAccountNumber"/>, distinct from <see cref="CustomerName"/>.</summary> |
| 58 | + [JsonPropertyName("customerAccountName")] |
| 59 | + public string? CustomerAccountName { get; set; } |
| 60 | + |
| 61 | + [JsonPropertyName("customerAccountNumber")] |
| 62 | + public string CustomerAccountNumber { get; set; } = string.Empty; |
| 63 | + |
| 64 | + [JsonPropertyName("customerAccountBankCode")] |
| 65 | + public string CustomerAccountBankCode { get; set; } = string.Empty; |
| 66 | + |
| 67 | + [JsonPropertyName("mandateDescription")] |
| 68 | + public string MandateDescription { get; set; } = string.Empty; |
| 69 | + |
| 70 | + /// <summary>The amount to be debited per periodic debit, if different from <see cref="MandateAmount"/> (the lifetime total).</summary> |
| 71 | + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] |
| 72 | + [JsonPropertyName("debitAmount")] |
| 73 | + public decimal? DebitAmount { get; set; } |
| 74 | + |
| 75 | + /// <summary>Human-readable instructions for the customer to authorize the mandate (a token transfer).</summary> |
| 76 | + [JsonPropertyName("authorizationMessage")] |
| 77 | + public string? AuthorizationMessage { get; set; } |
| 78 | + |
| 79 | + /// <summary>A hosted page where the customer can complete authorization.</summary> |
| 80 | + [JsonPropertyName("authorizationLink")] |
| 81 | + public string? AuthorizationLink { get; set; } |
| 82 | + |
| 83 | + /// <summary> |
| 84 | + /// A human-readable status message (e.g. <c>"Active Mandate"</c>). |
| 85 | + /// </summary> |
| 86 | + [JsonPropertyName("responseMessage")] |
| 87 | + public string? ResponseMessage { get; set; } |
| 88 | + |
| 89 | + /// <summary>The direct debit scheme, e.g. <c>NDD</c>.</summary> |
| 90 | + [JsonPropertyName("schemeCode")] |
| 91 | + public string? SchemeCode { get; set; } |
| 92 | +} |
0 commit comments