You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/01/12 16:20:08 UTC
(camel) branch main updated: CAMEL-22815: Support for payments in telegram stars (XTR) (#20776)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new ec2807857c61 CAMEL-22815: Support for payments in telegram stars (XTR) (#20776)
ec2807857c61 is described below
commit ec2807857c61b02d607f6a3199fe255501d36858
Author: Kirill Byvshev <k...@byv.sh>
AuthorDate: Mon Jan 12 20:20:02 2026 +0400
CAMEL-22815: Support for payments in telegram stars (XTR) (#20776)
---
.../src/main/docs/telegram-component.adoc | 4 +
.../camel/component/telegram/model/Gift.java | 237 +++++++++++++++++++++
.../component/telegram/model/GiftBackground.java | 97 +++++++++
.../component/telegram/model/IncomingFile.java | 110 ++++++++++
.../component/telegram/model/IncomingMessage.java | 13 ++
.../component/telegram/model/IncomingSticker.java | 196 +++++++++++++++--
.../component/telegram/model/IncomingVideo.java | 75 +++++++
.../camel/component/telegram/model/PaidMedia.java | 83 ++++++++
.../component/telegram/model/PaidMediaPhoto.java | 61 ++++++
.../component/telegram/model/PaidMediaPreview.java | 88 ++++++++
.../component/telegram/model/PaidMediaVideo.java | 60 ++++++
.../camel/component/telegram/model/Update.java | 13 ++
.../telegram/model/payments/AffiliateInfo.java | 133 ++++++++++++
.../payments/EditUserStarSubscriptionMessage.java | 98 +++++++++
.../model/payments/GetMyStarBalanceMessage.java | 44 ++++
.../model/payments/GetStarTransactionsMessage.java | 80 +++++++
.../model/payments/MessageResultStarAmount.java | 59 +++++
.../payments/MessageResultStarTransactions.java | 58 +++++
.../model/payments/PaidMediaPurchased.java | 81 +++++++
.../model/payments/RefundStarPaymentMessage.java | 81 +++++++
.../telegram/model/payments/RefundedPayment.java | 129 +++++++++++
.../model/payments/RevenueWithdrawalState.java | 85 ++++++++
.../payments/RevenueWithdrawalStateFailed.java | 46 ++++
.../payments/RevenueWithdrawalStatePending.java | 46 ++++
.../payments/RevenueWithdrawalStateSucceeded.java | 74 +++++++
.../telegram/model/payments/StarAmount.java | 74 +++++++
.../telegram/model/payments/StarTransaction.java | 143 +++++++++++++
.../telegram/model/payments/StarTransactions.java | 64 ++++++
.../model/payments/TransactionPartner.java | 116 ++++++++++
.../TransactionPartnerAffiliateProgram.java | 79 +++++++
.../model/payments/TransactionPartnerChat.java | 76 +++++++
.../model/payments/TransactionPartnerFragment.java | 62 ++++++
.../model/payments/TransactionPartnerOther.java | 46 ++++
.../payments/TransactionPartnerTelegramAds.java | 47 ++++
.../payments/TransactionPartnerTelegramApi.java | 62 ++++++
.../model/payments/TransactionPartnerUser.java | 185 ++++++++++++++++
.../service/TelegramServiceRestBotAPIAdapter.java | 10 +
.../telegram/util/TelegramMessageHelper.java | 2 +
.../TelegramConsumerMediaVideoExtendedTest.java | 121 +++++++++++
.../TelegramConsumerPaidMediaPurchasedTest.java | 89 ++++++++
.../TelegramConsumerRefundedPaymentTest.java | 84 ++++++++
.../telegram/TelegramProducerStarPaymentTest.java | 181 ++++++++++++++++
.../component/telegram/model/GiftMappingTest.java | 114 ++++++++++
.../telegram/model/PaidMediaMappingTest.java | 113 ++++++++++
.../messages/edit-user-star-subscription.json | 4 +
.../resources/messages/get-my-star-balance.json | 7 +
.../resources/messages/get-star-transactions.json | 36 ++++
.../src/test/resources/messages/gift-simple.json | 13 ++
.../src/test/resources/messages/gift.json | 31 +++
.../test/resources/messages/paid-media-photo.json | 19 ++
.../resources/messages/paid-media-preview.json | 6 +
.../test/resources/messages/paid-media-video.json | 20 ++
.../resources/messages/refund-star-payment.json | 4 +
.../messages/updates-media-video-extended.json | 63 ++++++
.../messages/updates-paid-media-purchased.json | 18 ++
.../messages/updates-refunded-payment.json | 30 +++
56 files changed, 3958 insertions(+), 12 deletions(-)
diff --git a/components/camel-telegram/src/main/docs/telegram-component.adoc b/components/camel-telegram/src/main/docs/telegram-component.adoc
index ad380157785c..429c296e1ef7 100644
--- a/components/camel-telegram/src/main/docs/telegram-component.adoc
+++ b/components/camel-telegram/src/main/docs/telegram-component.adoc
@@ -115,6 +115,10 @@ The following message bodies are allowed for a producer endpoint (messages of ty
| `AnswerShippingQueryMessage` | To reply to shipping queries (answerShippingQuery)
| `AnswerPreCheckoutQueryMessage` | To respond to a pre-checkout query from a payment (answerPreCheckoutQuery)
| `SendChatActionMessage` | To send a chat action status like typing, uploading, etc. (sendChatAction)
+| `GetMyStarBalanceMessage` | To get the bot's current Telegram Star balance (getMyStarBalance)
+| `GetStarTransactionsMessage` | To get the list of bot's Telegram Star transactions (getStarTransactions)
+| `RefundStarPaymentMessage` | To refund a successful payment in Telegram Stars (refundStarPayment)
+| `EditUserStarSubscriptionMessage` | To cancel or re-enable extension of a subscription paid in Telegram Stars (editUserStarSubscription)
| `byte[]` | To send any media type supported. It requires the `CamelTelegramMediaType` header to be set to the appropriate media type
| `String` | To send a text message to a chat. It gets converted automatically into a `OutgoingTextMessage`
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/Gift.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/Gift.java
new file mode 100644
index 000000000000..7e0f27d89893
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/Gift.java
@@ -0,0 +1,237 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * This object represents a gift that can be sent by the bot.
+ *
+ * @see <a href="https://core.telegram.org/bots/api#gift">https://core.telegram.org/bots/api#gift</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Gift implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1472694263846269401L;
+
+ /**
+ * Unique identifier of the gift.
+ */
+ private String id;
+
+ /**
+ * The sticker that represents the gift.
+ */
+ private IncomingSticker sticker;
+
+ /**
+ * The number of Telegram Stars that must be paid to send the sticker.
+ */
+ @JsonProperty("star_count")
+ private Integer starCount;
+
+ /**
+ * The number of Telegram Stars that must be paid to upgrade the gift to a unique one.
+ */
+ @JsonProperty("upgrade_star_count")
+ private Integer upgradeStarCount;
+
+ /**
+ * True, if the gift can be purchased only by Telegram Premium subscribers.
+ */
+ @JsonProperty("is_premium")
+ private Boolean isPremium;
+
+ /**
+ * True, if the gift is a avatar decoration that can customize the user's appearance.
+ */
+ @JsonProperty("has_colors")
+ private Boolean hasColors;
+
+ /**
+ * The total number of the gifts of this type that can be sent; for limited gifts only.
+ */
+ @JsonProperty("total_count")
+ private Integer totalCount;
+
+ /**
+ * The number of remaining gifts of this type that can be sent; for limited gifts only.
+ */
+ @JsonProperty("remaining_count")
+ private Integer remainingCount;
+
+ /**
+ * The total number of the gifts of this type that can be sent by the bot; for limited gifts only.
+ */
+ @JsonProperty("personal_total_count")
+ private Integer personalTotalCount;
+
+ /**
+ * The number of remaining gifts of this type that can be sent by the bot; for limited gifts only.
+ */
+ @JsonProperty("personal_remaining_count")
+ private Integer personalRemainingCount;
+
+ /**
+ * The gift's background.
+ */
+ private GiftBackground background;
+
+ /**
+ * The total number of unique gift variants that can be upgraded from this gift.
+ */
+ @JsonProperty("unique_gift_variant_count")
+ private Integer uniqueGiftVariantCount;
+
+ /**
+ * Information about the chat that published the gift.
+ */
+ @JsonProperty("publisher_chat")
+ private Chat publisherChat;
+
+ public Gift() {
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public IncomingSticker getSticker() {
+ return sticker;
+ }
+
+ public void setSticker(IncomingSticker sticker) {
+ this.sticker = sticker;
+ }
+
+ public Integer getStarCount() {
+ return starCount;
+ }
+
+ public void setStarCount(Integer starCount) {
+ this.starCount = starCount;
+ }
+
+ public Integer getUpgradeStarCount() {
+ return upgradeStarCount;
+ }
+
+ public void setUpgradeStarCount(Integer upgradeStarCount) {
+ this.upgradeStarCount = upgradeStarCount;
+ }
+
+ public Boolean getIsPremium() {
+ return isPremium;
+ }
+
+ public void setIsPremium(Boolean isPremium) {
+ this.isPremium = isPremium;
+ }
+
+ public Boolean getHasColors() {
+ return hasColors;
+ }
+
+ public void setHasColors(Boolean hasColors) {
+ this.hasColors = hasColors;
+ }
+
+ public Integer getTotalCount() {
+ return totalCount;
+ }
+
+ public void setTotalCount(Integer totalCount) {
+ this.totalCount = totalCount;
+ }
+
+ public Integer getRemainingCount() {
+ return remainingCount;
+ }
+
+ public void setRemainingCount(Integer remainingCount) {
+ this.remainingCount = remainingCount;
+ }
+
+ public Integer getPersonalTotalCount() {
+ return personalTotalCount;
+ }
+
+ public void setPersonalTotalCount(Integer personalTotalCount) {
+ this.personalTotalCount = personalTotalCount;
+ }
+
+ public Integer getPersonalRemainingCount() {
+ return personalRemainingCount;
+ }
+
+ public void setPersonalRemainingCount(Integer personalRemainingCount) {
+ this.personalRemainingCount = personalRemainingCount;
+ }
+
+ public GiftBackground getBackground() {
+ return background;
+ }
+
+ public void setBackground(GiftBackground background) {
+ this.background = background;
+ }
+
+ public Integer getUniqueGiftVariantCount() {
+ return uniqueGiftVariantCount;
+ }
+
+ public void setUniqueGiftVariantCount(Integer uniqueGiftVariantCount) {
+ this.uniqueGiftVariantCount = uniqueGiftVariantCount;
+ }
+
+ public Chat getPublisherChat() {
+ return publisherChat;
+ }
+
+ public void setPublisherChat(Chat publisherChat) {
+ this.publisherChat = publisherChat;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("Gift{");
+ sb.append("id='").append(id).append('\'');
+ sb.append(", sticker=").append(sticker);
+ sb.append(", starCount=").append(starCount);
+ sb.append(", upgradeStarCount=").append(upgradeStarCount);
+ sb.append(", isPremium=").append(isPremium);
+ sb.append(", hasColors=").append(hasColors);
+ sb.append(", totalCount=").append(totalCount);
+ sb.append(", remainingCount=").append(remainingCount);
+ sb.append(", personalTotalCount=").append(personalTotalCount);
+ sb.append(", personalRemainingCount=").append(personalRemainingCount);
+ sb.append(", background=").append(background);
+ sb.append(", uniqueGiftVariantCount=").append(uniqueGiftVariantCount);
+ sb.append(", publisherChat=").append(publisherChat);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/GiftBackground.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/GiftBackground.java
new file mode 100644
index 000000000000..25f6e138afef
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/GiftBackground.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * This object describes the background of a gift.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#giftbackground">https://core.telegram.org/bots/api#giftbackground</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GiftBackground implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 7347931110373828780L;
+
+ /**
+ * Center color of the background in RGB format.
+ */
+ @JsonProperty("center_color")
+ private Integer centerColor;
+
+ /**
+ * Edge color of the background in RGB format.
+ */
+ @JsonProperty("edge_color")
+ private Integer edgeColor;
+
+ /**
+ * Text color of the background in RGB format.
+ */
+ @JsonProperty("text_color")
+ private Integer textColor;
+
+ public GiftBackground() {
+ }
+
+ public GiftBackground(Integer centerColor, Integer edgeColor, Integer textColor) {
+ this.centerColor = centerColor;
+ this.edgeColor = edgeColor;
+ this.textColor = textColor;
+ }
+
+ public Integer getCenterColor() {
+ return centerColor;
+ }
+
+ public void setCenterColor(Integer centerColor) {
+ this.centerColor = centerColor;
+ }
+
+ public Integer getEdgeColor() {
+ return edgeColor;
+ }
+
+ public void setEdgeColor(Integer edgeColor) {
+ this.edgeColor = edgeColor;
+ }
+
+ public Integer getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(Integer textColor) {
+ this.textColor = textColor;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("GiftBackground{");
+ sb.append("centerColor=").append(centerColor);
+ sb.append(", edgeColor=").append(edgeColor);
+ sb.append(", textColor=").append(textColor);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingFile.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingFile.java
new file mode 100644
index 000000000000..79d0e4ce3886
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingFile.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * This object represents a file ready to be downloaded. The file can be downloaded via the link
+ * https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at
+ * least 1 hour. When the link expires, a new one can be requested by calling getFile.
+ *
+ * @see <a href="https://core.telegram.org/bots/api#file">https://core.telegram.org/bots/api#file</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class IncomingFile implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = -2244900723805727368L;
+
+ /**
+ * Identifier for this file, which can be used to download or reuse the file.
+ */
+ @JsonProperty("file_id")
+ private String fileId;
+
+ /**
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
+ * to download or reuse the file.
+ */
+ @JsonProperty("file_unique_id")
+ private String fileUniqueId;
+
+ /**
+ * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
+ * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer
+ * or double-precision float type are safe for storing this value.
+ */
+ @JsonProperty("file_size")
+ private Long fileSize;
+
+ /**
+ * Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
+ */
+ @JsonProperty("file_path")
+ private String filePath;
+
+ public IncomingFile() {
+ }
+
+ public String getFileId() {
+ return fileId;
+ }
+
+ public void setFileId(String fileId) {
+ this.fileId = fileId;
+ }
+
+ public String getFileUniqueId() {
+ return fileUniqueId;
+ }
+
+ public void setFileUniqueId(String fileUniqueId) {
+ this.fileUniqueId = fileUniqueId;
+ }
+
+ public Long getFileSize() {
+ return fileSize;
+ }
+
+ public void setFileSize(Long fileSize) {
+ this.fileSize = fileSize;
+ }
+
+ public String getFilePath() {
+ return filePath;
+ }
+
+ public void setFilePath(String filePath) {
+ this.filePath = filePath;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("IncomingFile{");
+ sb.append("fileId='").append(fileId).append('\'');
+ sb.append(", fileUniqueId='").append(fileUniqueId).append('\'');
+ sb.append(", fileSize=").append(fileSize);
+ sb.append(", filePath='").append(filePath).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java
index 5e9492eb79d6..bd2269ad6ea4 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingMessage.java
@@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import org.apache.camel.component.telegram.model.payments.RefundedPayment;
import org.apache.camel.component.telegram.model.payments.SuccessfulPayment;
/**
@@ -78,6 +79,9 @@ public class IncomingMessage implements Serializable {
@JsonProperty("successful_payment")
private SuccessfulPayment successfulPayment;
+ @JsonProperty("refunded_payment")
+ private RefundedPayment refundedPayment;
+
public IncomingMessage() {
}
@@ -225,6 +229,14 @@ public class IncomingMessage implements Serializable {
this.successfulPayment = successfulPayment;
}
+ public RefundedPayment getRefundedPayment() {
+ return refundedPayment;
+ }
+
+ public void setRefundedPayment(RefundedPayment refundedPayment) {
+ this.refundedPayment = refundedPayment;
+ }
+
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("IncomingMessage{");
@@ -246,6 +258,7 @@ public class IncomingMessage implements Serializable {
sb.append(", game=").append(game);
sb.append(", voice=").append(voice);
sb.append(", successfulPayment=").append(successfulPayment);
+ sb.append(", refundedPayment=").append(refundedPayment);
sb.append('}');
return sb.toString();
}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingSticker.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingSticker.java
index 5a2ab0e7e717..360d556ae64a 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingSticker.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingSticker.java
@@ -16,35 +16,118 @@
*/
package org.apache.camel.component.telegram.model;
+import java.io.Serial;
+import java.io.Serializable;
+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
- * Contains information about a sticker.
+ * This object represents a sticker.
+ *
+ * @see <a href="https://core.telegram.org/bots/api#sticker">https://core.telegram.org/bots/api#sticker</a>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class IncomingSticker {
+public class IncomingSticker implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = -5622918749834262276L;
+ /**
+ * Identifier for this file, which can be used to download or reuse the file.
+ */
@JsonProperty("file_id")
private String fileId;
+ /**
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used
+ * to download or reuse the file.
+ */
+ @JsonProperty("file_unique_id")
+ private String fileUniqueId;
+
+ /**
+ * Type of the sticker, currently one of "regular", "mask", "custom_emoji".
+ */
+ private String type;
+
+ /**
+ * Sticker width.
+ */
private Integer width;
+ /**
+ * Sticker height.
+ */
private Integer height;
+ /**
+ * True, if the sticker is animated.
+ */
@JsonProperty("is_animated")
private Boolean isAnimated;
+ /**
+ * True, if the sticker is a video sticker.
+ */
+ @JsonProperty("is_video")
+ private Boolean isVideo;
+
+ /**
+ * Optional. Sticker thumbnail in the .WEBP or .JPG format.
+ *
+ * @deprecated Use {@link #thumbnail} instead. Kept for backward compatibility.
+ */
+ @Deprecated
private IncomingPhotoSize thumb;
+ /**
+ * Optional. Sticker thumbnail in the .WEBP or .JPG format.
+ */
+ private IncomingPhotoSize thumbnail;
+
+ /**
+ * Optional. Emoji associated with the sticker.
+ */
private String emoji;
+ /**
+ * Optional. Name of the sticker set to which the sticker belongs.
+ */
@JsonProperty("set_name")
private String setName;
+ /**
+ * Optional. For premium regular stickers, premium animation for the sticker.
+ */
+ @JsonProperty("premium_animation")
+ private IncomingFile premiumAnimation;
+
+ /**
+ * Optional. For mask stickers, the position where the mask should be placed.
+ */
@JsonProperty("mask_position")
private IncomingMaskPosition maskPosition;
+ /**
+ * Optional. For custom emoji stickers, unique identifier of the custom emoji.
+ */
+ @JsonProperty("custom_emoji_id")
+ private String customEmojiId;
+
+ /**
+ * Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium
+ * badge in emoji status, white color on chat photos, or another appropriate color in other places.
+ */
+ @JsonProperty("needs_repainting")
+ private Boolean needsRepainting;
+
+ /**
+ * Optional. File size in bytes.
+ */
+ @JsonProperty("file_size")
+ private Long fileSize;
+
public IncomingSticker() {
}
@@ -56,6 +139,22 @@ public class IncomingSticker {
this.fileId = fileId;
}
+ public String getFileUniqueId() {
+ return fileUniqueId;
+ }
+
+ public void setFileUniqueId(String fileUniqueId) {
+ this.fileUniqueId = fileUniqueId;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
public Integer getWidth() {
return width;
}
@@ -80,14 +179,46 @@ public class IncomingSticker {
isAnimated = animated;
}
+ public Boolean getIsAnimated() {
+ return isAnimated;
+ }
+
+ public void setIsAnimated(Boolean isAnimated) {
+ this.isAnimated = isAnimated;
+ }
+
+ public Boolean getIsVideo() {
+ return isVideo;
+ }
+
+ public void setIsVideo(Boolean isVideo) {
+ this.isVideo = isVideo;
+ }
+
+ /**
+ * @deprecated Use {@link #getThumbnail()} instead.
+ */
+ @Deprecated
public IncomingPhotoSize getThumb() {
return thumb;
}
+ /**
+ * @deprecated Use {@link #setThumbnail(IncomingPhotoSize)} instead.
+ */
+ @Deprecated
public void setThumb(IncomingPhotoSize thumb) {
this.thumb = thumb;
}
+ public IncomingPhotoSize getThumbnail() {
+ return thumbnail;
+ }
+
+ public void setThumbnail(IncomingPhotoSize thumbnail) {
+ this.thumbnail = thumbnail;
+ }
+
public String getEmoji() {
return emoji;
}
@@ -104,6 +235,14 @@ public class IncomingSticker {
this.setName = setName;
}
+ public IncomingFile getPremiumAnimation() {
+ return premiumAnimation;
+ }
+
+ public void setPremiumAnimation(IncomingFile premiumAnimation) {
+ this.premiumAnimation = premiumAnimation;
+ }
+
public IncomingMaskPosition getMaskPosition() {
return maskPosition;
}
@@ -112,17 +251,50 @@ public class IncomingSticker {
this.maskPosition = maskPosition;
}
+ public String getCustomEmojiId() {
+ return customEmojiId;
+ }
+
+ public void setCustomEmojiId(String customEmojiId) {
+ this.customEmojiId = customEmojiId;
+ }
+
+ public Boolean getNeedsRepainting() {
+ return needsRepainting;
+ }
+
+ public void setNeedsRepainting(Boolean needsRepainting) {
+ this.needsRepainting = needsRepainting;
+ }
+
+ public Long getFileSize() {
+ return fileSize;
+ }
+
+ public void setFileSize(Long fileSize) {
+ this.fileSize = fileSize;
+ }
+
@Override
public String toString() {
- return "IncomingSticker{"
- + "fileId='" + fileId + '\''
- + ", width=" + width
- + ", height=" + height
- + ", isAnimated=" + isAnimated
- + ", thumb=" + thumb
- + ", emoji='" + emoji + '\''
- + ", setName='" + setName + '\''
- + ", maskPosition=" + maskPosition
- + '}';
+ final StringBuilder sb = new StringBuilder("IncomingSticker{");
+ sb.append("fileId='").append(fileId).append('\'');
+ sb.append(", fileUniqueId='").append(fileUniqueId).append('\'');
+ sb.append(", type='").append(type).append('\'');
+ sb.append(", width=").append(width);
+ sb.append(", height=").append(height);
+ sb.append(", isAnimated=").append(isAnimated);
+ sb.append(", isVideo=").append(isVideo);
+ sb.append(", thumb=").append(thumb);
+ sb.append(", thumbnail=").append(thumbnail);
+ sb.append(", emoji='").append(emoji).append('\'');
+ sb.append(", setName='").append(setName).append('\'');
+ sb.append(", premiumAnimation=").append(premiumAnimation);
+ sb.append(", maskPosition=").append(maskPosition);
+ sb.append(", customEmojiId='").append(customEmojiId).append('\'');
+ sb.append(", needsRepainting=").append(needsRepainting);
+ sb.append(", fileSize=").append(fileSize);
+ sb.append('}');
+ return sb.toString();
}
}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingVideo.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingVideo.java
index 9e89557c64ea..c810ff3266c6 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingVideo.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/IncomingVideo.java
@@ -16,7 +16,9 @@
*/
package org.apache.camel.component.telegram.model;
+import java.io.Serial;
import java.io.Serializable;
+import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -27,11 +29,15 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
public class IncomingVideo implements Serializable {
+ @Serial
private static final long serialVersionUID = 5280714879829232835L;
@JsonProperty("file_id")
private String fileId;
+ @JsonProperty("file_unique_id")
+ private String fileUniqueId;
+
private Integer width;
private Integer height;
@@ -39,8 +45,24 @@ public class IncomingVideo implements Serializable {
@JsonProperty("duration")
private Integer durationSeconds;
+ /**
+ * Optional. Video thumbnail in the .WEBP or .JPG format.
+ *
+ * @deprecated Use {@link #thumbnail} instead. Kept for backward compatibility.
+ */
+ @Deprecated
private IncomingPhotoSize thumb;
+ private IncomingPhotoSize thumbnail;
+
+ private List<IncomingPhotoSize> cover;
+
+ @JsonProperty("start_timestamp")
+ private Integer startTimestamp;
+
+ @JsonProperty("file_name")
+ private String fileName;
+
@JsonProperty("mime_type")
private String mimeType;
@@ -58,6 +80,14 @@ public class IncomingVideo implements Serializable {
this.fileId = fileId;
}
+ public String getFileUniqueId() {
+ return fileUniqueId;
+ }
+
+ public void setFileUniqueId(String fileUniqueId) {
+ this.fileUniqueId = fileUniqueId;
+ }
+
public Integer getWidth() {
return width;
}
@@ -90,14 +120,54 @@ public class IncomingVideo implements Serializable {
this.durationSeconds = durationSeconds;
}
+ /**
+ * @deprecated Use {@link #getThumbnail()} instead.
+ */
+ @Deprecated
public IncomingPhotoSize getThumb() {
return thumb;
}
+ /**
+ * @deprecated Use {@link #setThumbnail(IncomingPhotoSize)} instead.
+ */
+ @Deprecated
public void setThumb(IncomingPhotoSize thumb) {
this.thumb = thumb;
}
+ public IncomingPhotoSize getThumbnail() {
+ return thumbnail;
+ }
+
+ public void setThumbnail(IncomingPhotoSize thumbnail) {
+ this.thumbnail = thumbnail;
+ }
+
+ public List<IncomingPhotoSize> getCover() {
+ return cover;
+ }
+
+ public void setCover(List<IncomingPhotoSize> cover) {
+ this.cover = cover;
+ }
+
+ public Integer getStartTimestamp() {
+ return startTimestamp;
+ }
+
+ public void setStartTimestamp(Integer startTimestamp) {
+ this.startTimestamp = startTimestamp;
+ }
+
+ public String getFileName() {
+ return fileName;
+ }
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
+
public String getMimeType() {
return mimeType;
}
@@ -110,10 +180,15 @@ public class IncomingVideo implements Serializable {
public String toString() {
final StringBuilder sb = new StringBuilder("IncomingVideo{");
sb.append("fileId='").append(fileId).append('\'');
+ sb.append(", fileUniqueId='").append(fileUniqueId).append('\'');
sb.append(", width=").append(width);
sb.append(", height=").append(height);
sb.append(", durationSeconds=").append(durationSeconds);
sb.append(", thumb=").append(thumb);
+ sb.append(", thumbnail=").append(thumbnail);
+ sb.append(", cover=").append(cover);
+ sb.append(", startTimestamp=").append(startTimestamp);
+ sb.append(", fileName='").append(fileName).append('\'');
sb.append(", mimeType='").append(mimeType).append('\'');
sb.append(", fileSize=").append(fileSize);
sb.append('}');
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMedia.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMedia.java
new file mode 100644
index 000000000000..015cdcc6512d
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMedia.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+/**
+ * This object describes paid media.
+ *
+ * @see <a href="https://core.telegram.org/bots/api#paidmedia">https://core.telegram.org/bots/api#paidmedia</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = PaidMediaPreview.class, name = "preview"),
+ @JsonSubTypes.Type(value = PaidMediaPhoto.class, name = "photo"),
+ @JsonSubTypes.Type(value = PaidMediaVideo.class, name = "video")
+})
+public abstract class PaidMedia implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = -8598592364726649255L;
+
+ /**
+ * Type of the paid media.
+ */
+ private String type;
+
+ public PaidMedia() {
+ }
+
+ public PaidMedia(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Returns this object as {@link PaidMediaPreview} if it is of that type, null otherwise.
+ */
+ public PaidMediaPreview asPreview() {
+ return this instanceof PaidMediaPreview ? (PaidMediaPreview) this : null;
+ }
+
+ /**
+ * Returns this object as {@link PaidMediaPhoto} if it is of that type, null otherwise.
+ */
+ public PaidMediaPhoto asPhoto() {
+ return this instanceof PaidMediaPhoto ? (PaidMediaPhoto) this : null;
+ }
+
+ /**
+ * Returns this object as {@link PaidMediaVideo} if it is of that type, null otherwise.
+ */
+ public PaidMediaVideo asVideo() {
+ return this instanceof PaidMediaVideo ? (PaidMediaVideo) this : null;
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaPhoto.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaPhoto.java
new file mode 100644
index 000000000000..9af8eeebe211
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaPhoto.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serial;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * The paid media is a photo.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#paidmediaphoto">https://core.telegram.org/bots/api#paidmediaphoto</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class PaidMediaPhoto extends PaidMedia {
+
+ @Serial
+ private static final long serialVersionUID = 1838194783381263973L;
+
+ /**
+ * The photo.
+ */
+ private List<IncomingPhotoSize> photo;
+
+ public PaidMediaPhoto() {
+ super("photo");
+ }
+
+ public List<IncomingPhotoSize> getPhoto() {
+ return photo;
+ }
+
+ public void setPhoto(List<IncomingPhotoSize> photo) {
+ this.photo = photo;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("PaidMediaPhoto{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", photo=").append(photo);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaPreview.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaPreview.java
new file mode 100644
index 000000000000..05d8fd235e48
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaPreview.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * The paid media isn't available before the payment.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#paidmediapreview">https://core.telegram.org/bots/api#paidmediapreview</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class PaidMediaPreview extends PaidMedia {
+
+ @Serial
+ private static final long serialVersionUID = -344658841316219278L;
+
+ /**
+ * Media width as defined by the sender.
+ */
+ private Integer width;
+
+ /**
+ * Media height as defined by the sender.
+ */
+ private Integer height;
+
+ /**
+ * Duration of the media in seconds as defined by the sender.
+ */
+ private Integer duration;
+
+ public PaidMediaPreview() {
+ super("preview");
+ }
+
+ public Integer getWidth() {
+ return width;
+ }
+
+ public void setWidth(Integer width) {
+ this.width = width;
+ }
+
+ public Integer getHeight() {
+ return height;
+ }
+
+ public void setHeight(Integer height) {
+ this.height = height;
+ }
+
+ public Integer getDuration() {
+ return duration;
+ }
+
+ public void setDuration(Integer duration) {
+ this.duration = duration;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("PaidMediaPreview{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", width=").append(width);
+ sb.append(", height=").append(height);
+ sb.append(", duration=").append(duration);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaVideo.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaVideo.java
new file mode 100644
index 000000000000..26f438f8fadb
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/PaidMediaVideo.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * The paid media is a video.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#paidmediavideo">https://core.telegram.org/bots/api#paidmediavideo</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class PaidMediaVideo extends PaidMedia {
+
+ @Serial
+ private static final long serialVersionUID = 4778561129989136726L;
+
+ /**
+ * The video.
+ */
+ private IncomingVideo video;
+
+ public PaidMediaVideo() {
+ super("video");
+ }
+
+ public IncomingVideo getVideo() {
+ return video;
+ }
+
+ public void setVideo(IncomingVideo video) {
+ this.video = video;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("PaidMediaVideo{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", video=").append(video);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/Update.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/Update.java
index ae1f016fc259..baf9069e04bc 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/Update.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/Update.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.camel.component.telegram.model.payments.PaidMediaPurchased;
import org.apache.camel.component.telegram.model.payments.PreCheckoutQuery;
import org.apache.camel.component.telegram.model.payments.ShippingQuery;
@@ -51,6 +52,9 @@ public class Update implements Serializable {
@JsonProperty("shipping_query")
private ShippingQuery shippingQuery;
+ @JsonProperty("purchased_paid_media")
+ private PaidMediaPurchased purchasedPaidMedia;
+
public Update() {
}
@@ -110,6 +114,14 @@ public class Update implements Serializable {
this.shippingQuery = shippingQuery;
}
+ public PaidMediaPurchased getPurchasedPaidMedia() {
+ return purchasedPaidMedia;
+ }
+
+ public void setPurchasedPaidMedia(PaidMediaPurchased purchasedPaidMedia) {
+ this.purchasedPaidMedia = purchasedPaidMedia;
+ }
+
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Update{");
@@ -120,6 +132,7 @@ public class Update implements Serializable {
sb.append(", inlineQuery=").append(inlineQuery);
sb.append(", preCheckoutQuery=").append(preCheckoutQuery);
sb.append(", shippingQuery=").append(shippingQuery);
+ sb.append(", purchasedPaidMedia=").append(purchasedPaidMedia);
sb.append('}');
return sb.toString();
}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/AffiliateInfo.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/AffiliateInfo.java
new file mode 100644
index 000000000000..cd9748eb3a7d
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/AffiliateInfo.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.camel.component.telegram.model.Chat;
+import org.apache.camel.component.telegram.model.User;
+
+/**
+ * Contains information about the affiliate that received a commission via this transaction.
+ *
+ * @see <a href="https://core.telegram.org/bots/api#affiliateinfo">https://core.telegram.org/bots/api#affiliateinfo</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class AffiliateInfo implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = -5861679265904931723L;
+
+ /**
+ * The bot or the user that received an affiliate commission if it was received by a bot or a user.
+ */
+ @JsonProperty("affiliate_user")
+ private User affiliateUser;
+
+ /**
+ * The chat that received an affiliate commission if it was received by a chat.
+ */
+ @JsonProperty("affiliate_chat")
+ private Chat affiliateChat;
+
+ /**
+ * The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from
+ * referred users.
+ */
+ @JsonProperty("commission_per_mille")
+ private Integer commissionPerMille;
+
+ /**
+ * Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative
+ * for refunds.
+ */
+ private Integer amount;
+
+ /**
+ * The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can
+ * be negative for refunds.
+ */
+ @JsonProperty("nanostar_amount")
+ private Integer nanostarAmount;
+
+ public AffiliateInfo() {
+ }
+
+ public AffiliateInfo(User affiliateUser, Chat affiliateChat, Integer commissionPerMille, Integer amount,
+ Integer nanostarAmount) {
+ this.affiliateUser = affiliateUser;
+ this.affiliateChat = affiliateChat;
+ this.commissionPerMille = commissionPerMille;
+ this.amount = amount;
+ this.nanostarAmount = nanostarAmount;
+ }
+
+ public User getAffiliateUser() {
+ return affiliateUser;
+ }
+
+ public void setAffiliateUser(User affiliateUser) {
+ this.affiliateUser = affiliateUser;
+ }
+
+ public Chat getAffiliateChat() {
+ return affiliateChat;
+ }
+
+ public void setAffiliateChat(Chat affiliateChat) {
+ this.affiliateChat = affiliateChat;
+ }
+
+ public Integer getCommissionPerMille() {
+ return commissionPerMille;
+ }
+
+ public void setCommissionPerMille(Integer commissionPerMille) {
+ this.commissionPerMille = commissionPerMille;
+ }
+
+ public Integer getAmount() {
+ return amount;
+ }
+
+ public void setAmount(Integer amount) {
+ this.amount = amount;
+ }
+
+ public Integer getNanostarAmount() {
+ return nanostarAmount;
+ }
+
+ public void setNanostarAmount(Integer nanostarAmount) {
+ this.nanostarAmount = nanostarAmount;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("AffiliateInfo{");
+ sb.append("affiliateUser=").append(affiliateUser);
+ sb.append(", affiliateChat=").append(affiliateChat);
+ sb.append(", commissionPerMille=").append(commissionPerMille);
+ sb.append(", amount=").append(amount);
+ sb.append(", nanostarAmount=").append(nanostarAmount);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/EditUserStarSubscriptionMessage.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/EditUserStarSubscriptionMessage.java
new file mode 100644
index 000000000000..52e88d7f43d7
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/EditUserStarSubscriptionMessage.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.camel.component.telegram.TelegramMessage;
+
+/**
+ * Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#edituserstarsubscription">https://core.telegram.org/bots/api#edituserstarsubscription</a>
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class EditUserStarSubscriptionMessage implements TelegramMessage {
+
+ @Serial
+ private static final long serialVersionUID = 3817353864912714422L;
+
+ /**
+ * Identifier of the user whose subscription will be edited.
+ */
+ @JsonProperty("user_id")
+ private Long userId;
+
+ /**
+ * Telegram payment identifier for the subscription.
+ */
+ @JsonProperty("telegram_payment_charge_id")
+ private String telegramPaymentChargeId;
+
+ /**
+ * Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the
+ * current subscription period. Pass False to allow the user to re-enable it.
+ */
+ @JsonProperty("is_canceled")
+ private Boolean isCanceled;
+
+ public EditUserStarSubscriptionMessage() {
+ }
+
+ public EditUserStarSubscriptionMessage(Long userId, String telegramPaymentChargeId, Boolean isCanceled) {
+ this.userId = userId;
+ this.telegramPaymentChargeId = telegramPaymentChargeId;
+ this.isCanceled = isCanceled;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getTelegramPaymentChargeId() {
+ return telegramPaymentChargeId;
+ }
+
+ public void setTelegramPaymentChargeId(String telegramPaymentChargeId) {
+ this.telegramPaymentChargeId = telegramPaymentChargeId;
+ }
+
+ public Boolean getIsCanceled() {
+ return isCanceled;
+ }
+
+ public void setIsCanceled(Boolean isCanceled) {
+ this.isCanceled = isCanceled;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("EditUserStarSubscriptionMessage{");
+ sb.append("userId=").append(userId);
+ sb.append(", telegramPaymentChargeId='").append(telegramPaymentChargeId).append('\'');
+ sb.append(", isCanceled=").append(isCanceled);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/GetMyStarBalanceMessage.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/GetMyStarBalanceMessage.java
new file mode 100644
index 000000000000..1662e69e1e55
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/GetMyStarBalanceMessage.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import org.apache.camel.component.telegram.TelegramMessage;
+
+/**
+ * Use this method to get the current bot's Telegram Star balance. On success, returns a StarAmount object.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#getmystarbalance">https://core.telegram.org/bots/api#getmystarbalance</a>
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class GetMyStarBalanceMessage implements TelegramMessage {
+
+ @Serial
+ private static final long serialVersionUID = 5869515904295554780L;
+
+ public GetMyStarBalanceMessage() {
+ }
+
+ @Override
+ public String toString() {
+ return "GetMyStarBalanceMessage{}";
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/GetStarTransactionsMessage.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/GetStarTransactionsMessage.java
new file mode 100644
index 000000000000..cab55581f42b
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/GetStarTransactionsMessage.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import org.apache.camel.component.telegram.TelegramMessage;
+
+/**
+ * Use this method to get the list of bot's transactions in Telegram Stars in chronological order. On success, returns a
+ * StarTransactions object.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#getstartransactions">https://core.telegram.org/bots/api#getstartransactions</a>
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class GetStarTransactionsMessage implements TelegramMessage {
+
+ @Serial
+ private static final long serialVersionUID = -2586213653160802050L;
+
+ /**
+ * Number of transactions to skip in the response.
+ */
+ private Integer offset;
+
+ /**
+ * The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100.
+ */
+ private Integer limit;
+
+ public GetStarTransactionsMessage() {
+ }
+
+ public GetStarTransactionsMessage(Integer offset, Integer limit) {
+ this.offset = offset;
+ this.limit = limit;
+ }
+
+ public Integer getOffset() {
+ return offset;
+ }
+
+ public void setOffset(Integer offset) {
+ this.offset = offset;
+ }
+
+ public Integer getLimit() {
+ return limit;
+ }
+
+ public void setLimit(Integer limit) {
+ this.limit = limit;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("GetStarTransactionsMessage{");
+ sb.append("offset=").append(offset);
+ sb.append(", limit=").append(limit);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/MessageResultStarAmount.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/MessageResultStarAmount.java
new file mode 100644
index 000000000000..8290a5a2e435
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/MessageResultStarAmount.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import org.apache.camel.component.telegram.model.MessageResult;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MessageResultStarAmount extends MessageResult {
+
+ @Serial
+ private static final long serialVersionUID = -1031136214896586553L;
+
+ @JsonProperty("result")
+ private StarAmount starAmount;
+
+ public MessageResultStarAmount() {
+ }
+
+ public StarAmount getStarAmount() {
+ return starAmount;
+ }
+
+ public void setStarAmount(StarAmount starAmount) {
+ this.starAmount = starAmount;
+ }
+
+ @JsonSetter("result")
+ public void setResult(StarAmount result) {
+ this.starAmount = result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("MessageResultStarAmount{");
+ sb.append("starAmount=").append(starAmount);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/MessageResultStarTransactions.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/MessageResultStarTransactions.java
new file mode 100644
index 000000000000..d3d52fd594ac
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/MessageResultStarTransactions.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import org.apache.camel.component.telegram.model.MessageResult;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class MessageResultStarTransactions extends MessageResult {
+
+ @Serial
+ private static final long serialVersionUID = 6019295133058387690L;
+
+ @JsonProperty("result")
+ private StarTransactions starTransactions;
+
+ public MessageResultStarTransactions() {
+ }
+
+ public StarTransactions getStarTransactions() {
+ return starTransactions;
+ }
+
+ public void setStarTransactions(StarTransactions starTransactions) {
+ this.starTransactions = starTransactions;
+ }
+
+ @JsonSetter("result")
+ public void setResult(StarTransactions result) {
+ this.starTransactions = result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("MessageResultStarTransactions{");
+ sb.append("starTransactions=").append(starTransactions);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/PaidMediaPurchased.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/PaidMediaPurchased.java
new file mode 100644
index 000000000000..e515ee8f663f
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/PaidMediaPurchased.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.camel.component.telegram.model.User;
+
+/**
+ * This object contains information about a paid media purchase.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#paidmediapurchased">https://core.telegram.org/bots/api#paidmediapurchased</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class PaidMediaPurchased implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 69321874168775101L;
+
+ /**
+ * User who purchased the media.
+ */
+ private User from;
+
+ /**
+ * Bot-specified paid media payload.
+ */
+ @JsonProperty("paid_media_payload")
+ private String paidMediaPayload;
+
+ public PaidMediaPurchased() {
+ }
+
+ public PaidMediaPurchased(User from, String paidMediaPayload) {
+ this.from = from;
+ this.paidMediaPayload = paidMediaPayload;
+ }
+
+ public User getFrom() {
+ return from;
+ }
+
+ public void setFrom(User from) {
+ this.from = from;
+ }
+
+ public String getPaidMediaPayload() {
+ return paidMediaPayload;
+ }
+
+ public void setPaidMediaPayload(String paidMediaPayload) {
+ this.paidMediaPayload = paidMediaPayload;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("PaidMediaPurchased{");
+ sb.append("from=").append(from);
+ sb.append(", paidMediaPayload='").append(paidMediaPayload).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RefundStarPaymentMessage.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RefundStarPaymentMessage.java
new file mode 100644
index 000000000000..64cfdcc4857e
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RefundStarPaymentMessage.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.camel.component.telegram.TelegramMessage;
+
+/**
+ * Refunds a successful payment in Telegram Stars. Returns True on success.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#refundstarpayment">https://core.telegram.org/bots/api#refundstarpayment</a>
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class RefundStarPaymentMessage implements TelegramMessage {
+
+ @Serial
+ private static final long serialVersionUID = 5844786980495420170L;
+
+ /**
+ * Identifier of the user whose payment will be refunded.
+ */
+ @JsonProperty("user_id")
+ private Long userId;
+
+ /**
+ * Telegram payment identifier.
+ */
+ @JsonProperty("telegram_payment_charge_id")
+ private String telegramPaymentChargeId;
+
+ public RefundStarPaymentMessage() {
+ }
+
+ public RefundStarPaymentMessage(Long userId, String telegramPaymentChargeId) {
+ this.userId = userId;
+ this.telegramPaymentChargeId = telegramPaymentChargeId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getTelegramPaymentChargeId() {
+ return telegramPaymentChargeId;
+ }
+
+ public void setTelegramPaymentChargeId(String telegramPaymentChargeId) {
+ this.telegramPaymentChargeId = telegramPaymentChargeId;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("RefundStarPaymentMessage{");
+ sb.append("userId=").append(userId);
+ sb.append(", telegramPaymentChargeId='").append(telegramPaymentChargeId).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RefundedPayment.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RefundedPayment.java
new file mode 100644
index 000000000000..bfaae91c6594
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RefundedPayment.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * This object contains basic information about a refunded payment.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#refundedpayment">https://core.telegram.org/bots/api#refundedpayment</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class RefundedPayment implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 7527872288612186433L;
+
+ /**
+ * Three-letter ISO 4217 currency code, or "XTR" for payments in Telegram Stars. Currently, always "XTR".
+ */
+ private String currency;
+
+ /**
+ * Total refunded price in the smallest units of the currency (integer, not float/double).
+ */
+ @JsonProperty("total_amount")
+ private Integer totalAmount;
+
+ /**
+ * Bot-specified invoice payload.
+ */
+ @JsonProperty("invoice_payload")
+ private String invoicePayload;
+
+ /**
+ * Telegram payment identifier.
+ */
+ @JsonProperty("telegram_payment_charge_id")
+ private String telegramPaymentChargeId;
+
+ /**
+ * Provider payment identifier.
+ */
+ @JsonProperty("provider_payment_charge_id")
+ private String providerPaymentChargeId;
+
+ public RefundedPayment() {
+ }
+
+ public RefundedPayment(String currency, Integer totalAmount, String invoicePayload, String telegramPaymentChargeId,
+ String providerPaymentChargeId) {
+ this.currency = currency;
+ this.totalAmount = totalAmount;
+ this.invoicePayload = invoicePayload;
+ this.telegramPaymentChargeId = telegramPaymentChargeId;
+ this.providerPaymentChargeId = providerPaymentChargeId;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ public Integer getTotalAmount() {
+ return totalAmount;
+ }
+
+ public void setTotalAmount(Integer totalAmount) {
+ this.totalAmount = totalAmount;
+ }
+
+ public String getInvoicePayload() {
+ return invoicePayload;
+ }
+
+ public void setInvoicePayload(String invoicePayload) {
+ this.invoicePayload = invoicePayload;
+ }
+
+ public String getTelegramPaymentChargeId() {
+ return telegramPaymentChargeId;
+ }
+
+ public void setTelegramPaymentChargeId(String telegramPaymentChargeId) {
+ this.telegramPaymentChargeId = telegramPaymentChargeId;
+ }
+
+ public String getProviderPaymentChargeId() {
+ return providerPaymentChargeId;
+ }
+
+ public void setProviderPaymentChargeId(String providerPaymentChargeId) {
+ this.providerPaymentChargeId = providerPaymentChargeId;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("RefundedPayment{");
+ sb.append("currency='").append(currency).append('\'');
+ sb.append(", totalAmount=").append(totalAmount);
+ sb.append(", invoicePayload='").append(invoicePayload).append('\'');
+ sb.append(", telegramPaymentChargeId='").append(telegramPaymentChargeId).append('\'');
+ sb.append(", providerPaymentChargeId='").append(providerPaymentChargeId).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalState.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalState.java
new file mode 100644
index 000000000000..b7d75c4a2813
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalState.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+/**
+ * This object describes the state of a revenue withdrawal operation.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#revenuewithdrawalstate">https://core.telegram.org/bots/api#revenuewithdrawalstate</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = RevenueWithdrawalStatePending.class, name = "pending"),
+ @JsonSubTypes.Type(value = RevenueWithdrawalStateSucceeded.class, name = "succeeded"),
+ @JsonSubTypes.Type(value = RevenueWithdrawalStateFailed.class, name = "failed")
+})
+public abstract class RevenueWithdrawalState implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 6908338380175578836L;
+
+ /**
+ * Type of the state.
+ */
+ private String type;
+
+ public RevenueWithdrawalState() {
+ }
+
+ public RevenueWithdrawalState(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Returns this object as {@link RevenueWithdrawalStatePending} if it is of that type, null otherwise.
+ */
+ public RevenueWithdrawalStatePending asPending() {
+ return this instanceof RevenueWithdrawalStatePending ? (RevenueWithdrawalStatePending) this : null;
+ }
+
+ /**
+ * Returns this object as {@link RevenueWithdrawalStateSucceeded} if it is of that type, null otherwise.
+ */
+ public RevenueWithdrawalStateSucceeded asSucceeded() {
+ return this instanceof RevenueWithdrawalStateSucceeded ? (RevenueWithdrawalStateSucceeded) this : null;
+ }
+
+ /**
+ * Returns this object as {@link RevenueWithdrawalStateFailed} if it is of that type, null otherwise.
+ */
+ public RevenueWithdrawalStateFailed asFailed() {
+ return this instanceof RevenueWithdrawalStateFailed ? (RevenueWithdrawalStateFailed) this : null;
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStateFailed.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStateFailed.java
new file mode 100644
index 000000000000..ad996b43e511
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStateFailed.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * The withdrawal failed and the transaction was refunded.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#revenuewithdrawalstatefailed">https://core.telegram.org/bots/api#revenuewithdrawalstatefailed</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class RevenueWithdrawalStateFailed extends RevenueWithdrawalState {
+
+ @Serial
+ private static final long serialVersionUID = 5137711523612064182L;
+
+ public RevenueWithdrawalStateFailed() {
+ super("failed");
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("RevenueWithdrawalStateFailed{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStatePending.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStatePending.java
new file mode 100644
index 000000000000..647c23d835de
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStatePending.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * The withdrawal is in progress.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#revenuewithdrawalstatepending">https://core.telegram.org/bots/api#revenuewithdrawalstatepending</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class RevenueWithdrawalStatePending extends RevenueWithdrawalState {
+
+ @Serial
+ private static final long serialVersionUID = 6426430034482898265L;
+
+ public RevenueWithdrawalStatePending() {
+ super("pending");
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("RevenueWithdrawalStatePending{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStateSucceeded.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStateSucceeded.java
new file mode 100644
index 000000000000..98cb5a17e068
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/RevenueWithdrawalStateSucceeded.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * The withdrawal succeeded.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#revenuewithdrawalstatesucceeded">https://core.telegram.org/bots/api#revenuewithdrawalstatesucceeded</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class RevenueWithdrawalStateSucceeded extends RevenueWithdrawalState {
+
+ @Serial
+ private static final long serialVersionUID = -69259206437348998L;
+
+ /**
+ * Date the withdrawal was completed in Unix time.
+ */
+ private Integer date;
+
+ /**
+ * An HTTPS URL that can be used to see transaction details.
+ */
+ private String url;
+
+ public RevenueWithdrawalStateSucceeded() {
+ super("succeeded");
+ }
+
+ public Integer getDate() {
+ return date;
+ }
+
+ public void setDate(Integer date) {
+ this.date = date;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("RevenueWithdrawalStateSucceeded{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", date=").append(date);
+ sb.append(", url='").append(url).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarAmount.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarAmount.java
new file mode 100644
index 000000000000..75d3f2c44fb5
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarAmount.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * This object describes an amount of Telegram Stars.
+ *
+ * @see <a href="https://core.telegram.org/bots/api#staramount">https://core.telegram.org/bots/api#staramount</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class StarAmount implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1273845589598186890L;
+
+ private Integer amount;
+
+ @JsonProperty("nanostar_amount")
+ private Integer nanostarAmount;
+
+ public StarAmount(Integer amount, Integer nanostarAmount) {
+ this.amount = amount;
+ this.nanostarAmount = nanostarAmount;
+ }
+
+ public StarAmount() {
+ }
+
+ public Integer getAmount() {
+ return amount;
+ }
+
+ public void setAmount(Integer amount) {
+ this.amount = amount;
+ }
+
+ public Integer getNanostarAmount() {
+ return nanostarAmount;
+ }
+
+ public void setNanostarAmount(Integer nanostarAmount) {
+ this.nanostarAmount = nanostarAmount;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("StarAmount{");
+ sb.append("amount=").append(amount);
+ sb.append(", nanostarAmount=").append(nanostarAmount);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarTransaction.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarTransaction.java
new file mode 100644
index 000000000000..13dea3c6b66c
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarTransaction.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Describes a Telegram Star transaction.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#startransaction">https://core.telegram.org/bots/api#startransaction</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class StarTransaction implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = -2340108149132641728L;
+
+ /**
+ * Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund
+ * transactions.
+ */
+ private String id;
+
+ /**
+ * Integer amount of Telegram Stars transferred by the transaction.
+ */
+ private Integer amount;
+
+ /**
+ * The number of 1/1000000000 shares of Telegram Stars transferred; from 0 to 999999999.
+ */
+ @JsonProperty("nanostar_amount")
+ private Integer nanostarAmount;
+
+ /**
+ * Date the transaction was created in Unix time.
+ */
+ private Integer date;
+
+ /**
+ * Source of an incoming transaction. Only for incoming transactions.
+ */
+ private TransactionPartner source;
+
+ /**
+ * Receiver of an outgoing transaction. Only for outgoing transactions.
+ */
+ private TransactionPartner receiver;
+
+ public StarTransaction() {
+ }
+
+ public StarTransaction(String id, Integer amount, Integer nanostarAmount, Integer date, TransactionPartner source,
+ TransactionPartner receiver) {
+ this.id = id;
+ this.amount = amount;
+ this.nanostarAmount = nanostarAmount;
+ this.date = date;
+ this.source = source;
+ this.receiver = receiver;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Integer getAmount() {
+ return amount;
+ }
+
+ public void setAmount(Integer amount) {
+ this.amount = amount;
+ }
+
+ public Integer getNanostarAmount() {
+ return nanostarAmount;
+ }
+
+ public void setNanostarAmount(Integer nanostarAmount) {
+ this.nanostarAmount = nanostarAmount;
+ }
+
+ public Integer getDate() {
+ return date;
+ }
+
+ public void setDate(Integer date) {
+ this.date = date;
+ }
+
+ public TransactionPartner getSource() {
+ return source;
+ }
+
+ public void setSource(TransactionPartner source) {
+ this.source = source;
+ }
+
+ public TransactionPartner getReceiver() {
+ return receiver;
+ }
+
+ public void setReceiver(TransactionPartner receiver) {
+ this.receiver = receiver;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("StarTransaction{");
+ sb.append("id='").append(id).append('\'');
+ sb.append(", amount=").append(amount);
+ sb.append(", nanostarAmount=").append(nanostarAmount);
+ sb.append(", date=").append(date);
+ sb.append(", source=").append(source);
+ sb.append(", receiver=").append(receiver);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarTransactions.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarTransactions.java
new file mode 100644
index 000000000000..9eab98e5c9e5
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/StarTransactions.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * Contains a list of Telegram Star transactions.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#startransactions">https://core.telegram.org/bots/api#startransactions</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class StarTransactions implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = -2967282452206464640L;
+
+ /**
+ * The list of transactions.
+ */
+ private List<StarTransaction> transactions;
+
+ public StarTransactions() {
+ }
+
+ public StarTransactions(List<StarTransaction> transactions) {
+ this.transactions = transactions;
+ }
+
+ public List<StarTransaction> getTransactions() {
+ return transactions;
+ }
+
+ public void setTransactions(List<StarTransaction> transactions) {
+ this.transactions = transactions;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("StarTransactions{");
+ sb.append("transactions=").append(transactions);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartner.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartner.java
new file mode 100644
index 000000000000..fa51bb71762c
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartner.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+/**
+ * This object describes the source of a transaction, or its recipient for outgoing transactions.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartner">https://core.telegram.org/bots/api#transactionpartner</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
+@JsonSubTypes({
+ @JsonSubTypes.Type(value = TransactionPartnerUser.class, name = "user"),
+ @JsonSubTypes.Type(value = TransactionPartnerChat.class, name = "chat"),
+ @JsonSubTypes.Type(value = TransactionPartnerAffiliateProgram.class, name = "affiliate_program"),
+ @JsonSubTypes.Type(value = TransactionPartnerFragment.class, name = "fragment"),
+ @JsonSubTypes.Type(value = TransactionPartnerTelegramAds.class, name = "telegram_ads"),
+ @JsonSubTypes.Type(value = TransactionPartnerTelegramApi.class, name = "telegram_api"),
+ @JsonSubTypes.Type(value = TransactionPartnerOther.class, name = "other")
+})
+public abstract class TransactionPartner implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = -977981121195306104L;
+
+ /**
+ * Type of the transaction partner.
+ */
+ private String type;
+
+ public TransactionPartner() {
+ }
+
+ public TransactionPartner(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Returns this object as {@link TransactionPartnerUser} if it is of that type, null otherwise.
+ */
+ public TransactionPartnerUser asUser() {
+ return this instanceof TransactionPartnerUser ? (TransactionPartnerUser) this : null;
+ }
+
+ /**
+ * Returns this object as {@link TransactionPartnerChat} if it is of that type, null otherwise.
+ */
+ public TransactionPartnerChat asChat() {
+ return this instanceof TransactionPartnerChat ? (TransactionPartnerChat) this : null;
+ }
+
+ /**
+ * Returns this object as {@link TransactionPartnerAffiliateProgram} if it is of that type, null otherwise.
+ */
+ public TransactionPartnerAffiliateProgram asAffiliateProgram() {
+ return this instanceof TransactionPartnerAffiliateProgram ? (TransactionPartnerAffiliateProgram) this : null;
+ }
+
+ /**
+ * Returns this object as {@link TransactionPartnerFragment} if it is of that type, null otherwise.
+ */
+ public TransactionPartnerFragment asFragment() {
+ return this instanceof TransactionPartnerFragment ? (TransactionPartnerFragment) this : null;
+ }
+
+ /**
+ * Returns this object as {@link TransactionPartnerTelegramAds} if it is of that type, null otherwise.
+ */
+ public TransactionPartnerTelegramAds asTelegramAds() {
+ return this instanceof TransactionPartnerTelegramAds ? (TransactionPartnerTelegramAds) this : null;
+ }
+
+ /**
+ * Returns this object as {@link TransactionPartnerTelegramApi} if it is of that type, null otherwise.
+ */
+ public TransactionPartnerTelegramApi asTelegramApi() {
+ return this instanceof TransactionPartnerTelegramApi ? (TransactionPartnerTelegramApi) this : null;
+ }
+
+ /**
+ * Returns this object as {@link TransactionPartnerOther} if it is of that type, null otherwise.
+ */
+ public TransactionPartnerOther asOther() {
+ return this instanceof TransactionPartnerOther ? (TransactionPartnerOther) this : null;
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerAffiliateProgram.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerAffiliateProgram.java
new file mode 100644
index 000000000000..dbe2b978b943
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerAffiliateProgram.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.camel.component.telegram.model.User;
+
+/**
+ * Describes the affiliate program that issued the affiliate commission received via this transaction.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartneraffiliateprogram">https://core.telegram.org/bots/api#transactionpartneraffiliateprogram</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TransactionPartnerAffiliateProgram extends TransactionPartner {
+
+ @Serial
+ private static final long serialVersionUID = -94537940085654083L;
+
+ /**
+ * The bot that sponsored the affiliate program.
+ */
+ @JsonProperty("sponsor_user")
+ private User sponsorUser;
+
+ /**
+ * The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program
+ * sponsor from referred users.
+ */
+ @JsonProperty("commission_per_mille")
+ private Integer commissionPerMille;
+
+ public TransactionPartnerAffiliateProgram() {
+ super("affiliate_program");
+ }
+
+ public User getSponsorUser() {
+ return sponsorUser;
+ }
+
+ public void setSponsorUser(User sponsorUser) {
+ this.sponsorUser = sponsorUser;
+ }
+
+ public Integer getCommissionPerMille() {
+ return commissionPerMille;
+ }
+
+ public void setCommissionPerMille(Integer commissionPerMille) {
+ this.commissionPerMille = commissionPerMille;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("TransactionPartnerAffiliateProgram{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", sponsorUser=").append(sponsorUser);
+ sb.append(", commissionPerMille=").append(commissionPerMille);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerChat.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerChat.java
new file mode 100644
index 000000000000..7799d5b9bc71
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerChat.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.apache.camel.component.telegram.model.Chat;
+import org.apache.camel.component.telegram.model.Gift;
+
+/**
+ * Describes a transaction with a chat.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartnerchat">https://core.telegram.org/bots/api#transactionpartnerchat</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TransactionPartnerChat extends TransactionPartner {
+
+ @Serial
+ private static final long serialVersionUID = 3115200430210876874L;
+
+ /**
+ * Information about the chat.
+ */
+ private Chat chat;
+
+ /**
+ * The gift sent to the chat by the bot.
+ */
+ private Gift gift;
+
+ public TransactionPartnerChat() {
+ super("chat");
+ }
+
+ public Chat getChat() {
+ return chat;
+ }
+
+ public void setChat(Chat chat) {
+ this.chat = chat;
+ }
+
+ public Gift getGift() {
+ return gift;
+ }
+
+ public void setGift(Gift gift) {
+ this.gift = gift;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("TransactionPartnerChat{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", chat=").append(chat);
+ sb.append(", gift=").append(gift);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerFragment.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerFragment.java
new file mode 100644
index 000000000000..758a0ee8a137
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerFragment.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Describes a withdrawal transaction with Fragment.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartnerfragment">https://core.telegram.org/bots/api#transactionpartnerfragment</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TransactionPartnerFragment extends TransactionPartner {
+
+ @Serial
+ private static final long serialVersionUID = 4301816007577685286L;
+
+ /**
+ * State of the transaction if the transaction is outgoing.
+ */
+ @JsonProperty("withdrawal_state")
+ private RevenueWithdrawalState withdrawalState;
+
+ public TransactionPartnerFragment() {
+ super("fragment");
+ }
+
+ public RevenueWithdrawalState getWithdrawalState() {
+ return withdrawalState;
+ }
+
+ public void setWithdrawalState(RevenueWithdrawalState withdrawalState) {
+ this.withdrawalState = withdrawalState;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("TransactionPartnerFragment{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", withdrawalState=").append(withdrawalState);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerOther.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerOther.java
new file mode 100644
index 000000000000..9e7bef96de35
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerOther.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * Describes a transaction with an unknown source or recipient.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartnerother">https://core.telegram.org/bots/api#transactionpartnerother</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TransactionPartnerOther extends TransactionPartner {
+
+ @Serial
+ private static final long serialVersionUID = -620088691232451978L;
+
+ public TransactionPartnerOther() {
+ super("other");
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("TransactionPartnerOther{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerTelegramAds.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerTelegramAds.java
new file mode 100644
index 000000000000..8096c610d016
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerTelegramAds.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * Describes a withdrawal transaction to the Telegram Ads platform.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartnertelegramads">https://core.telegram.org/bots/api#transactionpartnertelegramads</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TransactionPartnerTelegramAds extends TransactionPartner {
+
+ @Serial
+ private static final long serialVersionUID = -7290030412839784645L;
+
+ public TransactionPartnerTelegramAds() {
+ super("telegram_ads");
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("TransactionPartnerTelegramAds{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerTelegramApi.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerTelegramApi.java
new file mode 100644
index 000000000000..8af51054970b
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerTelegramApi.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Describes a transaction with payment for paid broadcasting.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartnertelegramapi">https://core.telegram.org/bots/api#transactionpartnertelegramapi</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TransactionPartnerTelegramApi extends TransactionPartner {
+
+ @Serial
+ private static final long serialVersionUID = 161396113287446225L;
+
+ /**
+ * The number of successful requests that exceeded regular limits and were therefore billed.
+ */
+ @JsonProperty("request_count")
+ private Integer requestCount;
+
+ public TransactionPartnerTelegramApi() {
+ super("telegram_api");
+ }
+
+ public Integer getRequestCount() {
+ return requestCount;
+ }
+
+ public void setRequestCount(Integer requestCount) {
+ this.requestCount = requestCount;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("TransactionPartnerTelegramApi{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", requestCount=").append(requestCount);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerUser.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerUser.java
new file mode 100644
index 000000000000..d2fbc23561b3
--- /dev/null
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/model/payments/TransactionPartnerUser.java
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.telegram.model.payments;
+
+import java.io.Serial;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.camel.component.telegram.model.Gift;
+import org.apache.camel.component.telegram.model.PaidMedia;
+import org.apache.camel.component.telegram.model.User;
+
+/**
+ * Describes a transaction with a user.
+ *
+ * @see <a href=
+ * "https://core.telegram.org/bots/api#transactionpartneruser">https://core.telegram.org/bots/api#transactionpartneruser</a>
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TransactionPartnerUser extends TransactionPartner {
+
+ @Serial
+ private static final long serialVersionUID = -8469984079835620034L;
+
+ /**
+ * Type of the transaction, currently one of "invoice_payment", "paid_media_payment", "gift_purchase",
+ * "premium_purchase", "business_account_transfer".
+ */
+ @JsonProperty("transaction_type")
+ private String transactionType;
+
+ /**
+ * Information about the user.
+ */
+ private User user;
+
+ /**
+ * Information about the affiliate that received a commission via this transaction.
+ */
+ private AffiliateInfo affiliate;
+
+ /**
+ * Bot-specified invoice payload.
+ */
+ @JsonProperty("invoice_payload")
+ private String invoicePayload;
+
+ /**
+ * The duration of the paid subscription.
+ */
+ @JsonProperty("subscription_period")
+ private Integer subscriptionPeriod;
+
+ /**
+ * Information about the paid media bought by the user.
+ */
+ @JsonProperty("paid_media")
+ private List<PaidMedia> paidMedia;
+
+ /**
+ * Bot-specified paid media payload.
+ */
+ @JsonProperty("paid_media_payload")
+ private String paidMediaPayload;
+
+ /**
+ * The gift sent to the user by the bot.
+ */
+ private Gift gift;
+
+ /**
+ * Number of months the gifted Telegram Premium subscription will be active for.
+ */
+ @JsonProperty("premium_subscription_duration")
+ private Integer premiumSubscriptionDuration;
+
+ public TransactionPartnerUser() {
+ super("user");
+ }
+
+ public String getTransactionType() {
+ return transactionType;
+ }
+
+ public void setTransactionType(String transactionType) {
+ this.transactionType = transactionType;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ public AffiliateInfo getAffiliate() {
+ return affiliate;
+ }
+
+ public void setAffiliate(AffiliateInfo affiliate) {
+ this.affiliate = affiliate;
+ }
+
+ public String getInvoicePayload() {
+ return invoicePayload;
+ }
+
+ public void setInvoicePayload(String invoicePayload) {
+ this.invoicePayload = invoicePayload;
+ }
+
+ public Integer getSubscriptionPeriod() {
+ return subscriptionPeriod;
+ }
+
+ public void setSubscriptionPeriod(Integer subscriptionPeriod) {
+ this.subscriptionPeriod = subscriptionPeriod;
+ }
+
+ public List<PaidMedia> getPaidMedia() {
+ return paidMedia;
+ }
+
+ public void setPaidMedia(List<PaidMedia> paidMedia) {
+ this.paidMedia = paidMedia;
+ }
+
+ public String getPaidMediaPayload() {
+ return paidMediaPayload;
+ }
+
+ public void setPaidMediaPayload(String paidMediaPayload) {
+ this.paidMediaPayload = paidMediaPayload;
+ }
+
+ public Gift getGift() {
+ return gift;
+ }
+
+ public void setGift(Gift gift) {
+ this.gift = gift;
+ }
+
+ public Integer getPremiumSubscriptionDuration() {
+ return premiumSubscriptionDuration;
+ }
+
+ public void setPremiumSubscriptionDuration(Integer premiumSubscriptionDuration) {
+ this.premiumSubscriptionDuration = premiumSubscriptionDuration;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("TransactionPartnerUser{");
+ sb.append("type='").append(getType()).append('\'');
+ sb.append(", transactionType='").append(transactionType).append('\'');
+ sb.append(", user=").append(user);
+ sb.append(", affiliate=").append(affiliate);
+ sb.append(", invoicePayload='").append(invoicePayload).append('\'');
+ sb.append(", subscriptionPeriod=").append(subscriptionPeriod);
+ sb.append(", paidMedia=").append(paidMedia);
+ sb.append(", paidMediaPayload='").append(paidMediaPayload).append('\'');
+ sb.append(", gift=").append(gift);
+ sb.append(", premiumSubscriptionDuration=").append(premiumSubscriptionDuration);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
index f960890130e1..e96a3bb184f5 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
@@ -62,6 +62,12 @@ import org.apache.camel.component.telegram.model.WebhookResult;
import org.apache.camel.component.telegram.model.payments.AnswerPreCheckoutQueryMessage;
import org.apache.camel.component.telegram.model.payments.AnswerShippingQueryMessage;
import org.apache.camel.component.telegram.model.payments.CreateInvoiceLinkMessage;
+import org.apache.camel.component.telegram.model.payments.EditUserStarSubscriptionMessage;
+import org.apache.camel.component.telegram.model.payments.GetMyStarBalanceMessage;
+import org.apache.camel.component.telegram.model.payments.GetStarTransactionsMessage;
+import org.apache.camel.component.telegram.model.payments.MessageResultStarAmount;
+import org.apache.camel.component.telegram.model.payments.MessageResultStarTransactions;
+import org.apache.camel.component.telegram.model.payments.RefundStarPaymentMessage;
import org.apache.camel.component.telegram.model.payments.SendInvoiceMessage;
import org.apache.camel.util.URISupport;
import org.slf4j.Logger;
@@ -115,6 +121,10 @@ public class TelegramServiceRestBotAPIAdapter implements TelegramService {
.register(AnswerPreCheckoutQueryMessage.class, "answerPreCheckoutQuery")
.register(AnswerShippingQueryMessage.class, "answerShippingQuery")
.register(SendChatActionMessage.class, "sendChatAction")
+ .register(GetMyStarBalanceMessage.class, "getMyStarBalance", MessageResultStarAmount.class)
+ .register(GetStarTransactionsMessage.class, "getStarTransactions", MessageResultStarTransactions.class)
+ .register(RefundStarPaymentMessage.class, "refundStarPayment")
+ .register(EditUserStarSubscriptionMessage.class, "editUserStarSubscription")
.build();
}
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramMessageHelper.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramMessageHelper.java
index 49809affaf9f..4ee07ebe7724 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramMessageHelper.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramMessageHelper.java
@@ -56,6 +56,8 @@ public final class TelegramMessageHelper {
exchange.getMessage().setBody(update.getPreCheckoutQuery());
} else if (update.getShippingQuery() != null) {
exchange.getMessage().setBody(update.getShippingQuery());
+ } else if (update.getPurchasedPaidMedia() != null) {
+ exchange.getMessage().setBody(update.getPurchasedPaidMedia());
}
}
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaVideoExtendedTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaVideoExtendedTest.java
new file mode 100644
index 000000000000..251c7e8b467a
--- /dev/null
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaVideoExtendedTest.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.telegram.model.IncomingMessage;
+import org.apache.camel.component.telegram.model.IncomingPhotoSize;
+import org.apache.camel.component.telegram.model.IncomingVideo;
+import org.apache.camel.component.telegram.util.TelegramMockRoutes;
+import org.apache.camel.component.telegram.util.TelegramTestSupport;
+import org.apache.camel.component.telegram.util.TelegramTestUtil;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Tests the reception of video messages with extended fields (fileUniqueId, thumbnail, cover, startTimestamp,
+ * fileName).
+ */
+public class TelegramConsumerMediaVideoExtendedTest extends TelegramTestSupport {
+
+ @EndpointInject("mock:telegram")
+ private MockEndpoint endpoint;
+
+ @Test
+ public void testReceptionOfVideoWithExtendedFields() throws Exception {
+ endpoint.expectedMinimumMessageCount(1);
+ endpoint.assertIsSatisfied(5000);
+
+ Exchange mediaExchange = endpoint.getExchanges().get(0);
+ IncomingMessage msg = mediaExchange.getIn().getBody(IncomingMessage.class);
+
+ IncomingVideo video = msg.getVideo();
+ assertNotNull(video);
+
+ // Basic fields
+ assertEquals("BAADBAADAgADyzvwCC7_extended_video", video.getFileId());
+ assertEquals(Integer.valueOf(1920), video.getWidth());
+ assertEquals(Integer.valueOf(1080), video.getHeight());
+ assertEquals(Integer.valueOf(300), video.getDurationSeconds());
+ assertEquals(Long.valueOf(104857600), video.getFileSize());
+ assertEquals("video/mp4", video.getMimeType());
+
+ // Extended fields
+ assertEquals("AgADyzvwCC7_extended_unique", video.getFileUniqueId());
+ assertEquals("extended_video.mp4", video.getFileName());
+ assertEquals(Integer.valueOf(15), video.getStartTimestamp());
+
+ // Verify old thumb field (for backward compatibility)
+ IncomingPhotoSize thumb = video.getThumb();
+ assertNotNull(thumb);
+ assertEquals("AAQEABMlaUQZAAT1thumb_old", thumb.getFileId());
+
+ // Verify new thumbnail field
+ IncomingPhotoSize thumbnail = video.getThumbnail();
+ assertNotNull(thumbnail);
+ assertEquals("AAQEABMlaUQZAAT1thumb_new", thumbnail.getFileId());
+ assertEquals("thumb_new_unique", thumbnail.getFileUniqueId());
+ assertEquals(Integer.valueOf(320), thumbnail.getWidth());
+ assertEquals(Integer.valueOf(180), thumbnail.getHeight());
+
+ // Verify cover field (album/carousel thumbnails)
+ assertNotNull(video.getCover());
+ assertEquals(2, video.getCover().size());
+
+ IncomingPhotoSize smallCover = video.getCover().get(0);
+ assertEquals("cover_small_id", smallCover.getFileId());
+ assertEquals("cover_small_unique", smallCover.getFileUniqueId());
+ assertEquals(Integer.valueOf(160), smallCover.getWidth());
+ assertEquals(Integer.valueOf(90), smallCover.getHeight());
+
+ IncomingPhotoSize largeCover = video.getCover().get(1);
+ assertEquals("cover_large_id", largeCover.getFileId());
+ assertEquals("cover_large_unique", largeCover.getFileUniqueId());
+ assertEquals(Integer.valueOf(640), largeCover.getWidth());
+ assertEquals(Integer.valueOf(360), largeCover.getHeight());
+ }
+
+ @Override
+ protected RoutesBuilder[] createRouteBuilders() {
+ return new RoutesBuilder[] {
+ getMockRoutes(),
+ new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("telegram:bots?authorizationToken=mock-token")
+ .to("mock:telegram");
+ }
+ } };
+ }
+
+ @Override
+ protected TelegramMockRoutes createMockRoutes() {
+ return new TelegramMockRoutes(port)
+ .addEndpoint(
+ "getUpdates",
+ "GET",
+ String.class,
+ TelegramTestUtil.stringResource("messages/updates-media-video-extended.json"),
+ TelegramTestUtil.stringResource("messages/updates-empty.json"));
+ }
+}
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerPaidMediaPurchasedTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerPaidMediaPurchasedTest.java
new file mode 100644
index 000000000000..e4799986e559
--- /dev/null
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerPaidMediaPurchasedTest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.telegram.model.User;
+import org.apache.camel.component.telegram.model.payments.PaidMediaPurchased;
+import org.apache.camel.component.telegram.util.TelegramMockRoutes;
+import org.apache.camel.component.telegram.util.TelegramTestSupport;
+import org.apache.camel.component.telegram.util.TelegramTestUtil;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Tests that paid media purchased updates are properly received and converted.
+ */
+public class TelegramConsumerPaidMediaPurchasedTest extends TelegramTestSupport {
+
+ @EndpointInject("mock:telegram")
+ private MockEndpoint endpoint;
+
+ @Test
+ public void testReceptionOfPaidMediaPurchased() throws Exception {
+ endpoint.expectedMinimumMessageCount(1);
+ endpoint.assertIsSatisfied(5000);
+
+ Exchange exchange = endpoint.getExchanges().get(0);
+ PaidMediaPurchased paidMediaPurchased = exchange.getIn().getBody(PaidMediaPurchased.class);
+
+ assertNotNull(paidMediaPurchased);
+
+ // Verify from user
+ User from = paidMediaPurchased.getFrom();
+ assertNotNull(from);
+ assertEquals(Long.valueOf(1585844777L), from.getId());
+ assertFalse(from.isBot());
+ assertEquals("John", from.getFirstName());
+ assertEquals("Doe", from.getLastName());
+ assertEquals("johndoe", from.getUsername());
+
+ // Verify paid media payload
+ assertEquals("premium_content_12345", paidMediaPurchased.getPaidMediaPayload());
+ }
+
+ @Override
+ protected RoutesBuilder[] createRouteBuilders() {
+ return new RoutesBuilder[] {
+ getMockRoutes(),
+ new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("telegram:bots?authorizationToken=mock-token")
+ .to("mock:telegram");
+ }
+ } };
+ }
+
+ @Override
+ protected TelegramMockRoutes createMockRoutes() {
+ return new TelegramMockRoutes(port)
+ .addEndpoint(
+ "getUpdates",
+ "GET",
+ String.class,
+ TelegramTestUtil.stringResource("messages/updates-paid-media-purchased.json"),
+ TelegramTestUtil.stringResource("messages/updates-empty.json"));
+ }
+}
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerRefundedPaymentTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerRefundedPaymentTest.java
new file mode 100644
index 000000000000..acc883b59d3a
--- /dev/null
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerRefundedPaymentTest.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.telegram.model.IncomingMessage;
+import org.apache.camel.component.telegram.model.payments.RefundedPayment;
+import org.apache.camel.component.telegram.util.TelegramMockRoutes;
+import org.apache.camel.component.telegram.util.TelegramTestSupport;
+import org.apache.camel.component.telegram.util.TelegramTestUtil;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Tests that refunded payment updates are properly received and converted.
+ */
+public class TelegramConsumerRefundedPaymentTest extends TelegramTestSupport {
+
+ @EndpointInject("mock:telegram")
+ private MockEndpoint endpoint;
+
+ @Test
+ public void testReceptionOfRefundedPayment() throws Exception {
+ endpoint.expectedMinimumMessageCount(1);
+ endpoint.assertIsSatisfied(5000);
+
+ Exchange exchange = endpoint.getExchanges().get(0);
+ IncomingMessage message = exchange.getIn().getBody(IncomingMessage.class);
+
+ assertNotNull(message);
+ RefundedPayment refundedPayment = message.getRefundedPayment();
+ assertNotNull(refundedPayment);
+
+ assertEquals("XTR", refundedPayment.getCurrency());
+ assertEquals(Integer.valueOf(500), refundedPayment.getTotalAmount());
+ assertEquals("star_purchase_payload", refundedPayment.getInvoicePayload());
+ assertEquals("telegram_refund_charge_789", refundedPayment.getTelegramPaymentChargeId());
+ assertEquals("provider_refund_charge_012", refundedPayment.getProviderPaymentChargeId());
+ }
+
+ @Override
+ protected RoutesBuilder[] createRouteBuilders() {
+ return new RoutesBuilder[] {
+ getMockRoutes(),
+ new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("telegram:bots?authorizationToken=mock-token")
+ .to("mock:telegram");
+ }
+ } };
+ }
+
+ @Override
+ protected TelegramMockRoutes createMockRoutes() {
+ return new TelegramMockRoutes(port)
+ .addEndpoint(
+ "getUpdates",
+ "GET",
+ String.class,
+ TelegramTestUtil.stringResource("messages/updates-refunded-payment.json"),
+ TelegramTestUtil.stringResource("messages/updates-empty.json"));
+ }
+}
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerStarPaymentTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerStarPaymentTest.java
new file mode 100644
index 000000000000..072e76306968
--- /dev/null
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerStarPaymentTest.java
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.telegram.model.payments.EditUserStarSubscriptionMessage;
+import org.apache.camel.component.telegram.model.payments.GetMyStarBalanceMessage;
+import org.apache.camel.component.telegram.model.payments.GetStarTransactionsMessage;
+import org.apache.camel.component.telegram.model.payments.MessageResultStarAmount;
+import org.apache.camel.component.telegram.model.payments.MessageResultStarTransactions;
+import org.apache.camel.component.telegram.model.payments.RefundStarPaymentMessage;
+import org.apache.camel.component.telegram.model.payments.StarAmount;
+import org.apache.camel.component.telegram.model.payments.StarTransaction;
+import org.apache.camel.component.telegram.model.payments.StarTransactions;
+import org.apache.camel.component.telegram.util.TelegramMockRoutes;
+import org.apache.camel.component.telegram.util.TelegramMockRoutes.MockProcessor;
+import org.apache.camel.component.telegram.util.TelegramTestSupport;
+import org.apache.camel.component.telegram.util.TelegramTestUtil;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests a producer that handles Telegram Star payment operations.
+ */
+public class TelegramProducerStarPaymentTest extends TelegramTestSupport {
+
+ @Test
+ public void testGetMyStarBalance() {
+ GetMyStarBalanceMessage msg = new GetMyStarBalanceMessage();
+
+ MessageResultStarAmount result = template.requestBody("direct:telegram", msg, MessageResultStarAmount.class);
+
+ assertThat(result).isNotNull();
+ assertThat(result.isOk()).isTrue();
+
+ StarAmount starAmount = result.getStarAmount();
+ assertThat(starAmount).isNotNull();
+ assertThat(starAmount.getAmount()).isEqualTo(1500);
+ assertThat(starAmount.getNanostarAmount()).isEqualTo(500000000);
+
+ final MockProcessor<GetMyStarBalanceMessage> mockProcessor = getMockRoutes().getMock("getMyStarBalance");
+ assertThat(mockProcessor.awaitRecordedMessages(1, 5000)).hasSize(1);
+ }
+
+ @Test
+ public void testGetStarTransactions() {
+ GetStarTransactionsMessage msg = new GetStarTransactionsMessage();
+
+ MessageResultStarTransactions result
+ = template.requestBody("direct:telegram", msg, MessageResultStarTransactions.class);
+
+ assertThat(result).isNotNull();
+ assertThat(result.isOk()).isTrue();
+
+ StarTransactions starTransactions = result.getStarTransactions();
+ assertThat(starTransactions).isNotNull();
+ assertThat(starTransactions.getTransactions()).hasSize(2);
+
+ StarTransaction firstTxn = starTransactions.getTransactions().get(0);
+ assertThat(firstTxn.getId()).isEqualTo("txn_001");
+ assertThat(firstTxn.getAmount()).isEqualTo(100);
+ assertThat(firstTxn.getNanostarAmount()).isEqualTo(0);
+ assertThat(firstTxn.getDate()).isEqualTo(1704067200L);
+ assertThat(firstTxn.getSource()).isNotNull();
+
+ StarTransaction secondTxn = starTransactions.getTransactions().get(1);
+ assertThat(secondTxn.getId()).isEqualTo("txn_002");
+ assertThat(secondTxn.getAmount()).isEqualTo(50);
+ assertThat(secondTxn.getNanostarAmount()).isEqualTo(250000000);
+ assertThat(secondTxn.getReceiver()).isNotNull();
+
+ final MockProcessor<GetStarTransactionsMessage> mockProcessor = getMockRoutes().getMock("getStarTransactions");
+ assertThat(mockProcessor.awaitRecordedMessages(1, 5000)).hasSize(1);
+ }
+
+ @Test
+ public void testGetStarTransactionsWithOffsetAndLimit() {
+ GetStarTransactionsMessage msg = new GetStarTransactionsMessage(10, 50);
+
+ template.requestBody("direct:telegram", msg, MessageResultStarTransactions.class);
+
+ final MockProcessor<GetStarTransactionsMessage> mockProcessor = getMockRoutes().getMock("getStarTransactions");
+ GetStarTransactionsMessage recorded = mockProcessor.awaitRecordedMessages(1, 5000).get(0);
+ assertThat(recorded.getOffset()).isEqualTo(10);
+ assertThat(recorded.getLimit()).isEqualTo(50);
+ }
+
+ @Test
+ public void testRefundStarPayment() {
+ RefundStarPaymentMessage msg = new RefundStarPaymentMessage(1585844777L, "telegram_charge_123");
+
+ template.requestBody("direct:telegram", msg);
+
+ final MockProcessor<RefundStarPaymentMessage> mockProcessor = getMockRoutes().getMock("refundStarPayment");
+ RefundStarPaymentMessage recorded = mockProcessor.awaitRecordedMessages(1, 5000).get(0);
+ assertThat(recorded.getUserId()).isEqualTo(1585844777L);
+ assertThat(recorded.getTelegramPaymentChargeId()).isEqualTo("telegram_charge_123");
+ }
+
+ @Test
+ public void testEditUserStarSubscriptionCancel() {
+ EditUserStarSubscriptionMessage msg = new EditUserStarSubscriptionMessage(1585844777L, "subscription_charge_456", true);
+
+ template.requestBody("direct:telegram", msg);
+
+ final MockProcessor<EditUserStarSubscriptionMessage> mockProcessor
+ = getMockRoutes().getMock("editUserStarSubscription");
+ EditUserStarSubscriptionMessage recorded = mockProcessor.awaitRecordedMessages(1, 5000).get(0);
+ assertThat(recorded.getUserId()).isEqualTo(1585844777L);
+ assertThat(recorded.getTelegramPaymentChargeId()).isEqualTo("subscription_charge_456");
+ assertThat(recorded.getIsCanceled()).isTrue();
+ }
+
+ @Test
+ public void testEditUserStarSubscriptionReEnable() {
+ EditUserStarSubscriptionMessage msg
+ = new EditUserStarSubscriptionMessage(1585844777L, "subscription_charge_789", false);
+
+ template.requestBody("direct:telegram", msg);
+
+ final MockProcessor<EditUserStarSubscriptionMessage> mockProcessor
+ = getMockRoutes().getMock("editUserStarSubscription");
+ EditUserStarSubscriptionMessage recorded = mockProcessor.awaitRecordedMessages(1, 5000).get(0);
+ assertThat(recorded.getUserId()).isEqualTo(1585844777L);
+ assertThat(recorded.getTelegramPaymentChargeId()).isEqualTo("subscription_charge_789");
+ assertThat(recorded.getIsCanceled()).isFalse();
+ }
+
+ @Override
+ protected RoutesBuilder[] createRouteBuilders() {
+ return new RoutesBuilder[] {
+ getMockRoutes(),
+ new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:telegram").to("telegram:bots?authorizationToken=mock-token&chatId=" + chatId);
+ }
+ } };
+ }
+
+ @Override
+ protected TelegramMockRoutes createMockRoutes() {
+ return new TelegramMockRoutes(port)
+ .addEndpoint(
+ "getMyStarBalance",
+ "POST",
+ GetMyStarBalanceMessage.class,
+ TelegramTestUtil.stringResource("messages/get-my-star-balance.json"))
+ .addEndpoint(
+ "getStarTransactions",
+ "POST",
+ GetStarTransactionsMessage.class,
+ TelegramTestUtil.stringResource("messages/get-star-transactions.json"))
+ .addEndpoint(
+ "refundStarPayment",
+ "POST",
+ RefundStarPaymentMessage.class,
+ TelegramTestUtil.stringResource("messages/refund-star-payment.json"))
+ .addEndpoint(
+ "editUserStarSubscription",
+ "POST",
+ EditUserStarSubscriptionMessage.class,
+ TelegramTestUtil.stringResource("messages/edit-user-star-subscription.json"));
+ }
+}
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/model/GiftMappingTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/model/GiftMappingTest.java
new file mode 100644
index 000000000000..79b07183fa64
--- /dev/null
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/model/GiftMappingTest.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import org.apache.camel.component.telegram.util.TelegramTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Tests the JSON mapping of Gift and GiftBackground models.
+ */
+public class GiftMappingTest {
+
+ @Test
+ public void testGiftWithAllFieldsMapping() {
+ Gift gift = TelegramTestSupport.getJSONResource("messages/gift.json", Gift.class);
+
+ assertNotNull(gift);
+ assertEquals("gift_12345", gift.getId());
+ assertEquals(Integer.valueOf(100), gift.getStarCount());
+ assertEquals(Integer.valueOf(500), gift.getUpgradeStarCount());
+ assertTrue(gift.getIsPremium());
+ assertTrue(gift.getHasColors());
+ assertEquals(Integer.valueOf(1000), gift.getTotalCount());
+ assertEquals(Integer.valueOf(750), gift.getRemainingCount());
+ assertEquals(Integer.valueOf(50), gift.getPersonalTotalCount());
+ assertEquals(Integer.valueOf(45), gift.getPersonalRemainingCount());
+ assertEquals(Integer.valueOf(10), gift.getUniqueGiftVariantCount());
+
+ // Verify sticker
+ IncomingSticker sticker = gift.getSticker();
+ assertNotNull(sticker);
+ assertEquals("CAACAgIAAxkBAAIBZ2XXXXXX", sticker.getFileId());
+ assertEquals("AgADXXXXXXXX", sticker.getFileUniqueId());
+ assertEquals(Integer.valueOf(512), sticker.getWidth());
+ assertEquals(Integer.valueOf(512), sticker.getHeight());
+ assertEquals("regular", sticker.getType());
+
+ // Verify background
+ GiftBackground background = gift.getBackground();
+ assertNotNull(background);
+ assertEquals(Integer.valueOf(16711680), background.getCenterColor()); // Red (0xFF0000)
+ assertEquals(Integer.valueOf(255), background.getEdgeColor()); // Blue (0x0000FF)
+ assertEquals(Integer.valueOf(16777215), background.getTextColor()); // White (0xFFFFFF)
+
+ // Verify publisher chat
+ Chat publisherChat = gift.getPublisherChat();
+ assertNotNull(publisherChat);
+ assertEquals("-1001234567890", publisherChat.getId());
+ assertEquals("Gift Shop", publisherChat.getTitle());
+ assertEquals("channel", publisherChat.getType());
+ }
+
+ @Test
+ public void testSimpleGiftMapping() {
+ Gift gift = TelegramTestSupport.getJSONResource("messages/gift-simple.json", Gift.class);
+
+ assertNotNull(gift);
+ assertEquals("gift_simple_001", gift.getId());
+ assertEquals(Integer.valueOf(50), gift.getStarCount());
+
+ // Verify sticker exists
+ assertNotNull(gift.getSticker());
+ assertEquals("CAACAgIAAxkBAAISimpleGift", gift.getSticker().getFileId());
+
+ // Optional fields should be null
+ assertNull(gift.getUpgradeStarCount());
+ assertNull(gift.getIsPremium());
+ assertNull(gift.getHasColors());
+ assertNull(gift.getTotalCount());
+ assertNull(gift.getRemainingCount());
+ assertNull(gift.getPersonalTotalCount());
+ assertNull(gift.getPersonalRemainingCount());
+ assertNull(gift.getBackground());
+ assertNull(gift.getUniqueGiftVariantCount());
+ assertNull(gift.getPublisherChat());
+ }
+
+ @Test
+ public void testGiftBackgroundMapping() {
+ Gift gift = TelegramTestSupport.getJSONResource("messages/gift.json", Gift.class);
+ GiftBackground background = gift.getBackground();
+
+ assertNotNull(background);
+
+ // Test RGB color values
+ // Red: 16711680 = 0xFF0000
+ assertEquals(Integer.valueOf(16711680), background.getCenterColor());
+
+ // Blue: 255 = 0x0000FF
+ assertEquals(Integer.valueOf(255), background.getEdgeColor());
+
+ // White: 16777215 = 0xFFFFFF
+ assertEquals(Integer.valueOf(16777215), background.getTextColor());
+ }
+}
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/model/PaidMediaMappingTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/model/PaidMediaMappingTest.java
new file mode 100644
index 000000000000..e4a0d58cd528
--- /dev/null
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/model/PaidMediaMappingTest.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.telegram.model;
+
+import org.apache.camel.component.telegram.util.TelegramTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+/**
+ * Tests the JSON mapping of PaidMedia polymorphic types.
+ */
+public class PaidMediaMappingTest {
+
+ @Test
+ public void testPaidMediaPreviewMapping() {
+ PaidMedia paidMedia = TelegramTestSupport.getJSONResource("messages/paid-media-preview.json", PaidMedia.class);
+
+ assertNotNull(paidMedia);
+ assertInstanceOf(PaidMediaPreview.class, paidMedia);
+ assertEquals("preview", paidMedia.getType());
+
+ PaidMediaPreview preview = paidMedia.asPreview();
+ assertNotNull(preview);
+ assertEquals(Integer.valueOf(1920), preview.getWidth());
+ assertEquals(Integer.valueOf(1080), preview.getHeight());
+ assertEquals(Integer.valueOf(120), preview.getDuration());
+
+ // Verify convenience methods return null for wrong types
+ assertNull(paidMedia.asPhoto());
+ assertNull(paidMedia.asVideo());
+ }
+
+ @Test
+ public void testPaidMediaPhotoMapping() {
+ PaidMedia paidMedia = TelegramTestSupport.getJSONResource("messages/paid-media-photo.json", PaidMedia.class);
+
+ assertNotNull(paidMedia);
+ assertInstanceOf(PaidMediaPhoto.class, paidMedia);
+ assertEquals("photo", paidMedia.getType());
+
+ PaidMediaPhoto photo = paidMedia.asPhoto();
+ assertNotNull(photo);
+ assertNotNull(photo.getPhoto());
+ assertEquals(2, photo.getPhoto().size());
+
+ IncomingPhotoSize smallPhoto = photo.getPhoto().get(0);
+ assertEquals("AgACAgIAAx0CXX1XXXXXAQI", smallPhoto.getFileId());
+ assertEquals(Integer.valueOf(320), smallPhoto.getWidth());
+ assertEquals(Integer.valueOf(240), smallPhoto.getHeight());
+ assertEquals(Long.valueOf(15234), smallPhoto.getFileSize());
+
+ IncomingPhotoSize largePhoto = photo.getPhoto().get(1);
+ assertEquals("AgACAgIAAx0CXX1XXXXXAQJ", largePhoto.getFileId());
+ assertEquals(Integer.valueOf(800), largePhoto.getWidth());
+ assertEquals(Integer.valueOf(600), largePhoto.getHeight());
+
+ // Verify convenience methods return null for wrong types
+ assertNull(paidMedia.asPreview());
+ assertNull(paidMedia.asVideo());
+ }
+
+ @Test
+ public void testPaidMediaVideoMapping() {
+ PaidMedia paidMedia = TelegramTestSupport.getJSONResource("messages/paid-media-video.json", PaidMedia.class);
+
+ assertNotNull(paidMedia);
+ assertInstanceOf(PaidMediaVideo.class, paidMedia);
+ assertEquals("video", paidMedia.getType());
+
+ PaidMediaVideo videoMedia = paidMedia.asVideo();
+ assertNotNull(videoMedia);
+
+ IncomingVideo video = videoMedia.getVideo();
+ assertNotNull(video);
+ assertEquals("BAADBAADAgADyzvwCC7_premium_video", video.getFileId());
+ assertEquals("AgADyzvwCC7_unique", video.getFileUniqueId());
+ assertEquals(Integer.valueOf(1920), video.getWidth());
+ assertEquals(Integer.valueOf(1080), video.getHeight());
+ assertEquals(Integer.valueOf(180), video.getDurationSeconds());
+ assertEquals("premium_video.mp4", video.getFileName());
+ assertEquals("video/mp4", video.getMimeType());
+ assertEquals(Long.valueOf(52428800), video.getFileSize());
+
+ // Check thumbnail
+ IncomingPhotoSize thumbnail = video.getThumbnail();
+ assertNotNull(thumbnail);
+ assertEquals("AAQEABMlaUQZAAT1video_thumb", thumbnail.getFileId());
+ assertEquals(Integer.valueOf(320), thumbnail.getWidth());
+ assertEquals(Integer.valueOf(180), thumbnail.getHeight());
+
+ // Verify convenience methods return null for wrong types
+ assertNull(paidMedia.asPreview());
+ assertNull(paidMedia.asPhoto());
+ }
+}
diff --git a/components/camel-telegram/src/test/resources/messages/edit-user-star-subscription.json b/components/camel-telegram/src/test/resources/messages/edit-user-star-subscription.json
new file mode 100644
index 000000000000..a1072183ebd8
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/edit-user-star-subscription.json
@@ -0,0 +1,4 @@
+{
+ "ok": true,
+ "result": true
+}
diff --git a/components/camel-telegram/src/test/resources/messages/get-my-star-balance.json b/components/camel-telegram/src/test/resources/messages/get-my-star-balance.json
new file mode 100644
index 000000000000..cbd1600065c7
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/get-my-star-balance.json
@@ -0,0 +1,7 @@
+{
+ "ok": true,
+ "result": {
+ "amount": 1500,
+ "nanostar_amount": 500000000
+ }
+}
diff --git a/components/camel-telegram/src/test/resources/messages/get-star-transactions.json b/components/camel-telegram/src/test/resources/messages/get-star-transactions.json
new file mode 100644
index 000000000000..7fe5e2149374
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/get-star-transactions.json
@@ -0,0 +1,36 @@
+{
+ "ok": true,
+ "result": {
+ "transactions": [
+ {
+ "id": "txn_001",
+ "amount": 100,
+ "nanostar_amount": 0,
+ "date": 1704067200,
+ "source": {
+ "type": "user",
+ "user": {
+ "id": 1585844777,
+ "is_bot": false,
+ "first_name": "John",
+ "last_name": "Doe"
+ }
+ }
+ },
+ {
+ "id": "txn_002",
+ "amount": 50,
+ "nanostar_amount": 250000000,
+ "date": 1704153600,
+ "receiver": {
+ "type": "fragment",
+ "withdrawal_state": {
+ "type": "succeeded",
+ "date": 1704153700,
+ "url": "https://fragment.com/withdrawal/abc123"
+ }
+ }
+ }
+ ]
+ }
+}
diff --git a/components/camel-telegram/src/test/resources/messages/gift-simple.json b/components/camel-telegram/src/test/resources/messages/gift-simple.json
new file mode 100644
index 000000000000..e3ec0ceffe83
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/gift-simple.json
@@ -0,0 +1,13 @@
+{
+ "id": "gift_simple_001",
+ "sticker": {
+ "file_id": "CAACAgIAAxkBAAISimpleGift",
+ "file_unique_id": "AgADSimpleGift",
+ "type": "regular",
+ "width": 512,
+ "height": 512,
+ "is_animated": false,
+ "is_video": false
+ },
+ "star_count": 50
+}
diff --git a/components/camel-telegram/src/test/resources/messages/gift.json b/components/camel-telegram/src/test/resources/messages/gift.json
new file mode 100644
index 000000000000..d1c77118a72a
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/gift.json
@@ -0,0 +1,31 @@
+{
+ "id": "gift_12345",
+ "sticker": {
+ "file_id": "CAACAgIAAxkBAAIBZ2XXXXXX",
+ "file_unique_id": "AgADXXXXXXXX",
+ "type": "regular",
+ "width": 512,
+ "height": 512,
+ "is_animated": false,
+ "is_video": false
+ },
+ "star_count": 100,
+ "upgrade_star_count": 500,
+ "is_premium": true,
+ "has_colors": true,
+ "total_count": 1000,
+ "remaining_count": 750,
+ "personal_total_count": 50,
+ "personal_remaining_count": 45,
+ "background": {
+ "center_color": 16711680,
+ "edge_color": 255,
+ "text_color": 16777215
+ },
+ "unique_gift_variant_count": 10,
+ "publisher_chat": {
+ "id": "-1001234567890",
+ "title": "Gift Shop",
+ "type": "channel"
+ }
+}
diff --git a/components/camel-telegram/src/test/resources/messages/paid-media-photo.json b/components/camel-telegram/src/test/resources/messages/paid-media-photo.json
new file mode 100644
index 000000000000..355b59843730
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/paid-media-photo.json
@@ -0,0 +1,19 @@
+{
+ "type": "photo",
+ "photo": [
+ {
+ "file_id": "AgACAgIAAx0CXX1XXXXXAQI",
+ "file_unique_id": "AQADAgATXXXXXX",
+ "file_size": 15234,
+ "width": 320,
+ "height": 240
+ },
+ {
+ "file_id": "AgACAgIAAx0CXX1XXXXXAQJ",
+ "file_unique_id": "AQADAgATXXXXXY",
+ "file_size": 45678,
+ "width": 800,
+ "height": 600
+ }
+ ]
+}
diff --git a/components/camel-telegram/src/test/resources/messages/paid-media-preview.json b/components/camel-telegram/src/test/resources/messages/paid-media-preview.json
new file mode 100644
index 000000000000..ec37fcbe1cb5
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/paid-media-preview.json
@@ -0,0 +1,6 @@
+{
+ "type": "preview",
+ "width": 1920,
+ "height": 1080,
+ "duration": 120
+}
diff --git a/components/camel-telegram/src/test/resources/messages/paid-media-video.json b/components/camel-telegram/src/test/resources/messages/paid-media-video.json
new file mode 100644
index 000000000000..b439cff9d087
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/paid-media-video.json
@@ -0,0 +1,20 @@
+{
+ "type": "video",
+ "video": {
+ "file_id": "BAADBAADAgADyzvwCC7_premium_video",
+ "file_unique_id": "AgADyzvwCC7_unique",
+ "width": 1920,
+ "height": 1080,
+ "duration": 180,
+ "thumbnail": {
+ "file_id": "AAQEABMlaUQZAAT1video_thumb",
+ "file_unique_id": "thumb_unique",
+ "file_size": 2048,
+ "width": 320,
+ "height": 180
+ },
+ "file_name": "premium_video.mp4",
+ "mime_type": "video/mp4",
+ "file_size": 52428800
+ }
+}
diff --git a/components/camel-telegram/src/test/resources/messages/refund-star-payment.json b/components/camel-telegram/src/test/resources/messages/refund-star-payment.json
new file mode 100644
index 000000000000..a1072183ebd8
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/refund-star-payment.json
@@ -0,0 +1,4 @@
+{
+ "ok": true,
+ "result": true
+}
diff --git a/components/camel-telegram/src/test/resources/messages/updates-media-video-extended.json b/components/camel-telegram/src/test/resources/messages/updates-media-video-extended.json
new file mode 100644
index 000000000000..685546857021
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/updates-media-video-extended.json
@@ -0,0 +1,63 @@
+{
+ "ok": true,
+ "result": [
+ {
+ "update_id": 525704124,
+ "message": {
+ "message_id": 2312,
+ "from": {
+ "id": 149961111,
+ "first_name": "John",
+ "last_name": "Doe"
+ },
+ "chat": {
+ "id": 149961666,
+ "first_name": "John",
+ "last_name": "Doe",
+ "type": "private"
+ },
+ "date": 1463668900,
+ "video": {
+ "file_id": "BAADBAADAgADyzvwCC7_extended_video",
+ "file_unique_id": "AgADyzvwCC7_extended_unique",
+ "width": 1920,
+ "height": 1080,
+ "duration": 300,
+ "thumb": {
+ "file_id": "AAQEABMlaUQZAAT1thumb_old",
+ "file_size": 1958,
+ "width": 90,
+ "height": 50
+ },
+ "thumbnail": {
+ "file_id": "AAQEABMlaUQZAAT1thumb_new",
+ "file_unique_id": "thumb_new_unique",
+ "file_size": 2048,
+ "width": 320,
+ "height": 180
+ },
+ "cover": [
+ {
+ "file_id": "cover_small_id",
+ "file_unique_id": "cover_small_unique",
+ "file_size": 1024,
+ "width": 160,
+ "height": 90
+ },
+ {
+ "file_id": "cover_large_id",
+ "file_unique_id": "cover_large_unique",
+ "file_size": 4096,
+ "width": 640,
+ "height": 360
+ }
+ ],
+ "start_timestamp": 15,
+ "file_name": "extended_video.mp4",
+ "mime_type": "video/mp4",
+ "file_size": 104857600
+ }
+ }
+ }
+ ]
+}
diff --git a/components/camel-telegram/src/test/resources/messages/updates-paid-media-purchased.json b/components/camel-telegram/src/test/resources/messages/updates-paid-media-purchased.json
new file mode 100644
index 000000000000..1918941d9885
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/updates-paid-media-purchased.json
@@ -0,0 +1,18 @@
+{
+ "ok": true,
+ "result": [
+ {
+ "update_id": 219398830,
+ "purchased_paid_media": {
+ "from": {
+ "id": 1585844777,
+ "is_bot": false,
+ "first_name": "John",
+ "last_name": "Doe",
+ "username": "johndoe"
+ },
+ "paid_media_payload": "premium_content_12345"
+ }
+ }
+ ]
+}
diff --git a/components/camel-telegram/src/test/resources/messages/updates-refunded-payment.json b/components/camel-telegram/src/test/resources/messages/updates-refunded-payment.json
new file mode 100644
index 000000000000..d2679766924f
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/messages/updates-refunded-payment.json
@@ -0,0 +1,30 @@
+{
+ "ok": true,
+ "result": [
+ {
+ "update_id": 219398831,
+ "message": {
+ "message_id": 12346,
+ "from": {
+ "id": 1585844777,
+ "first_name": "John",
+ "last_name": "Doe"
+ },
+ "date": 1234567890,
+ "chat": {
+ "id": 1585844777,
+ "first_name": "John",
+ "last_name": "Doe",
+ "type": "private"
+ },
+ "refunded_payment": {
+ "currency": "XTR",
+ "total_amount": 500,
+ "invoice_payload": "star_purchase_payload",
+ "telegram_payment_charge_id": "telegram_refund_charge_789",
+ "provider_payment_charge_id": "provider_refund_charge_012"
+ }
+ }
+ }
+ ]
+}