diff --git a/openapi.json b/openapi.json index 4153d4a..4e287cb 100755 --- a/openapi.json +++ b/openapi.json @@ -2148,7 +2148,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/EntryModeFilter" + "$ref": "#/components/schemas/EntryMode" } } }, @@ -5959,7 +5959,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/EntryModeFilter" + "$ref": "#/components/schemas/EntryMode" } } }, @@ -7202,6 +7202,21 @@ }, "title": "Receipt Card" }, + "ReceiptReader": { + "description": "Card reader details displayed on the receipt.", + "type": "object", + "properties": { + "code": { + "description": "Reader serial number.", + "type": "string" + }, + "type": { + "description": "Reader type.", + "type": "string" + } + }, + "title": "Receipt Reader" + }, "ReceiptMerchantData": { "description": "Receipt merchant data", "type": "object", @@ -7217,15 +7232,30 @@ "business_name": { "type": "string" }, + "company_registration_number": { + "type": "string" + }, + "vat_id": { + "type": "string" + }, + "website": { + "type": "string" + }, "email": { "type": "string" }, + "language": { + "type": "string" + }, "address": { "type": "object", "properties": { "address_line1": { "type": "string" }, + "address_line2": { + "type": "string" + }, "city": { "type": "string" }, @@ -7238,6 +7268,9 @@ "country_native_name": { "type": "string" }, + "region_name": { + "type": "string" + }, "post_code": { "type": "string" }, @@ -7263,6 +7296,13 @@ "description": "Transaction code.", "type": "string" }, + "transaction_id": { + "$ref": "#/components/schemas/TransactionID" + }, + "merchant_code": { + "description": "Merchant code.", + "type": "string" + }, "amount": { "description": "Transaction amount.", "type": "string" @@ -7300,6 +7340,9 @@ "description": "Cardholder verification method.", "type": "string" }, + "card_reader": { + "$ref": "#/components/schemas/ReceiptReader" + }, "card": { "$ref": "#/components/schemas/ReceiptCard" }, @@ -7307,6 +7350,15 @@ "description": "Number of installments.", "type": "integer" }, + "process_as": { + "description": "Debit/Credit.", + "type": "string", + "example": "CREDIT", + "enum": [ + "CREDIT", + "DEBIT" + ] + }, "products": { "description": "Products", "type": "array", @@ -7318,6 +7370,10 @@ "type": "string", "example": "Coffee" }, + "description": { + "description": "Product description", + "type": "string" + }, "price": { "description": "Product price", "type": "string", @@ -7657,33 +7713,33 @@ "description": "Entry mode of the payment details.", "type": "string", "enum": [ - "none", - "magstripe", - "chip", - "manual entry", - "customer entry", - "magstripe fallback", - "contactless", - "moto", - "contactless magstripe", - "boleto", - "direct debit", - "sofort", - "ideal", - "bancontact", - "eps", - "mybank", - "satispay", - "blik", - "p24", - "giropay", - "pix", - "qr code pix", - "apple pay", - "google pay", - "paypal", - "twint", - "na" + "BOLETO", + "SOFORT", + "IDEAL", + "BANCONTACT", + "EPS", + "MYBANK", + "SATISPAY", + "BLIK", + "P24", + "GIROPAY", + "PIX", + "QR_CODE_PIX", + "APPLE_PAY", + "GOOGLE_PAY", + "PAYPAL", + "TWINT", + "NONE", + "CHIP", + "MANUAL_ENTRY", + "CUSTOMER_ENTRY", + "MAGSTRIPE_FALLBACK", + "MAGSTRIPE", + "DIRECT_DEBIT", + "CONTACTLESS", + "MOTO", + "CONTACTLESS_MAGSTRIPE", + "N/A" ], "title": "Entry Mode" }, @@ -8734,7 +8790,7 @@ "avatar": { "description": "A user-facing small-format logo for use in dashboards and other user-facing applications. For customer-facing branding see `merchant.business_profile.branding`.\n", "type": "string", - "format": "url" + "format": "uri" }, "alias": { "description": "A user-facing name of the merchant account for use in dashboards and other user-facing applications. For customer-facing business name see `merchant.business_profile`.\n", @@ -8792,7 +8848,8 @@ "description": "The company's legal name.", "type": "string", "example": "Gin & Doughnuts Bar GmbH", - "maxLength": 512 + "maxLength": 150, + "minLength": 1 }, "merchant_category_code": { "description": "The merchant category code for the account as specified by [ISO18245](https://www.iso.org/standard/33365.html). MCCs are used to classify businesses based on the goods or services they provide.\n", @@ -8818,6 +8875,7 @@ "website": { "description": "HTTP(S) URL of the company's website.\n", "type": "string", + "format": "uri", "examples": [ "https://www.sumup.com" ], @@ -8850,26 +8908,29 @@ "description": "The customer-facing business name.", "type": "string", "example": "Example Coffee", - "maxLength": 512 + "maxLength": 150, + "minLength": 1 }, "dynamic_descriptor": { "description": "The descriptor is the text that your customer sees on their bank account statement.\nThe more recognisable your descriptor is, the less risk you have of receiving disputes (e.g. chargebacks).\n", "type": "string", "example": "Example Coffee", "maxLength": 30, + "minLength": 1, "pattern": "^[a-zA-Z0-9 \\-+\\'_.]{0,30}$" }, "website": { "description": "The business's publicly available website.", "type": "string", + "format": "uri", "example": "https://example.com", - "maxLength": 512 + "maxLength": 255 }, "email": { "description": "A publicly available email address.", "type": "string", "example": "contact@example.com", - "maxLength": 256 + "maxLength": 255 }, "phone_number": { "$ref": "#/components/schemas/PhoneNumber" @@ -8893,7 +8954,7 @@ "description": "A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.\n", "type": "string", "example": "+420123456789", - "maxLength": 64 + "maxLength": 16 }, "Branding": { "description": "Settings used to apply the Merchant's branding to email receipts, invoices, checkouts, and other products.", @@ -9932,10 +9993,6 @@ "description": "Country ISO 3166-1 code", "type": "string" }, - "region_id": { - "description": "Country region id", - "type": "number" - }, "region_name": { "description": "Country region name", "type": "string" @@ -10023,10 +10080,6 @@ "description": "Country ISO 3166-1 code", "type": "string" }, - "region_id": { - "description": "Country region id", - "type": "number" - }, "region_name": { "description": "Region name", "type": "string" @@ -10439,40 +10492,6 @@ } }, "title": "Personal Profile Legacy" - }, - "EntryModeFilter": { - "description": "Entry mode value accepted by the `entry_modes[]` filter.", - "type": "string", - "enum": [ - "BOLETO", - "SOFORT", - "IDEAL", - "BANCONTACT", - "EPS", - "MYBANK", - "SATISPAY", - "BLIK", - "P24", - "GIROPAY", - "PIX", - "QR_CODE_PIX", - "APPLE_PAY", - "GOOGLE_PAY", - "PAYPAL", - "TWINT", - "NONE", - "CHIP", - "MANUAL_ENTRY", - "CUSTOMER_ENTRY", - "MAGSTRIPE_FALLBACK", - "MAGSTRIPE", - "DIRECT_DEBIT", - "CONTACTLESS", - "MOTO", - "CONTACTLESS_MAGSTRIPE", - "N/A" - ], - "title": "Entry Mode Filter" } }, "examples": { diff --git a/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java b/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java index a02ba07..cfa69cf 100644 --- a/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/TransactionsAsyncClient.java @@ -679,7 +679,7 @@ public ListTransactionsV21QueryParams changesSince(java.time.OffsetDateTime valu * @return This ListTransactionsV21QueryParams instance. */ public ListTransactionsV21QueryParams entryModes( - java.util.List value) { + java.util.List value) { this.values.put("entry_modes[]", Objects.requireNonNull(value, "entryModes")); return this; } diff --git a/src/main/java/com/sumup/sdk/clients/TransactionsClient.java b/src/main/java/com/sumup/sdk/clients/TransactionsClient.java index 6b4c061..e32404d 100644 --- a/src/main/java/com/sumup/sdk/clients/TransactionsClient.java +++ b/src/main/java/com/sumup/sdk/clients/TransactionsClient.java @@ -667,7 +667,7 @@ public ListTransactionsV21QueryParams changesSince(java.time.OffsetDateTime valu * @return This ListTransactionsV21QueryParams instance. */ public ListTransactionsV21QueryParams entryModes( - java.util.List value) { + java.util.List value) { this.values.put("entry_modes[]", Objects.requireNonNull(value, "entryModes")); return this; } diff --git a/src/main/java/com/sumup/sdk/models/AddressPayloadLegacy.java b/src/main/java/com/sumup/sdk/models/AddressPayloadLegacy.java index 7b71ce1..10b8412 100644 --- a/src/main/java/com/sumup/sdk/models/AddressPayloadLegacy.java +++ b/src/main/java/com/sumup/sdk/models/AddressPayloadLegacy.java @@ -32,9 +32,6 @@ public record AddressPayloadLegacy( /** Postal code */ String postCode, - /** Country region id */ - Double regionId, - /** Country region name */ String regionName) { /** @@ -57,7 +54,6 @@ public static final class Builder { private String landline; private String lastName; private String postCode; - private Double regionId; private String regionName; private Builder() {} @@ -161,17 +157,6 @@ public Builder postCode(String postCode) { return this; } - /** - * Sets the value for {@code regionId}. - * - * @param regionId Country region id - * @return This builder instance. - */ - public Builder regionId(Double regionId) { - this.regionId = regionId; - return this; - } - /** * Sets the value for {@code regionName}. * @@ -199,7 +184,6 @@ public AddressPayloadLegacy build() { landline, lastName, Objects.requireNonNull(postCode, "postCode"), - regionId, regionName); } } diff --git a/src/main/java/com/sumup/sdk/models/AddressWithDetails.java b/src/main/java/com/sumup/sdk/models/AddressWithDetails.java index 213b8eb..b43fdcc 100644 --- a/src/main/java/com/sumup/sdk/models/AddressWithDetails.java +++ b/src/main/java/com/sumup/sdk/models/AddressWithDetails.java @@ -36,9 +36,6 @@ public record AddressWithDetails( /** Region code */ String regionCode, - /** Country region id */ - Double regionId, - /** Region name */ String regionName, @@ -69,7 +66,6 @@ public static final class Builder { private String lastName; private String postCode; private String regionCode; - private Double regionId; private String regionName; private String stateId; private com.sumup.sdk.models.TimeoffsetDetails timeoffsetDetails; @@ -197,17 +193,6 @@ public Builder regionCode(String regionCode) { return this; } - /** - * Sets the value for {@code regionId}. - * - * @param regionId Country region id - * @return This builder instance. - */ - public Builder regionId(Double regionId) { - this.regionId = regionId; - return this; - } - /** * Sets the value for {@code regionName}. * @@ -259,7 +244,6 @@ public AddressWithDetails build() { lastName, postCode, regionCode, - regionId, regionName, stateId, timeoffsetDetails); diff --git a/src/main/java/com/sumup/sdk/models/EntryMode.java b/src/main/java/com/sumup/sdk/models/EntryMode.java index 492a3ca..71a9faa 100644 --- a/src/main/java/com/sumup/sdk/models/EntryMode.java +++ b/src/main/java/com/sumup/sdk/models/EntryMode.java @@ -6,33 +6,33 @@ /** Entry mode of the payment details. */ public enum EntryMode { - NONE("none"), - MAGSTRIPE("magstripe"), - CHIP("chip"), - MANUAL_ENTRY("manual entry"), - CUSTOMER_ENTRY("customer entry"), - MAGSTRIPE_FALLBACK("magstripe fallback"), - CONTACTLESS("contactless"), - MOTO("moto"), - CONTACTLESS_MAGSTRIPE("contactless magstripe"), - BOLETO("boleto"), - DIRECT_DEBIT("direct debit"), - SOFORT("sofort"), - IDEAL("ideal"), - BANCONTACT("bancontact"), - EPS("eps"), - MYBANK("mybank"), - SATISPAY("satispay"), - BLIK("blik"), - P24("p24"), - GIROPAY("giropay"), - PIX("pix"), - QR_CODE_PIX("qr code pix"), - APPLE_PAY("apple pay"), - GOOGLE_PAY("google pay"), - PAYPAL("paypal"), - TWINT("twint"), - NA("na"); + BOLETO("BOLETO"), + SOFORT("SOFORT"), + IDEAL("IDEAL"), + BANCONTACT("BANCONTACT"), + EPS("EPS"), + MYBANK("MYBANK"), + SATISPAY("SATISPAY"), + BLIK("BLIK"), + P24("P24"), + GIROPAY("GIROPAY"), + PIX("PIX"), + QR_CODE_PIX("QR_CODE_PIX"), + APPLE_PAY("APPLE_PAY"), + GOOGLE_PAY("GOOGLE_PAY"), + PAYPAL("PAYPAL"), + TWINT("TWINT"), + NONE("NONE"), + CHIP("CHIP"), + MANUAL_ENTRY("MANUAL_ENTRY"), + CUSTOMER_ENTRY("CUSTOMER_ENTRY"), + MAGSTRIPE_FALLBACK("MAGSTRIPE_FALLBACK"), + MAGSTRIPE("MAGSTRIPE"), + DIRECT_DEBIT("DIRECT_DEBIT"), + CONTACTLESS("CONTACTLESS"), + MOTO("MOTO"), + CONTACTLESS_MAGSTRIPE("CONTACTLESS_MAGSTRIPE"), + N_A("N/A"); private final String value; diff --git a/src/main/java/com/sumup/sdk/models/EntryModeFilter.java b/src/main/java/com/sumup/sdk/models/EntryModeFilter.java deleted file mode 100644 index d6b4c75..0000000 --- a/src/main/java/com/sumup/sdk/models/EntryModeFilter.java +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Entry mode value accepted by the `entry_modes[]` filter. */ -public enum EntryModeFilter { - BOLETO("BOLETO"), - SOFORT("SOFORT"), - IDEAL("IDEAL"), - BANCONTACT("BANCONTACT"), - EPS("EPS"), - MYBANK("MYBANK"), - SATISPAY("SATISPAY"), - BLIK("BLIK"), - P24("P24"), - GIROPAY("GIROPAY"), - PIX("PIX"), - QR_CODE_PIX("QR_CODE_PIX"), - APPLE_PAY("APPLE_PAY"), - GOOGLE_PAY("GOOGLE_PAY"), - PAYPAL("PAYPAL"), - TWINT("TWINT"), - NONE("NONE"), - CHIP("CHIP"), - MANUAL_ENTRY("MANUAL_ENTRY"), - CUSTOMER_ENTRY("CUSTOMER_ENTRY"), - MAGSTRIPE_FALLBACK("MAGSTRIPE_FALLBACK"), - MAGSTRIPE("MAGSTRIPE"), - DIRECT_DEBIT("DIRECT_DEBIT"), - CONTACTLESS("CONTACTLESS"), - MOTO("MOTO"), - CONTACTLESS_MAGSTRIPE("CONTACTLESS_MAGSTRIPE"), - N_A("N/A"); - - private final String value; - - EntryModeFilter(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return value; - } - - @JsonCreator - public static EntryModeFilter fromValue(String value) { - if (value == null) { - return null; - } - for (EntryModeFilter entry : values()) { - if (entry.value.equals(value)) { - return entry; - } - } - throw new IllegalArgumentException("Unknown EntryModeFilter value: " + value); - } -} diff --git a/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfile.java b/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfile.java index 18a8591..a2dfafc 100644 --- a/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfile.java +++ b/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfile.java @@ -5,8 +5,12 @@ public record ReceiptMerchantDataMerchantProfile( com.sumup.sdk.models.ReceiptMerchantDataMerchantProfileAddress address, String businessName, + String companyRegistrationNumber, String email, - String merchantCode) { + String language, + String merchantCode, + String vatId, + String website) { /** * Creates a builder for ReceiptMerchantDataMerchantProfile. * @@ -20,8 +24,12 @@ public static Builder builder() { public static final class Builder { private com.sumup.sdk.models.ReceiptMerchantDataMerchantProfileAddress address; private String businessName; + private String companyRegistrationNumber; private String email; + private String language; private String merchantCode; + private String vatId; + private String website; private Builder() {} @@ -47,6 +55,17 @@ public Builder businessName(String businessName) { return this; } + /** + * Sets the value for {@code companyRegistrationNumber}. + * + * @param companyRegistrationNumber Value for the companyRegistrationNumber field. + * @return This builder instance. + */ + public Builder companyRegistrationNumber(String companyRegistrationNumber) { + this.companyRegistrationNumber = companyRegistrationNumber; + return this; + } + /** * Sets the value for {@code email}. * @@ -58,6 +77,17 @@ public Builder email(String email) { return this; } + /** + * Sets the value for {@code language}. + * + * @param language Value for the language field. + * @return This builder instance. + */ + public Builder language(String language) { + this.language = language; + return this; + } + /** * Sets the value for {@code merchantCode}. * @@ -69,13 +99,43 @@ public Builder merchantCode(String merchantCode) { return this; } + /** + * Sets the value for {@code vatId}. + * + * @param vatId Value for the vatId field. + * @return This builder instance. + */ + public Builder vatId(String vatId) { + this.vatId = vatId; + return this; + } + + /** + * Sets the value for {@code website}. + * + * @param website Value for the website field. + * @return This builder instance. + */ + public Builder website(String website) { + this.website = website; + return this; + } + /** * Builds an immutable ReceiptMerchantDataMerchantProfile instance. * * @return Immutable ReceiptMerchantDataMerchantProfile. */ public ReceiptMerchantDataMerchantProfile build() { - return new ReceiptMerchantDataMerchantProfile(address, businessName, email, merchantCode); + return new ReceiptMerchantDataMerchantProfile( + address, + businessName, + companyRegistrationNumber, + email, + language, + merchantCode, + vatId, + website); } } } diff --git a/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfileAddress.java b/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfileAddress.java index b6df129..8fed159 100644 --- a/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfileAddress.java +++ b/src/main/java/com/sumup/sdk/models/ReceiptMerchantDataMerchantProfileAddress.java @@ -3,12 +3,14 @@ public record ReceiptMerchantDataMerchantProfileAddress( String addressLine1, + String addressLine2, String city, String country, String countryEnName, String countryNativeName, String landline, - String postCode) { + String postCode, + String regionName) { /** * Creates a builder for ReceiptMerchantDataMerchantProfileAddress. * @@ -21,12 +23,14 @@ public static Builder builder() { /** Builder for ReceiptMerchantDataMerchantProfileAddress instances. */ public static final class Builder { private String addressLine1; + private String addressLine2; private String city; private String country; private String countryEnName; private String countryNativeName; private String landline; private String postCode; + private String regionName; private Builder() {} @@ -41,6 +45,17 @@ public Builder addressLine1(String addressLine1) { return this; } + /** + * Sets the value for {@code addressLine2}. + * + * @param addressLine2 Value for the addressLine2 field. + * @return This builder instance. + */ + public Builder addressLine2(String addressLine2) { + this.addressLine2 = addressLine2; + return this; + } + /** * Sets the value for {@code city}. * @@ -107,6 +122,17 @@ public Builder postCode(String postCode) { return this; } + /** + * Sets the value for {@code regionName}. + * + * @param regionName Value for the regionName field. + * @return This builder instance. + */ + public Builder regionName(String regionName) { + this.regionName = regionName; + return this; + } + /** * Builds an immutable ReceiptMerchantDataMerchantProfileAddress instance. * @@ -114,7 +140,15 @@ public Builder postCode(String postCode) { */ public ReceiptMerchantDataMerchantProfileAddress build() { return new ReceiptMerchantDataMerchantProfileAddress( - addressLine1, city, country, countryEnName, countryNativeName, landline, postCode); + addressLine1, + addressLine2, + city, + country, + countryEnName, + countryNativeName, + landline, + postCode, + regionName); } } } diff --git a/src/main/java/com/sumup/sdk/models/ReceiptReader.java b/src/main/java/com/sumup/sdk/models/ReceiptReader.java new file mode 100644 index 0000000..0b1d6fd --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ReceiptReader.java @@ -0,0 +1,58 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** Card reader details displayed on the receipt. */ +public record ReceiptReader( + /** Reader serial number. */ + String code, + + /** Reader type. */ + String type) { + /** + * Creates a builder for ReceiptReader. + * + * @return Builder that constructs immutable ReceiptReader instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ReceiptReader instances. */ + public static final class Builder { + private String code; + private String type; + + private Builder() {} + + /** + * Sets the value for {@code code}. + * + * @param code Reader serial number. + * @return This builder instance. + */ + public Builder code(String code) { + this.code = code; + return this; + } + + /** + * Sets the value for {@code type}. + * + * @param type Reader type. + * @return This builder instance. + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Builds an immutable ReceiptReader instance. + * + * @return Immutable ReceiptReader. + */ + public ReceiptReader build() { + return new ReceiptReader(code, type); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/ReceiptTransaction.java b/src/main/java/com/sumup/sdk/models/ReceiptTransaction.java index b4c0a54..4421a02 100644 --- a/src/main/java/com/sumup/sdk/models/ReceiptTransaction.java +++ b/src/main/java/com/sumup/sdk/models/ReceiptTransaction.java @@ -9,6 +9,9 @@ public record ReceiptTransaction( /** Payment card details displayed on the receipt. */ com.sumup.sdk.models.ReceiptCard card, + /** Card reader details displayed on the receipt. */ + com.sumup.sdk.models.ReceiptReader cardReader, + /** Transaction currency. */ String currency, @@ -21,9 +24,15 @@ public record ReceiptTransaction( /** Number of installments. */ Long installmentsCount, + /** Merchant code. */ + String merchantCode, + /** Transaction type. */ String paymentType, + /** Debit/Credit. */ + com.sumup.sdk.models.ReceiptTransactionProcessAs processAs, + /** Products */ java.util.List products, @@ -42,6 +51,9 @@ public record ReceiptTransaction( /** Transaction code. */ String transactionCode, + /** Unique ID of the transaction. */ + com.sumup.sdk.models.TransactionId transactionId, + /** Transaction VAT amount. */ String vatAmount, @@ -63,17 +75,21 @@ public static Builder builder() { public static final class Builder { private String amount; private com.sumup.sdk.models.ReceiptCard card; + private com.sumup.sdk.models.ReceiptReader cardReader; private String currency; private String entryMode; private java.util.List events; private Long installmentsCount; + private String merchantCode; private String paymentType; + private com.sumup.sdk.models.ReceiptTransactionProcessAs processAs; private java.util.List products; private String receiptNo; private String status; private java.time.OffsetDateTime timestamp; private String tipAmount; private String transactionCode; + private com.sumup.sdk.models.TransactionId transactionId; private String vatAmount; private java.util.List vatRates; private String verificationMethod; @@ -102,6 +118,17 @@ public Builder card(com.sumup.sdk.models.ReceiptCard card) { return this; } + /** + * Sets the value for {@code cardReader}. + * + * @param cardReader Card reader details displayed on the receipt. + * @return This builder instance. + */ + public Builder cardReader(com.sumup.sdk.models.ReceiptReader cardReader) { + this.cardReader = cardReader; + return this; + } + /** * Sets the value for {@code currency}. * @@ -146,6 +173,17 @@ public Builder installmentsCount(Long installmentsCount) { return this; } + /** + * Sets the value for {@code merchantCode}. + * + * @param merchantCode Merchant code. + * @return This builder instance. + */ + public Builder merchantCode(String merchantCode) { + this.merchantCode = merchantCode; + return this; + } + /** * Sets the value for {@code paymentType}. * @@ -157,6 +195,17 @@ public Builder paymentType(String paymentType) { return this; } + /** + * Sets the value for {@code processAs}. + * + * @param processAs Debit/Credit. + * @return This builder instance. + */ + public Builder processAs(com.sumup.sdk.models.ReceiptTransactionProcessAs processAs) { + this.processAs = processAs; + return this; + } + /** * Sets the value for {@code products}. * @@ -224,6 +273,17 @@ public Builder transactionCode(String transactionCode) { return this; } + /** + * Sets the value for {@code transactionId}. + * + * @param transactionId Unique ID of the transaction. + * @return This builder instance. + */ + public Builder transactionId(com.sumup.sdk.models.TransactionId transactionId) { + this.transactionId = transactionId; + return this; + } + /** * Sets the value for {@code vatAmount}. * @@ -267,17 +327,21 @@ public ReceiptTransaction build() { return new ReceiptTransaction( amount, card, + cardReader, currency, entryMode, events, installmentsCount, + merchantCode, paymentType, + processAs, products, receiptNo, status, timestamp, tipAmount, transactionCode, + transactionId, vatAmount, vatRates, verificationMethod); diff --git a/src/main/java/com/sumup/sdk/models/ReceiptTransactionProcessAs.java b/src/main/java/com/sumup/sdk/models/ReceiptTransactionProcessAs.java new file mode 100644 index 0000000..237499f --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ReceiptTransactionProcessAs.java @@ -0,0 +1,40 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Debit/Credit. */ +public enum ReceiptTransactionProcessAs { + CREDIT("CREDIT"), + DEBIT("DEBIT"); + + private final String value; + + ReceiptTransactionProcessAs(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static ReceiptTransactionProcessAs fromValue(String value) { + if (value == null) { + return null; + } + for (ReceiptTransactionProcessAs entry : values()) { + if (entry.value.equals(value)) { + return entry; + } + } + throw new IllegalArgumentException("Unknown ReceiptTransactionProcessAs value: " + value); + } +} diff --git a/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java b/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java index df7dbba..a5af95d 100644 --- a/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java +++ b/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java @@ -2,6 +2,9 @@ package com.sumup.sdk.models; public record ReceiptTransactionProductsItem( + /** Product description */ + String description, + /** Product name */ String name, @@ -39,6 +42,7 @@ public static Builder builder() { /** Builder for ReceiptTransactionProductsItem instances. */ public static final class Builder { + private String description; private String name; private String price; private String priceWithVat; @@ -51,6 +55,17 @@ public static final class Builder { private Builder() {} + /** + * Sets the value for {@code description}. + * + * @param description Product description + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + /** * Sets the value for {@code name}. * @@ -157,6 +172,7 @@ public Builder vatRate(String vatRate) { */ public ReceiptTransactionProductsItem build() { return new ReceiptTransactionProductsItem( + description, name, price, priceWithVat,