From 9fc85d4d847d62678ed82d80be605d76e671322b Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 9 Jul 2026 07:41:47 +0000 Subject: [PATCH 1/2] ## Java SDK Changes: * `gr4vy.transactions.create()`: * `request.transactionCreate.connectionOptions.klarnaKlarna` **Added** * `gr4vy.transactions.update()`: * `request.transactionUpdate.connectionOptions.klarnaKlarna` **Added** * `gr4vy.paymentLinks.create()`: * `request.paymentLinkCreate.connectionOptions.klarnaKlarna` **Added** --- .speakeasy/gen.lock | 53 +++- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 +- README.md | 4 +- RELEASES.md | 12 +- docs/models/components/Interval.md | 24 ++ docs/models/components/KlarnaOptions.md | 10 + .../components/KlarnaSubscriptionOptions.md | 11 + .../TransactionConnectionOptions.md | 1 + gradle.properties | 2 +- .../java/com/gr4vy/sdk/SDKConfiguration.java | 2 +- .../gr4vy/sdk/models/components/Interval.java | 140 +++++++++ .../sdk/models/components/KlarnaOptions.java | 278 ++++++++++++++++++ .../components/KlarnaSubscriptionOptions.java | 228 ++++++++++++++ .../TransactionConnectionOptions.java | 106 +++++-- 15 files changed, 835 insertions(+), 48 deletions(-) create mode 100644 docs/models/components/Interval.md create mode 100644 docs/models/components/KlarnaOptions.md create mode 100644 docs/models/components/KlarnaSubscriptionOptions.md create mode 100644 src/main/java/com/gr4vy/sdk/models/components/Interval.java create mode 100644 src/main/java/com/gr4vy/sdk/models/components/KlarnaOptions.java create mode 100644 src/main/java/com/gr4vy/sdk/models/components/KlarnaSubscriptionOptions.java diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 88984564..0b23c961 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 5bbaa3a9-baa0-471b-ba6a-13fd88e8c119 management: - docChecksum: 1036e5cd74889aed597ff34982bdedce + docChecksum: 8d7247e01970d134b7e0d625836723b8 docVersion: 1.0.0 speakeasyVersion: 1.789.0 generationVersion: 2.916.2 - releaseVersion: 2.16.105 - configChecksum: 0edd9d9804a87cffb047338ebcf84fd5 + releaseVersion: 2.16.106 + configChecksum: f537577e385dddd913d9996c35a5c5dc repoURL: https://github.com/gr4vy/gr4vy-java.git installationURL: https://github.com/gr4vy/gr4vy-java published: true persistentEdits: - generation_id: 416353e5-1f8e-4cd4-9e44-48ad96146d08 - pristine_commit_hash: 5e8f8a3d11f2525fc7eba3cdbc5a241b2cd07c4b - pristine_tree_hash: 4ec5123883093c99e0d04f41e05b1ed00aa80789 + generation_id: 8f6fc44b-8de4-4810-92f6-3ec33b13a0c3 + pristine_commit_hash: 44d202936518eab59284a0fdbd18ab17be87defb + pristine_tree_hash: c7b53470819c2f6953fa3efd81fede8add05e184 features: java: additionalDependencies: 0.1.0 @@ -680,10 +680,22 @@ trackedFiles: id: 9f574c0c0fdc last_write_checksum: sha1:77568146f2fc99efda75402f8393af1c22a7176a pristine_git_object: 46d16d922c55fa841b454e34e2ae6ec67f08e8b2 + docs/models/components/Interval.md: + id: b32c81aa9dc1 + last_write_checksum: sha1:dc618d05adba0eaca90234c5f14f90e44c38b01b + pristine_git_object: 9c75661c1c417b65e04873e40f2ffba3bce926d5 docs/models/components/Item.md: id: 30eac8fd9ebe last_write_checksum: sha1:f9ad0ada5aebce9a1668181c4262fb0b78bb2d5f pristine_git_object: 29b5862fa430f0eafcb6e9c64441d266c0c272bd + docs/models/components/KlarnaOptions.md: + id: ccd351b58195 + last_write_checksum: sha1:b3a0c8796f948b79080ed99ee9b06482e520fa0d + pristine_git_object: 031e51117abbc7bc3802c1ee5a58bae1061cf5c8 + docs/models/components/KlarnaSubscriptionOptions.md: + id: a00b285a4449 + last_write_checksum: sha1:e9fd42a2722ba91301dbd520a3a85f4664fb4a8f + pristine_git_object: c24884c42d64729da4a9f3f5273e8cb2cd9d0f3c docs/models/components/LatitudeOptions.md: id: 73a75114576b last_write_checksum: sha1:81ae3f283502c8336125a8635061f7ce831aefa2 @@ -1458,8 +1470,8 @@ trackedFiles: pristine_git_object: c388405d035a7a75986010ab970090ff6aab2600 docs/models/components/TransactionConnectionOptions.md: id: 2a90ee52a662 - last_write_checksum: sha1:d15378cf9c4f0db3545bc16bfbf97d1f928c90d9 - pristine_git_object: 4419daff4e9cd5127e872638c31b0db9cf5cd21b + last_write_checksum: sha1:83f319b92093e48deb0533cd780dd473e551cffe + pristine_git_object: 29aaa412b2b9be9353dcfceebdf8db78f911e328 docs/models/components/TransactionCreate.md: id: 0af6b811ca1f last_write_checksum: sha1:c9aa1878f78f72fc9674f20d0adff65e3e338873 @@ -2734,8 +2746,8 @@ trackedFiles: pristine_git_object: 15c4e4642f204ccb312d8814155b69e153b4e19b gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:d83f7c1346cca5687c838536c4752bd947bbfcce - pristine_git_object: f31390d6e987a6c88faa51ed403eeaa54c81bb7b + last_write_checksum: sha1:f66d226012e1eaac8b5fac7c6abdff31148e8c90 + pristine_git_object: 8fb0fcdcd97e1b720f0dbf5f95e41b07de312977 gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -3046,8 +3058,8 @@ trackedFiles: pristine_git_object: 502a7312d3dc82c102dbaf7ed5e952d0c793e26f src/main/java/com/gr4vy/sdk/SDKConfiguration.java: id: 73a7edeaca45 - last_write_checksum: sha1:14647e879e43da5bd6f638a63f2911ad8f98c5b8 - pristine_git_object: 110ff68c077e839b3a212bea2cf4c234a66281a0 + last_write_checksum: sha1:8beb271bc3d7fd15a4f1a4332a8c55ba80d8296e + pristine_git_object: 2c33d495a04a3462760b000e51574302fcce5884 src/main/java/com/gr4vy/sdk/SecuritySource.java: id: 1b6add6b9b50 last_write_checksum: sha1:2f365cc823c6243188e83f4df618c9737fcee8bd @@ -3712,10 +3724,22 @@ trackedFiles: id: 5519211d2e6e last_write_checksum: sha1:d6085e4a5ef2b435e8b775d63c195038748ae107 pristine_git_object: 651ebbce9df444fb43caad7c56bf6805b0186792 + src/main/java/com/gr4vy/sdk/models/components/Interval.java: + id: c3485f4580e8 + last_write_checksum: sha1:d9e6c963dd46d1c9414198d9b34b11f6113c199f + pristine_git_object: a3c41e3fe0022ec3d98ad351d114d97f9a25594d src/main/java/com/gr4vy/sdk/models/components/Item.java: id: 4b85e65d905b last_write_checksum: sha1:e75df0053b135eb945ca9d6c3c1eb8921dc6696a pristine_git_object: cb505308e1790e861295b4cdce98e41c22f440fb + src/main/java/com/gr4vy/sdk/models/components/KlarnaOptions.java: + id: e81c23d17dad + last_write_checksum: sha1:6f2324f47735fd4eb9f27b2f1849e1ad076a51ed + pristine_git_object: 8703b21e67b0c7ff80b075684eb882206b5bdd66 + src/main/java/com/gr4vy/sdk/models/components/KlarnaSubscriptionOptions.java: + id: ce7f2e3b74e0 + last_write_checksum: sha1:96e3fc9b6cd9c45e2198aa3fb51079c9e0346abb + pristine_git_object: fa8591333f397449fd0b53bc18827e2472340026 src/main/java/com/gr4vy/sdk/models/components/LatitudeOptions.java: id: 9ea86b7d15d2 last_write_checksum: sha1:4babca4023280c48ac08fec4b9258b4fedd5347e @@ -4494,8 +4518,8 @@ trackedFiles: pristine_git_object: 3cbc02fca6c90fc4c0783b11777e4f29b2486b2a src/main/java/com/gr4vy/sdk/models/components/TransactionConnectionOptions.java: id: 31501e4506f3 - last_write_checksum: sha1:b7b456f206682ea90d402d7ae540e520984b5fae - pristine_git_object: d82b298cbca5a5dfadb9ecdac1dc4022e5fa3e2d + last_write_checksum: sha1:2b304cd656c184f6d3f69ac71353879178bc2a83 + pristine_git_object: 0af3991a681af39dc11ed2583fdd4ab89162fba8 src/main/java/com/gr4vy/sdk/models/components/TransactionCreate.java: id: 85da9dd45d8a last_write_checksum: sha1:b79b1904811c86af216f3b4b4f183163014ad460 @@ -11880,6 +11904,7 @@ examples: application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## Java SDK Changes:\n* `gr4vy.transactions.create()`: \n * `request.transactionCreate.connectionOptions.klarnaKlarna` **Added**\n* `gr4vy.transactions.update()`: \n * `request.transactionUpdate.connectionOptions.klarnaKlarna` **Added**\n* `gr4vy.paymentLinks.create()`: \n * `request.paymentLinkCreate.connectionOptions.klarnaKlarna` **Added**\n" generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1a99b370..64578106 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 2.16.105 + version: 2.16.106 additionalDependencies: - testImplementation:org.junit.jupiter:junit-jupiter:5.10.0 - implementation:com.auth0:java-jwt:4.5.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2f909f7d..d6590367 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -9,8 +9,8 @@ sources: - 1.0.0 openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:d4fae32dd9ef9f571c993a1e3afad9f772a870f98baa8480c9086c4a0fa83845 - sourceBlobDigest: sha256:a14d63cb426d64d9dec514db4479c04b33aee8199dcf1ee96458216c014d472d + sourceRevisionDigest: sha256:67350726742537eae77d740c087f6bc9da5569c3624cd328e29c361b162d1c7d + sourceBlobDigest: sha256:3c8d5915ff412139183f1eb134e178b990e26be2f670203ef12df93201a764fb tags: - latest - 1.0.0 @@ -25,10 +25,10 @@ targets: java: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:d4fae32dd9ef9f571c993a1e3afad9f772a870f98baa8480c9086c4a0fa83845 - sourceBlobDigest: sha256:a14d63cb426d64d9dec514db4479c04b33aee8199dcf1ee96458216c014d472d + sourceRevisionDigest: sha256:67350726742537eae77d740c087f6bc9da5569c3624cd328e29c361b162d1c7d + sourceBlobDigest: sha256:3c8d5915ff412139183f1eb134e178b990e26be2f670203ef12df93201a764fb codeSamplesNamespace: openapi-java-code-samples - codeSamplesRevisionDigest: sha256:ce803968ea35d0cca5b9e484e20ff9413c3cc62a035a36acc2fda251dce9e7b2 + codeSamplesRevisionDigest: sha256:1c08eda5b308ba860b37b9c9c6f8f02c8573b671e2e0c2d1c46e085fa452ac90 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 5add3148..cd3e03b6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.gr4vy:sdk:2.16.105' +implementation 'com.gr4vy:sdk:2.16.106' ``` Maven: @@ -67,7 +67,7 @@ Maven: com.gr4vy sdk - 2.16.105 + 2.16.106 ``` diff --git a/RELEASES.md b/RELEASES.md index 169c4b36..c2172196 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1888,4 +1888,14 @@ Based on: ### Generated - [java v2.16.105] . ### Releases -- [Maven Central v2.16.105] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.105 - . \ No newline at end of file +- [Maven Central v2.16.105] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.105 - . + +## 2026-07-09 07:39:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.789.0 (2.916.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.16.106] . +### Releases +- [Maven Central v2.16.106] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.106 - . \ No newline at end of file diff --git a/docs/models/components/Interval.md b/docs/models/components/Interval.md new file mode 100644 index 00000000..9c75661c --- /dev/null +++ b/docs/models/components/Interval.md @@ -0,0 +1,24 @@ +# Interval + +The cadence unit for the subscription plan. + +## Example Usage + +```java +import com.gr4vy.sdk.models.components.Interval; + +Interval value = Interval.DAY; + +// Open enum: use .of() to create instances from custom string values +Interval custom = Interval.of("custom_value"); +``` + + +## Values + +| Name | Value | +| ------- | ------- | +| `DAY` | DAY | +| `WEEK` | WEEK | +| `MONTH` | MONTH | +| `YEAR` | YEAR | \ No newline at end of file diff --git a/docs/models/components/KlarnaOptions.md b/docs/models/components/KlarnaOptions.md new file mode 100644 index 00000000..031e5111 --- /dev/null +++ b/docs/models/components/KlarnaOptions.md @@ -0,0 +1,10 @@ +# KlarnaOptions + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `subscription` | [JsonNullable\](../../models/components/KlarnaSubscriptionOptions.md) | :heavy_minus_sign: | Provides subscription information to Klarna. | | +| `tokenOnlyMode` | *JsonNullable\* | :heavy_minus_sign: | When set to `true`, this will authorize the transaction with Klarna for the purposes of tokenizing the payment method with the transaction details. No funds will be captured and the authorization will be automatically voided. This is useful for up-sell scenarios where you want to tokenize a Klarna payment method for future use. | true | +| `authorizationToken` | *JsonNullable\* | :heavy_minus_sign: | An authorization token returned by the Klarna Express Checkout JS SDK after the buyer completes payment in the embedded widget. When provided, the connector skips the HPP redirect and places the Klarna order directly using this token. | ... | \ No newline at end of file diff --git a/docs/models/components/KlarnaSubscriptionOptions.md b/docs/models/components/KlarnaSubscriptionOptions.md new file mode 100644 index 00000000..c24884c4 --- /dev/null +++ b/docs/models/components/KlarnaSubscriptionOptions.md @@ -0,0 +1,11 @@ +# KlarnaSubscriptionOptions + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `name` | *String* | :heavy_check_mark: | The name of the subscription product. The recommended format includes a subscription id and double curly brackets. | Premium Membership {{{{12394832}}}} | +| `interval` | [Interval](../../models/components/Interval.md) | :heavy_check_mark: | The cadence unit for the subscription plan. | **Example 1:** DAY
**Example 2:** WEEK
**Example 3:** MONTH
**Example 4:** YEAR | +| `intervalCount` | *long* | :heavy_check_mark: | The number corresponding to the interval unit. | **Example 1:** 1
**Example 2:** 2
**Example 3:** 3 | +| `reference` | *String* | :heavy_check_mark: | Reference to a SKU in the transaction's cart items to link subscription to. | a0366204-2365-45fd-af60-23d0a59fdea9 | \ No newline at end of file diff --git a/docs/models/components/TransactionConnectionOptions.md b/docs/models/components/TransactionConnectionOptions.md index 4419daff..29aaa412 100644 --- a/docs/models/components/TransactionConnectionOptions.md +++ b/docs/models/components/TransactionConnectionOptions.md @@ -36,6 +36,7 @@ | `dlocalPix` | [JsonNullable\](../../models/components/DlocalPIXOptions.md) | :heavy_minus_sign: | Custom options to be passed to the `dlocal-pix` connector. | | `dlocalGcash` | [JsonNullable\](../../models/components/DlocalOptions.md) | :heavy_minus_sign: | Custom options to be passed to the `dlocal-gcash` connector. | | `ecommpayCard` | [JsonNullable\](../../models/components/EcommpayOptions.md) | :heavy_minus_sign: | Custom options to be passed to the `ecommpay-card` connector. | +| `klarnaKlarna` | [JsonNullable\](../../models/components/KlarnaOptions.md) | :heavy_minus_sign: | Custom options to be passed to the `klarna-klarna` connector. | | `fiservCard` | [JsonNullable\](../../models/components/FiservOptions.md) | :heavy_minus_sign: | Custom options to be passed to the `fiserv-card` connector. | | `forterAntiFraud` | [JsonNullable\](../../models/components/ForterAntiFraudOptions.md) | :heavy_minus_sign: | Custom options to be passed to the `forter-anti-fraud` connector. | | `gemGem` | [JsonNullable\](../../models/components/LatitudeOptions.md) | :heavy_minus_sign: | Custom options to be passed to the `gem-gem` connector. | diff --git a/gradle.properties b/gradle.properties index f31390d6..8fb0fcdc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.gr4vy artifactId=sdk -version=2.16.105 +version=2.16.106 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java index 110ff68c..2c33d495 100644 --- a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java +++ b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java @@ -22,7 +22,7 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "1.0.0"; - public static final String SDK_VERSION = "2.16.105"; + public static final String SDK_VERSION = "2.16.106"; public static final String GEN_VERSION = "2.916.2"; private static final String BASE_PACKAGE = "com.gr4vy.sdk"; public static final String USER_AGENT = diff --git a/src/main/java/com/gr4vy/sdk/models/components/Interval.java b/src/main/java/com/gr4vy/sdk/models/components/Interval.java new file mode 100644 index 00000000..a3c41e3f --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/Interval.java @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +/** + * Interval + * + *

