From 36b4f024615da556ff6e8fba0330b9c340ba04f3 Mon Sep 17 00:00:00 2001 From: NghiNg Date: Thu, 28 Dec 2023 11:22:19 +0100 Subject: [PATCH] Update InvoicePayment with required field paymentScheduledDate and optional referenceNumber --- readme.md | 20 ++++++++++--------- .../types/invoice/InvoicePayment.java | 12 +++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index df70766..9df018d 100644 --- a/readme.md +++ b/readme.md @@ -419,15 +419,17 @@ Payment information for an invoice ### Fields -|Name|Type|Required|Description| -|----|----|--------|-----------| -|paymentId|String|yes|Unique id to reference the payment with third party| -|paymentStatus|String|yes|A status a given payment is in. ISO20022 payment statuses can be used| -|paymentTime|ZonedDateTime|yes|When the payment is done| -|debtorAccount|String|yes|The debtor account for the payment. Exactly 11 digits| -|debtorAccountName|String|no|Optional name of the account| -|paymentChannel|String|yes|Name the third party performing the payment| -|paymentBank|[Bank](#invoicepaymentbank)|yes|The bank payment is registered with| +| Name |Type| Required | Description | +|----------------------|----|----------|-----------------------------------------------------------------------------| +| paymentId |String| yes | Unique id to reference the payment with third party | +| paymentStatus |String| yes | A status a given payment is in. ISO20022 payment statuses can be used | +| paymentTime |ZonedDateTime| yes | When the payment is done | +| debtorAccount |String| yes | The debtor account for the payment. Exactly 11 digits | +| debtorAccountName |String| no | Optional name of the account | +| paymentChannel |String| yes | Name the third party performing the payment | +| paymentBank |[Bank](#invoicepaymentbank)| yes | The bank payment is registered with | +| paymentScheduledDate |ZonedDateTime| yes | When the payment is scheduled to be paid | +| referenceNumber |String| no | Optional reference number user inputted when invoice was missing KID number | ### InvoicePayment.Bank diff --git a/src/main/java/no/digipost/api/datatypes/types/invoice/InvoicePayment.java b/src/main/java/no/digipost/api/datatypes/types/invoice/InvoicePayment.java index ecbe4bb..328a1c7 100644 --- a/src/main/java/no/digipost/api/datatypes/types/invoice/InvoicePayment.java +++ b/src/main/java/no/digipost/api/datatypes/types/invoice/InvoicePayment.java @@ -55,6 +55,16 @@ public class InvoicePayment implements DataType { @NotNull Bank paymentBank; + @XmlElement(required = true, name = "payment-scheduled-date") + @Description("The date the payment is scheduled for") + @NotNull + ZonedDateTime paymentScheduledDate; + + @XmlElement(name = "reference-number") + @Description("The referenceNumber user has entered when paying the invoice for missing KID") + @NotNull + String referenceNumber; + public static final InvoicePayment EXAMPLE = new InvoicePayment( "33aa4572ac1c61d807345c5968ab1fbd" , "PDNG" @@ -63,5 +73,7 @@ public class InvoicePayment implements DataType { , null , "My pay app" , Bank.EXAMPLE + , ZonedDateTime.of(2020, 10, 1, 0, 0, 0, 0, ZoneId.of("+01:00")) + , "123123123" ); }