Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Changelog

## [1.104.0](https://github.com/dodopayments/dodopayments-java/compare/v1.103.0...v1.104.0) (2026-06-13)


### Features

* **spec:** update OpenAPI to 1.105.0 — localized prices ([5f80800](https://github.com/dodopayments/dodopayments-java/commit/5f8080034397a92f0fc21ef2e2b85f8bcb74d95c))
* **spec:** update OpenAPI to 1.105.0 — localized prices ([40f360c](https://github.com/dodopayments/dodopayments-java/commit/40f360c7ad5aa8c45f01b89552d13ebb9c06e06f))

## [1.103.0](https://github.com/dodopayments/dodopayments-java/compare/v1.102.1...v1.103.0) (2026-06-12)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- x-release-please-start-version -->

[![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.104.0)
[![javadoc](https://javadoc.io/badge2/com.dodopayments.api/dodo-payments-java/1.104.0/javadoc.svg)](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-java/1.103.0)
[![javadoc](https://javadoc.io/badge2/com.dodopayments.api/dodo-payments-java/1.104.0/javadoc.svg)](https://javadoc.io/doc/com.dodopayments.api/dodo-payments-java/1.104.0)

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ private constructor(
private val productCart: JsonField<List<ProductCart>>,
private val totalPrice: JsonField<Int>,
private val recurringBreakup: JsonField<RecurringBreakup>,
private val taxIdBusinessName: JsonField<String>,
private val taxIdErrMsg: JsonField<String>,
private val taxIdFormatName: JsonField<String>,
private val totalTax: JsonField<Int>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {
Expand All @@ -55,9 +57,15 @@ private constructor(
@JsonProperty("recurring_breakup")
@ExcludeMissing
recurringBreakup: JsonField<RecurringBreakup> = JsonMissing.of(),
@JsonProperty("tax_id_business_name")
@ExcludeMissing
taxIdBusinessName: JsonField<String> = JsonMissing.of(),
@JsonProperty("tax_id_err_msg")
@ExcludeMissing
taxIdErrMsg: JsonField<String> = JsonMissing.of(),
@JsonProperty("tax_id_format_name")
@ExcludeMissing
taxIdFormatName: JsonField<String> = JsonMissing.of(),
@JsonProperty("total_tax") @ExcludeMissing totalTax: JsonField<Int> = JsonMissing.of(),
) : this(
billingCountry,
Expand All @@ -67,7 +75,9 @@ private constructor(
productCart,
totalPrice,
recurringBreakup,
taxIdBusinessName,
taxIdErrMsg,
taxIdFormatName,
totalTax,
mutableMapOf(),
)
Expand Down Expand Up @@ -131,6 +141,15 @@ private constructor(
fun recurringBreakup(): Optional<RecurringBreakup> =
recurringBreakup.getOptional("recurring_breakup")

/**
* Registered business name from the official registry (EU/GB/AU) when found
*
* @throws DodoPaymentsInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun taxIdBusinessName(): Optional<String> =
taxIdBusinessName.getOptional("tax_id_business_name")

/**
* Error message if tax ID validation failed
*
Expand All @@ -139,6 +158,14 @@ private constructor(
*/
fun taxIdErrMsg(): Optional<String> = taxIdErrMsg.getOptional("tax_id_err_msg")

/**
* The matched tax ID notation (e.g. "VAT Number", "GSTIN") when valid
*
* @throws DodoPaymentsInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun taxIdFormatName(): Optional<String> = taxIdFormatName.getOptional("tax_id_format_name")

/**
* Total tax
*
Expand Down Expand Up @@ -205,6 +232,16 @@ private constructor(
@ExcludeMissing
fun _recurringBreakup(): JsonField<RecurringBreakup> = recurringBreakup

/**
* Returns the raw JSON value of [taxIdBusinessName].
*
* Unlike [taxIdBusinessName], this method doesn't throw if the JSON field has an unexpected
* type.
*/
@JsonProperty("tax_id_business_name")
@ExcludeMissing
fun _taxIdBusinessName(): JsonField<String> = taxIdBusinessName

/**
* Returns the raw JSON value of [taxIdErrMsg].
*
Expand All @@ -214,6 +251,15 @@ private constructor(
@ExcludeMissing
fun _taxIdErrMsg(): JsonField<String> = taxIdErrMsg

/**
* Returns the raw JSON value of [taxIdFormatName].
*
* Unlike [taxIdFormatName], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("tax_id_format_name")
@ExcludeMissing
fun _taxIdFormatName(): JsonField<String> = taxIdFormatName

/**
* Returns the raw JSON value of [totalTax].
*
Expand Down Expand Up @@ -262,7 +308,9 @@ private constructor(
private var productCart: JsonField<MutableList<ProductCart>>? = null
private var totalPrice: JsonField<Int>? = null
private var recurringBreakup: JsonField<RecurringBreakup> = JsonMissing.of()
private var taxIdBusinessName: JsonField<String> = JsonMissing.of()
private var taxIdErrMsg: JsonField<String> = JsonMissing.of()
private var taxIdFormatName: JsonField<String> = JsonMissing.of()
private var totalTax: JsonField<Int> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

Expand All @@ -275,7 +323,9 @@ private constructor(
productCart = checkoutSessionPreviewResponse.productCart.map { it.toMutableList() }
totalPrice = checkoutSessionPreviewResponse.totalPrice
recurringBreakup = checkoutSessionPreviewResponse.recurringBreakup
taxIdBusinessName = checkoutSessionPreviewResponse.taxIdBusinessName
taxIdErrMsg = checkoutSessionPreviewResponse.taxIdErrMsg
taxIdFormatName = checkoutSessionPreviewResponse.taxIdFormatName
totalTax = checkoutSessionPreviewResponse.totalTax
additionalProperties =
checkoutSessionPreviewResponse.additionalProperties.toMutableMap()
Expand Down Expand Up @@ -394,6 +444,25 @@ private constructor(
this.recurringBreakup = recurringBreakup
}

/** Registered business name from the official registry (EU/GB/AU) when found */
fun taxIdBusinessName(taxIdBusinessName: String?) =
taxIdBusinessName(JsonField.ofNullable(taxIdBusinessName))

/** Alias for calling [Builder.taxIdBusinessName] with `taxIdBusinessName.orElse(null)`. */
fun taxIdBusinessName(taxIdBusinessName: Optional<String>) =
taxIdBusinessName(taxIdBusinessName.getOrNull())

/**
* Sets [Builder.taxIdBusinessName] to an arbitrary JSON value.
*
* You should usually call [Builder.taxIdBusinessName] with a well-typed [String] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun taxIdBusinessName(taxIdBusinessName: JsonField<String>) = apply {
this.taxIdBusinessName = taxIdBusinessName
}

/** Error message if tax ID validation failed */
fun taxIdErrMsg(taxIdErrMsg: String?) = taxIdErrMsg(JsonField.ofNullable(taxIdErrMsg))

Expand All @@ -409,6 +478,25 @@ private constructor(
*/
fun taxIdErrMsg(taxIdErrMsg: JsonField<String>) = apply { this.taxIdErrMsg = taxIdErrMsg }

/** The matched tax ID notation (e.g. "VAT Number", "GSTIN") when valid */
fun taxIdFormatName(taxIdFormatName: String?) =
taxIdFormatName(JsonField.ofNullable(taxIdFormatName))

/** Alias for calling [Builder.taxIdFormatName] with `taxIdFormatName.orElse(null)`. */
fun taxIdFormatName(taxIdFormatName: Optional<String>) =
taxIdFormatName(taxIdFormatName.getOrNull())

/**
* Sets [Builder.taxIdFormatName] to an arbitrary JSON value.
*
* You should usually call [Builder.taxIdFormatName] with a well-typed [String] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun taxIdFormatName(taxIdFormatName: JsonField<String>) = apply {
this.taxIdFormatName = taxIdFormatName
}

/** Total tax */
fun totalTax(totalTax: Int?) = totalTax(JsonField.ofNullable(totalTax))

Expand Down Expand Up @@ -475,7 +563,9 @@ private constructor(
checkRequired("productCart", productCart).map { it.toImmutable() },
checkRequired("totalPrice", totalPrice),
recurringBreakup,
taxIdBusinessName,
taxIdErrMsg,
taxIdFormatName,
totalTax,
additionalProperties.toMutableMap(),
)
Expand Down Expand Up @@ -503,7 +593,9 @@ private constructor(
productCart().forEach { it.validate() }
totalPrice()
recurringBreakup().ifPresent { it.validate() }
taxIdBusinessName()
taxIdErrMsg()
taxIdFormatName()
totalTax()
validated = true
}
Expand All @@ -530,7 +622,9 @@ private constructor(
(productCart.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (totalPrice.asKnown().isPresent) 1 else 0) +
(recurringBreakup.asKnown().getOrNull()?.validity() ?: 0) +
(if (taxIdBusinessName.asKnown().isPresent) 1 else 0) +
(if (taxIdErrMsg.asKnown().isPresent) 1 else 0) +
(if (taxIdFormatName.asKnown().isPresent) 1 else 0) +
(if (totalTax.asKnown().isPresent) 1 else 0)

/** Breakup of the current payment */
Expand Down Expand Up @@ -3574,7 +3668,9 @@ private constructor(
productCart == other.productCart &&
totalPrice == other.totalPrice &&
recurringBreakup == other.recurringBreakup &&
taxIdBusinessName == other.taxIdBusinessName &&
taxIdErrMsg == other.taxIdErrMsg &&
taxIdFormatName == other.taxIdFormatName &&
totalTax == other.totalTax &&
additionalProperties == other.additionalProperties
}
Expand All @@ -3588,7 +3684,9 @@ private constructor(
productCart,
totalPrice,
recurringBreakup,
taxIdBusinessName,
taxIdErrMsg,
taxIdFormatName,
totalTax,
additionalProperties,
)
Expand All @@ -3597,5 +3695,5 @@ private constructor(
override fun hashCode(): Int = hashCode

override fun toString() =
"CheckoutSessionPreviewResponse{billingCountry=$billingCountry, currency=$currency, currentBreakup=$currentBreakup, isByop=$isByop, productCart=$productCart, totalPrice=$totalPrice, recurringBreakup=$recurringBreakup, taxIdErrMsg=$taxIdErrMsg, totalTax=$totalTax, additionalProperties=$additionalProperties}"
"CheckoutSessionPreviewResponse{billingCountry=$billingCountry, currency=$currency, currentBreakup=$currentBreakup, isByop=$isByop, productCart=$productCart, totalPrice=$totalPrice, recurringBreakup=$recurringBreakup, taxIdBusinessName=$taxIdBusinessName, taxIdErrMsg=$taxIdErrMsg, taxIdFormatName=$taxIdFormatName, totalTax=$totalTax, additionalProperties=$additionalProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ internal class CheckoutSessionPreviewResponseTest {
.tax(0)
.build()
)
.taxIdBusinessName("tax_id_business_name")
.taxIdErrMsg("tax_id_err_msg")
.taxIdFormatName("tax_id_format_name")
.totalTax(0)
.build()

Expand Down Expand Up @@ -171,7 +173,10 @@ internal class CheckoutSessionPreviewResponseTest {
.tax(0)
.build()
)
assertThat(checkoutSessionPreviewResponse.taxIdBusinessName())
.contains("tax_id_business_name")
assertThat(checkoutSessionPreviewResponse.taxIdErrMsg()).contains("tax_id_err_msg")
assertThat(checkoutSessionPreviewResponse.taxIdFormatName()).contains("tax_id_format_name")
assertThat(checkoutSessionPreviewResponse.totalTax()).contains(0)
}

Expand Down Expand Up @@ -254,7 +259,9 @@ internal class CheckoutSessionPreviewResponseTest {
.tax(0)
.build()
)
.taxIdBusinessName("tax_id_business_name")
.taxIdErrMsg("tax_id_err_msg")
.taxIdFormatName("tax_id_format_name")
.totalTax(0)
.build()

Expand Down
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

Loading