Skip to content

Commit 33f8567

Browse files
committed
seal
1 parent 2e0a117 commit 33f8567

58 files changed

Lines changed: 5782 additions & 113 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21-
RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
21+
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
2222
SONATYPE_USERNAME: ${{ secrets.DODO_PAYMENTS_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
2323
SONATYPE_PASSWORD: ${{ secrets.DODO_PAYMENTS_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
2424
GPG_SIGNING_KEY: ${{ secrets.DODO_PAYMENTS_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}

.github/workflows/release-please.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
workflow_dispatch:
67

78
permissions:
89
contents: write
@@ -14,7 +15,13 @@ jobs:
1415
runs-on: ubuntu-latest
1516

1617
steps:
18+
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
19+
id: app-token
20+
with:
21+
client-id: ${{ vars.APP_CLIENT_ID }}
22+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
23+
1724
- uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1
1825
id: release
1926
with:
20-
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
27+
token: ${{ steps.app-token.outputs.token }}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.99.1"
2+
".": "1.102.0"
33
}

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,26 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.dodopayments.api/dodo-payments-java)](https://central.sonatype.com/artifact/com.dodopayments.api/dodo-payments-java/1.99.1)
6-
[![javadoc](https://javadoc.io/badge2/com.dodopayments.api/dodo-payments-java/1.99.1/javadoc.svg)](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-java/1.99.1)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.dodopayments.api/dodo-payments-java)](https://central.sonatype.com/artifact/com.dodopayments.api/dodo-payments-java/1.102.0)
6+
[![javadoc](https://javadoc.io/badge2/com.dodopayments.api/dodo-payments-java/1.102.0/javadoc.svg)](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-java/1.102.0)
77

88
<!-- x-release-please-end -->
99

1010
The Dodo Payments Java SDK provides convenient access to the [Dodo Payments REST API](https://docs.dodopayments.com/api-reference/introduction) from applications written in Java.
1111

1212
The Dodo Payments Java SDK is similar to the Dodo Payments Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.
1313

14-
It is generated with [Stainless](https://www.stainless.com/).
15-
1614
## MCP Server
1715

1816
Use the Dodo Payments MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
1917

2018
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=dodopayments-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImRvZG9wYXltZW50cy1tY3AiXSwiZW52Ijp7IkRPRE9fUEFZTUVOVFNfQVBJX0tFWSI6Ik15IEJlYXJlciBUb2tlbiIsIkRPRE9fUEFZTUVOVFNfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)
21-
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22dodopayments-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22dodopayments-mcp%22%5D%2C%22env%22%3A%7B%22DODO_PAYMENTS_API_KEY%22%3A%22My%20Bearer%20Token%22%2C%22DODO_PAYMENTS_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)
2219

2320
> Note: You may need to set environment variables in your MCP client.
2421
2522
<!-- x-release-please-start-version -->
2623

27-
The REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-java/1.99.1).
24+
The REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-java/1.102.0).
2825

2926
<!-- x-release-please-end -->
3027

@@ -35,7 +32,7 @@ The REST API documentation can be found on [docs.dodopayments.com](https://docs.
3532
### Gradle
3633

3734
```kotlin
38-
implementation("com.dodopayments.api:dodo-payments-java:1.99.1")
35+
implementation("com.dodopayments.api:dodo-payments-java:1.102.0")
3936
```
4037

4138
### Maven
@@ -44,7 +41,7 @@ implementation("com.dodopayments.api:dodo-payments-java:1.99.1")
4441
<dependency>
4542
<groupId>com.dodopayments.api</groupId>
4643
<artifactId>dodo-payments-java</artifactId>
47-
<version>1.99.1</version>
44+
<version>1.102.0</version>
4845
</dependency>
4946
```
5047

@@ -833,7 +830,7 @@ DodoPaymentsClient client = DodoPaymentsOkHttpClient.builder()
833830

834831
### Why don't you use plain `enum` classes?
835832

836-
Java `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.
833+
Java `enum` classes are not trivially forwards compatible. Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.
837834

838835
### Why do you represent fields using `JsonField<T>` instead of just plain `T`?
839836

bin/check-release-environment

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
errors=()
44

5-
if [ -z "${RELEASE_PLEASE_TOKEN}" ]; then
6-
errors+=("The RELEASE_PLEASE_TOKEN secret has not been set. Create a fine-grained GitHub PAT and add it as a repository secret.")
5+
if [ -z "${APP_PRIVATE_KEY}" ]; then
6+
errors+=("The APP_PRIVATE_KEY secret has not been set. Add the dodo-squirrels GitHub App private key as a repository secret, and set the APP_CLIENT_ID repository variable.")
77
fi
88

99
if [ -z "${SONATYPE_USERNAME}" ]; then

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "com.dodopayments.api"
11-
version = "1.99.1" // x-release-please-version
11+
version = "1.102.0" // x-release-please-version
1212
}
1313

1414
subprojects {

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/balances/BalanceLedgerEntry.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,10 @@ private constructor(
651651

652652
@JvmField val DUNNING_FEES = of("dunning_fees")
653653

654+
@JvmField val PAYMENT_RETRY_FEE = of("payment_retry_fee")
655+
656+
@JvmField val BYOP_FEE = of("byop_fee")
657+
654658
@JvmStatic fun of(value: String) = EventType(JsonField.of(value))
655659
}
656660

@@ -676,6 +680,8 @@ private constructor(
676680
CURRENCY_CONVERSION,
677681
ABANDONED_CART_RECOVERY_FEE,
678682
DUNNING_FEES,
683+
PAYMENT_RETRY_FEE,
684+
BYOP_FEE,
679685
}
680686

681687
/**
@@ -710,6 +716,8 @@ private constructor(
710716
CURRENCY_CONVERSION,
711717
ABANDONED_CART_RECOVERY_FEE,
712718
DUNNING_FEES,
719+
PAYMENT_RETRY_FEE,
720+
BYOP_FEE,
713721
/**
714722
* An enum member indicating that [EventType] was instantiated with an unknown value.
715723
*/
@@ -745,6 +753,8 @@ private constructor(
745753
CURRENCY_CONVERSION -> Value.CURRENCY_CONVERSION
746754
ABANDONED_CART_RECOVERY_FEE -> Value.ABANDONED_CART_RECOVERY_FEE
747755
DUNNING_FEES -> Value.DUNNING_FEES
756+
PAYMENT_RETRY_FEE -> Value.PAYMENT_RETRY_FEE
757+
BYOP_FEE -> Value.BYOP_FEE
748758
else -> Value._UNKNOWN
749759
}
750760

@@ -779,6 +789,8 @@ private constructor(
779789
CURRENCY_CONVERSION -> Known.CURRENCY_CONVERSION
780790
ABANDONED_CART_RECOVERY_FEE -> Known.ABANDONED_CART_RECOVERY_FEE
781791
DUNNING_FEES -> Known.DUNNING_FEES
792+
PAYMENT_RETRY_FEE -> Known.PAYMENT_RETRY_FEE
793+
BYOP_FEE -> Known.BYOP_FEE
782794
else -> throw DodoPaymentsInvalidDataException("Unknown EventType: $value")
783795
}
784796

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/balances/BalanceRetrieveLedgerParams.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,10 @@ private constructor(
13641364

13651365
@JvmField val DUNNING_FEES = of("dunning_fees")
13661366

1367+
@JvmField val PAYMENT_RETRY_FEE = of("payment_retry_fee")
1368+
1369+
@JvmField val BYOP_FEE = of("byop_fee")
1370+
13671371
@JvmStatic fun of(value: String) = EventType(JsonField.of(value))
13681372
}
13691373

@@ -1389,6 +1393,8 @@ private constructor(
13891393
CURRENCY_CONVERSION,
13901394
ABANDONED_CART_RECOVERY_FEE,
13911395
DUNNING_FEES,
1396+
PAYMENT_RETRY_FEE,
1397+
BYOP_FEE,
13921398
}
13931399

13941400
/**
@@ -1423,6 +1429,8 @@ private constructor(
14231429
CURRENCY_CONVERSION,
14241430
ABANDONED_CART_RECOVERY_FEE,
14251431
DUNNING_FEES,
1432+
PAYMENT_RETRY_FEE,
1433+
BYOP_FEE,
14261434
/**
14271435
* An enum member indicating that [EventType] was instantiated with an unknown value.
14281436
*/
@@ -1458,6 +1466,8 @@ private constructor(
14581466
CURRENCY_CONVERSION -> Value.CURRENCY_CONVERSION
14591467
ABANDONED_CART_RECOVERY_FEE -> Value.ABANDONED_CART_RECOVERY_FEE
14601468
DUNNING_FEES -> Value.DUNNING_FEES
1469+
PAYMENT_RETRY_FEE -> Value.PAYMENT_RETRY_FEE
1470+
BYOP_FEE -> Value.BYOP_FEE
14611471
else -> Value._UNKNOWN
14621472
}
14631473

@@ -1492,6 +1502,8 @@ private constructor(
14921502
CURRENCY_CONVERSION -> Known.CURRENCY_CONVERSION
14931503
ABANDONED_CART_RECOVERY_FEE -> Known.ABANDONED_CART_RECOVERY_FEE
14941504
DUNNING_FEES -> Known.DUNNING_FEES
1505+
PAYMENT_RETRY_FEE -> Known.PAYMENT_RETRY_FEE
1506+
BYOP_FEE -> Known.BYOP_FEE
14951507
else -> throw DodoPaymentsInvalidDataException("Unknown EventType: $value")
14961508
}
14971509

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/checkoutsessions/ThemeConfig.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ private constructor(
487487

488488
@JvmField val XL = of("xl")
489489

490-
@JvmField val _2XL = of("2xl")
490+
@JvmField val SIZE2_XL = of("2xl")
491491

492492
@JvmStatic fun of(value: String) = FontSize(JsonField.of(value))
493493
}
@@ -499,7 +499,7 @@ private constructor(
499499
MD,
500500
LG,
501501
XL,
502-
_2XL,
502+
SIZE2_XL,
503503
}
504504

505505
/**
@@ -519,7 +519,7 @@ private constructor(
519519
MD,
520520
LG,
521521
XL,
522-
_2XL,
522+
SIZE2_XL,
523523
/** An enum member indicating that [FontSize] was instantiated with an unknown value. */
524524
_UNKNOWN,
525525
}
@@ -538,7 +538,7 @@ private constructor(
538538
MD -> Value.MD
539539
LG -> Value.LG
540540
XL -> Value.XL
541-
_2XL -> Value._2XL
541+
SIZE2_XL -> Value.SIZE2_XL
542542
else -> Value._UNKNOWN
543543
}
544544

@@ -558,7 +558,7 @@ private constructor(
558558
MD -> Known.MD
559559
LG -> Known.LG
560560
XL -> Known.XL
561-
_2XL -> Known._2XL
561+
SIZE2_XL -> Known.SIZE2_XL
562562
else -> throw DodoPaymentsInvalidDataException("Unknown FontSize: $value")
563563
}
564564

dodo-payments-java-core/src/main/kotlin/com/dodopayments/api/models/discounts/Discount.kt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ private constructor(
8989
)
9090

9191
/**
92-
* The discount amount.
93-
*
94-
* - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 => 5.4%).
95-
* - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
92+
* The discount amount in **basis points** (e.g., 540 => 5.4%).
9693
*
9794
* @throws DodoPaymentsInvalidDataException if the JSON field has an unexpected type or is
9895
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -164,7 +161,7 @@ private constructor(
164161
fun timesUsed(): Int = timesUsed.getRequired("times_used")
165162

166163
/**
167-
* The type of discount, e.g. `percentage`, `flat`, or `flat_per_unit`.
164+
* The type of discount. Currently only `percentage` is supported.
168165
*
169166
* @throws DodoPaymentsInvalidDataException if the JSON field has an unexpected type or is
170167
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -386,12 +383,7 @@ private constructor(
386383
additionalProperties = discount.additionalProperties.toMutableMap()
387384
}
388385

389-
/**
390-
* The discount amount.
391-
*
392-
* - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 => 5.4%).
393-
* - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
394-
*/
386+
/** The discount amount in **basis points** (e.g., 540 => 5.4%). */
395387
fun amount(amount: Int) = amount(JsonField.of(amount))
396388

397389
/**
@@ -515,7 +507,7 @@ private constructor(
515507
*/
516508
fun timesUsed(timesUsed: JsonField<Int>) = apply { this.timesUsed = timesUsed }
517509

518-
/** The type of discount, e.g. `percentage`, `flat`, or `flat_per_unit`. */
510+
/** The type of discount. Currently only `percentage` is supported. */
519511
fun type(type: DiscountType) = type(JsonField.of(type))
520512

521513
/**

0 commit comments

Comments
 (0)