The cadence unit for the subscription plan. + */ +public class Interval { + + public static final Interval DAY = new Interval("DAY"); + public static final Interval WEEK = new Interval("WEEK"); + public static final Interval MONTH = new Interval("MONTH"); + public static final Interval YEAR = new Interval("YEAR"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private Interval(String value) { + this.value = value; + } + + /** + * Returns a Interval with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as Interval + */ + @JsonCreator + public static Interval of(String value) { + synchronized (Interval.class) { + return values.computeIfAbsent(value, v -> new Interval(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Interval other = (Interval) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "Interval [value=" + value + "]"; + } + + // return an array just like an enum + public static Interval[] values() { + synchronized (Interval.class) { + return values.values().toArray(new Interval[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("DAY", DAY); + map.put("WEEK", WEEK); + map.put("MONTH", MONTH); + map.put("YEAR", YEAR); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("DAY", IntervalEnum.DAY); + map.put("WEEK", IntervalEnum.WEEK); + map.put("MONTH", IntervalEnum.MONTH); + map.put("YEAR", IntervalEnum.YEAR); + return map; + } + + + public enum IntervalEnum { + + DAY("DAY"), + WEEK("WEEK"), + MONTH("MONTH"), + YEAR("YEAR"),; + + private final String value; + + private IntervalEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/gr4vy/sdk/models/components/KlarnaOptions.java b/src/main/java/com/gr4vy/sdk/models/components/KlarnaOptions.java new file mode 100644 index 00000000..8703b21e --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/KlarnaOptions.java @@ -0,0 +1,278 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class KlarnaOptions { + /** + * Provides subscription information to Klarna. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subscription") + private JsonNullable subscription; + + /** + * When set to `true`, this will authorize the transaction with Klarna for the purposes of tokenizing + * the payment method with the transaction details. No funds will be captured and the authorization + * will be automatically voided. This is useful for up-sell scenarios where you want to tokenize a + * Klarna payment method for future use. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("token_only_mode") + private JsonNullable tokenOnlyMode; + + /** + * An authorization token returned by the Klarna Express Checkout JS SDK after the buyer completes + * payment in the embedded widget. When provided, the connector skips the HPP redirect and places the + * Klarna order directly using this token. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("authorization_token") + private JsonNullable authorizationToken; + + @JsonCreator + public KlarnaOptions( + @JsonProperty("subscription") JsonNullable subscription, + @JsonProperty("token_only_mode") JsonNullable tokenOnlyMode, + @JsonProperty("authorization_token") JsonNullable authorizationToken) { + Utils.checkNotNull(subscription, "subscription"); + Utils.checkNotNull(tokenOnlyMode, "tokenOnlyMode"); + Utils.checkNotNull(authorizationToken, "authorizationToken"); + this.subscription = subscription; + this.tokenOnlyMode = tokenOnlyMode; + this.authorizationToken = authorizationToken; + } + + public KlarnaOptions() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * Provides subscription information to Klarna. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subscription() { + return (JsonNullable) subscription; + } + + /** + * When set to `true`, this will authorize the transaction with Klarna for the purposes of tokenizing + * the payment method with the transaction details. No funds will be captured and the authorization + * will be automatically voided. This is useful for up-sell scenarios where you want to tokenize a + * Klarna payment method for future use. + */ + @JsonIgnore + public JsonNullable tokenOnlyMode() { + return tokenOnlyMode; + } + + /** + * An authorization token returned by the Klarna Express Checkout JS SDK after the buyer completes + * payment in the embedded widget. When provided, the connector skips the HPP redirect and places the + * Klarna order directly using this token. + */ + @JsonIgnore + public JsonNullable authorizationToken() { + return authorizationToken; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Provides subscription information to Klarna. + */ + public KlarnaOptions withSubscription(KlarnaSubscriptionOptions subscription) { + Utils.checkNotNull(subscription, "subscription"); + this.subscription = JsonNullable.of(subscription); + return this; + } + + /** + * Provides subscription information to Klarna. + */ + public KlarnaOptions withSubscription(JsonNullable subscription) { + Utils.checkNotNull(subscription, "subscription"); + this.subscription = subscription; + return this; + } + + /** + * When set to `true`, this will authorize the transaction with Klarna for the purposes of tokenizing + * the payment method with the transaction details. No funds will be captured and the authorization + * will be automatically voided. This is useful for up-sell scenarios where you want to tokenize a + * Klarna payment method for future use. + */ + public KlarnaOptions withTokenOnlyMode(boolean tokenOnlyMode) { + Utils.checkNotNull(tokenOnlyMode, "tokenOnlyMode"); + this.tokenOnlyMode = JsonNullable.of(tokenOnlyMode); + return this; + } + + /** + * When set to `true`, this will authorize the transaction with Klarna for the purposes of tokenizing + * the payment method with the transaction details. No funds will be captured and the authorization + * will be automatically voided. This is useful for up-sell scenarios where you want to tokenize a + * Klarna payment method for future use. + */ + public KlarnaOptions withTokenOnlyMode(JsonNullable tokenOnlyMode) { + Utils.checkNotNull(tokenOnlyMode, "tokenOnlyMode"); + this.tokenOnlyMode = tokenOnlyMode; + return this; + } + + /** + * An authorization token returned by the Klarna Express Checkout JS SDK after the buyer completes + * payment in the embedded widget. When provided, the connector skips the HPP redirect and places the + * Klarna order directly using this token. + */ + public KlarnaOptions withAuthorizationToken(String authorizationToken) { + Utils.checkNotNull(authorizationToken, "authorizationToken"); + this.authorizationToken = JsonNullable.of(authorizationToken); + return this; + } + + /** + * An authorization token returned by the Klarna Express Checkout JS SDK after the buyer completes + * payment in the embedded widget. When provided, the connector skips the HPP redirect and places the + * Klarna order directly using this token. + */ + public KlarnaOptions withAuthorizationToken(JsonNullable authorizationToken) { + Utils.checkNotNull(authorizationToken, "authorizationToken"); + this.authorizationToken = authorizationToken; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KlarnaOptions other = (KlarnaOptions) o; + return + Utils.enhancedDeepEquals(this.subscription, other.subscription) && + Utils.enhancedDeepEquals(this.tokenOnlyMode, other.tokenOnlyMode) && + Utils.enhancedDeepEquals(this.authorizationToken, other.authorizationToken); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + subscription, tokenOnlyMode, authorizationToken); + } + + @Override + public String toString() { + return Utils.toString(KlarnaOptions.class, + "subscription", subscription, + "tokenOnlyMode", tokenOnlyMode, + "authorizationToken", authorizationToken); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable subscription = JsonNullable.undefined(); + + private JsonNullable tokenOnlyMode = JsonNullable.undefined(); + + private JsonNullable authorizationToken = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Provides subscription information to Klarna. + */ + public Builder subscription(KlarnaSubscriptionOptions subscription) { + Utils.checkNotNull(subscription, "subscription"); + this.subscription = JsonNullable.of(subscription); + return this; + } + + /** + * Provides subscription information to Klarna. + */ + public Builder subscription(JsonNullable subscription) { + Utils.checkNotNull(subscription, "subscription"); + this.subscription = subscription; + return this; + } + + + /** + * When set to `true`, this will authorize the transaction with Klarna for the purposes of tokenizing + * the payment method with the transaction details. No funds will be captured and the authorization + * will be automatically voided. This is useful for up-sell scenarios where you want to tokenize a + * Klarna payment method for future use. + */ + public Builder tokenOnlyMode(boolean tokenOnlyMode) { + Utils.checkNotNull(tokenOnlyMode, "tokenOnlyMode"); + this.tokenOnlyMode = JsonNullable.of(tokenOnlyMode); + return this; + } + + /** + * When set to `true`, this will authorize the transaction with Klarna for the purposes of tokenizing + * the payment method with the transaction details. No funds will be captured and the authorization + * will be automatically voided. This is useful for up-sell scenarios where you want to tokenize a + * Klarna payment method for future use. + */ + public Builder tokenOnlyMode(JsonNullable tokenOnlyMode) { + Utils.checkNotNull(tokenOnlyMode, "tokenOnlyMode"); + this.tokenOnlyMode = tokenOnlyMode; + return this; + } + + + /** + * An authorization token returned by the Klarna Express Checkout JS SDK after the buyer completes + * payment in the embedded widget. When provided, the connector skips the HPP redirect and places the + * Klarna order directly using this token. + */ + public Builder authorizationToken(String authorizationToken) { + Utils.checkNotNull(authorizationToken, "authorizationToken"); + this.authorizationToken = JsonNullable.of(authorizationToken); + return this; + } + + /** + * An authorization token returned by the Klarna Express Checkout JS SDK after the buyer completes + * payment in the embedded widget. When provided, the connector skips the HPP redirect and places the + * Klarna order directly using this token. + */ + public Builder authorizationToken(JsonNullable authorizationToken) { + Utils.checkNotNull(authorizationToken, "authorizationToken"); + this.authorizationToken = authorizationToken; + return this; + } + + public KlarnaOptions build() { + + return new KlarnaOptions( + subscription, tokenOnlyMode, authorizationToken); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/KlarnaSubscriptionOptions.java b/src/main/java/com/gr4vy/sdk/models/components/KlarnaSubscriptionOptions.java new file mode 100644 index 00000000..fa859133 --- /dev/null +++ b/src/main/java/com/gr4vy/sdk/models/components/KlarnaSubscriptionOptions.java @@ -0,0 +1,228 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.gr4vy.sdk.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.gr4vy.sdk.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; + + +public class KlarnaSubscriptionOptions { + /** + * The name of the subscription product. The recommended format includes a subscription id and double + * curly brackets. + */ + @JsonProperty("name") + private String name; + + /** + * The cadence unit for the subscription plan. + */ + @JsonProperty("interval") + private Interval interval; + + /** + * The number corresponding to the interval unit. + */ + @JsonProperty("interval_count") + private long intervalCount; + + /** + * Reference to a SKU in the transaction's cart items to link subscription to. + */ + @JsonProperty("reference") + private String reference; + + @JsonCreator + public KlarnaSubscriptionOptions( + @JsonProperty("name") String name, + @JsonProperty("interval") Interval interval, + @JsonProperty("interval_count") long intervalCount, + @JsonProperty("reference") String reference) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(interval, "interval"); + Utils.checkNotNull(intervalCount, "intervalCount"); + Utils.checkNotNull(reference, "reference"); + this.name = name; + this.interval = interval; + this.intervalCount = intervalCount; + this.reference = reference; + } + + /** + * The name of the subscription product. The recommended format includes a subscription id and double + * curly brackets. + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * The cadence unit for the subscription plan. + */ + @JsonIgnore + public Interval interval() { + return interval; + } + + /** + * The number corresponding to the interval unit. + */ + @JsonIgnore + public long intervalCount() { + return intervalCount; + } + + /** + * Reference to a SKU in the transaction's cart items to link subscription to. + */ + @JsonIgnore + public String reference() { + return reference; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The name of the subscription product. The recommended format includes a subscription id and double + * curly brackets. + */ + public KlarnaSubscriptionOptions withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The cadence unit for the subscription plan. + */ + public KlarnaSubscriptionOptions withInterval(Interval interval) { + Utils.checkNotNull(interval, "interval"); + this.interval = interval; + return this; + } + + /** + * The number corresponding to the interval unit. + */ + public KlarnaSubscriptionOptions withIntervalCount(long intervalCount) { + Utils.checkNotNull(intervalCount, "intervalCount"); + this.intervalCount = intervalCount; + return this; + } + + /** + * Reference to a SKU in the transaction's cart items to link subscription to. + */ + public KlarnaSubscriptionOptions withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KlarnaSubscriptionOptions other = (KlarnaSubscriptionOptions) o; + return + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.interval, other.interval) && + Utils.enhancedDeepEquals(this.intervalCount, other.intervalCount) && + Utils.enhancedDeepEquals(this.reference, other.reference); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + name, interval, intervalCount, + reference); + } + + @Override + public String toString() { + return Utils.toString(KlarnaSubscriptionOptions.class, + "name", name, + "interval", interval, + "intervalCount", intervalCount, + "reference", reference); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String name; + + private Interval interval; + + private Long intervalCount; + + private String reference; + + private Builder() { + // force use of static builder() method + } + + + /** + * The name of the subscription product. The recommended format includes a subscription id and double + * curly brackets. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + + /** + * The cadence unit for the subscription plan. + */ + public Builder interval(Interval interval) { + Utils.checkNotNull(interval, "interval"); + this.interval = interval; + return this; + } + + + /** + * The number corresponding to the interval unit. + */ + public Builder intervalCount(long intervalCount) { + Utils.checkNotNull(intervalCount, "intervalCount"); + this.intervalCount = intervalCount; + return this; + } + + + /** + * Reference to a SKU in the transaction's cart items to link subscription to. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public KlarnaSubscriptionOptions build() { + + return new KlarnaSubscriptionOptions( + name, interval, intervalCount, + reference); + } + + } +} diff --git a/src/main/java/com/gr4vy/sdk/models/components/TransactionConnectionOptions.java b/src/main/java/com/gr4vy/sdk/models/components/TransactionConnectionOptions.java index d82b298c..0af3991a 100644 --- a/src/main/java/com/gr4vy/sdk/models/components/TransactionConnectionOptions.java +++ b/src/main/java/com/gr4vy/sdk/models/components/TransactionConnectionOptions.java @@ -234,6 +234,13 @@ public class TransactionConnectionOptions { @JsonProperty("ecommpay-card") private JsonNullable ecommpayCard; + /** + * Custom options to be passed to the `klarna-klarna` connector. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("klarna-klarna") + private JsonNullable klarnaKlarna; + /** * Custom options to be passed to the `fiserv-card` connector. */ @@ -484,6 +491,7 @@ public TransactionConnectionOptions( @JsonProperty("dlocal-pix") JsonNullable dlocalPix, @JsonProperty("dlocal-gcash") JsonNullable dlocalGcash, @JsonProperty("ecommpay-card") JsonNullable ecommpayCard, + @JsonProperty("klarna-klarna") JsonNullable klarnaKlarna, @JsonProperty("fiserv-card") JsonNullable fiservCard, @JsonProperty("forter-anti-fraud") JsonNullable forterAntiFraud, @JsonProperty("gem-gem") JsonNullable gemGem, @@ -546,6 +554,7 @@ public TransactionConnectionOptions( Utils.checkNotNull(dlocalPix, "dlocalPix"); Utils.checkNotNull(dlocalGcash, "dlocalGcash"); Utils.checkNotNull(ecommpayCard, "ecommpayCard"); + Utils.checkNotNull(klarnaKlarna, "klarnaKlarna"); Utils.checkNotNull(fiservCard, "fiservCard"); Utils.checkNotNull(forterAntiFraud, "forterAntiFraud"); Utils.checkNotNull(gemGem, "gemGem"); @@ -608,6 +617,7 @@ public TransactionConnectionOptions( this.dlocalPix = dlocalPix; this.dlocalGcash = dlocalGcash; this.ecommpayCard = ecommpayCard; + this.klarnaKlarna = klarnaKlarna; this.fiservCard = fiservCard; this.forterAntiFraud = forterAntiFraud; this.gemGem = gemGem; @@ -662,7 +672,7 @@ public TransactionConnectionOptions() { JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); } /** @@ -945,6 +955,15 @@ public JsonNullable ecommpayCard() { return (JsonNullable) ecommpayCard; } + /** + * Custom options to be passed to the `klarna-klarna` connector. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable klarnaKlarna() { + return (JsonNullable) klarnaKlarna; + } + /** * Custom options to be passed to the `fiserv-card` connector. */ @@ -1789,6 +1808,24 @@ public TransactionConnectionOptions withEcommpayCard(JsonNullable klarnaKlarna) { + Utils.checkNotNull(klarnaKlarna, "klarnaKlarna"); + this.klarnaKlarna = klarnaKlarna; + return this; + } + /** * Custom options to be passed to the `fiserv-card` connector. */ @@ -2388,6 +2425,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.dlocalPix, other.dlocalPix) && Utils.enhancedDeepEquals(this.dlocalGcash, other.dlocalGcash) && Utils.enhancedDeepEquals(this.ecommpayCard, other.ecommpayCard) && + Utils.enhancedDeepEquals(this.klarnaKlarna, other.klarnaKlarna) && Utils.enhancedDeepEquals(this.fiservCard, other.fiservCard) && Utils.enhancedDeepEquals(this.forterAntiFraud, other.forterAntiFraud) && Utils.enhancedDeepEquals(this.gemGem, other.gemGem) && @@ -2434,17 +2472,17 @@ public int hashCode() { chaseorbitalCard, cybersourceAntiFraud, cybersourceCard, cybersourceIdeal, cybersourceKcp, dlocalNequi, dlocalUpi, dlocalPix, dlocalGcash, - ecommpayCard, fiservCard, forterAntiFraud, - gemGem, gemGemds, givingblockGivingblock, - gocardlessGocardless, latitudeLatitude, latitudeLatitudeds, - mattildaTapi, mattildaTapifintechs, monatoSpei, - mockCard, mockdsCard, nuveiCard, - nuveiIdeal, nuveiKlarna, nuveiPse, - oxxoOxxo, paypalPaypal, paypalPaypalpaylater, - powertranzCard, riskifiedAntiFraud, stripeAffirm, - stripeCard, stripeKlarna, stripeOnelink, - stripeStripe, travelhubCard, trustlyTrustly, - wpayEverydaypay, wpayPayto); + ecommpayCard, klarnaKlarna, fiservCard, + forterAntiFraud, gemGem, gemGemds, + givingblockGivingblock, gocardlessGocardless, latitudeLatitude, + latitudeLatitudeds, mattildaTapi, mattildaTapifintechs, + monatoSpei, mockCard, mockdsCard, + nuveiCard, nuveiIdeal, nuveiKlarna, + nuveiPse, oxxoOxxo, paypalPaypal, + paypalPaypalpaylater, powertranzCard, riskifiedAntiFraud, + stripeAffirm, stripeCard, stripeKlarna, + stripeOnelink, stripeStripe, travelhubCard, + trustlyTrustly, wpayEverydaypay, wpayPayto); } @Override @@ -2481,6 +2519,7 @@ public String toString() { "dlocalPix", dlocalPix, "dlocalGcash", dlocalGcash, "ecommpayCard", ecommpayCard, + "klarnaKlarna", klarnaKlarna, "fiservCard", fiservCard, "forterAntiFraud", forterAntiFraud, "gemGem", gemGem, @@ -2579,6 +2618,8 @@ public final static class Builder { private JsonNullable ecommpayCard = JsonNullable.undefined(); + private JsonNullable klarnaKlarna = JsonNullable.undefined(); + private JsonNullable fiservCard = JsonNullable.undefined(); private JsonNullable forterAntiFraud = JsonNullable.undefined(); @@ -3237,6 +3278,25 @@ public Builder ecommpayCard(JsonNullable ecommpayCard } + /** + * Custom options to be passed to the `klarna-klarna` connector. + */ + public Builder klarnaKlarna(KlarnaOptions klarnaKlarna) { + Utils.checkNotNull(klarnaKlarna, "klarnaKlarna"); + this.klarnaKlarna = JsonNullable.of(klarnaKlarna); + return this; + } + + /** + * Custom options to be passed to the `klarna-klarna` connector. + */ + public Builder klarnaKlarna(JsonNullable klarnaKlarna) { + Utils.checkNotNull(klarnaKlarna, "klarnaKlarna"); + this.klarnaKlarna = klarnaKlarna; + return this; + } + + /** * Custom options to be passed to the `fiserv-card` connector. */ @@ -3838,17 +3898,17 @@ public TransactionConnectionOptions build() { chaseorbitalCard, cybersourceAntiFraud, cybersourceCard, cybersourceIdeal, cybersourceKcp, dlocalNequi, dlocalUpi, dlocalPix, dlocalGcash, - ecommpayCard, fiservCard, forterAntiFraud, - gemGem, gemGemds, givingblockGivingblock, - gocardlessGocardless, latitudeLatitude, latitudeLatitudeds, - mattildaTapi, mattildaTapifintechs, monatoSpei, - mockCard, mockdsCard, nuveiCard, - nuveiIdeal, nuveiKlarna, nuveiPse, - oxxoOxxo, paypalPaypal, paypalPaypalpaylater, - powertranzCard, riskifiedAntiFraud, stripeAffirm, - stripeCard, stripeKlarna, stripeOnelink, - stripeStripe, travelhubCard, trustlyTrustly, - wpayEverydaypay, wpayPayto); + ecommpayCard, klarnaKlarna, fiservCard, + forterAntiFraud, gemGem, gemGemds, + givingblockGivingblock, gocardlessGocardless, latitudeLatitude, + latitudeLatitudeds, mattildaTapi, mattildaTapifintechs, + monatoSpei, mockCard, mockdsCard, + nuveiCard, nuveiIdeal, nuveiKlarna, + nuveiPse, oxxoOxxo, paypalPaypal, + paypalPaypalpaylater, powertranzCard, riskifiedAntiFraud, + stripeAffirm, stripeCard, stripeKlarna, + stripeOnelink, stripeStripe, travelhubCard, + trustlyTrustly, wpayEverydaypay, wpayPayto); } } From 545fb42093f31aaee594e62236bc5affdbd7dcfc Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Thu, 9 Jul 2026 07:42:07 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow