diff --git a/pom.xml b/pom.xml index fae502f83..fc6c73df9 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots pom - 7.6.1 + 7.7.0 telegrambots-meta diff --git a/telegrambots-abilities/pom.xml b/telegrambots-abilities/pom.xml index f971ff383..be0d11b71 100644 --- a/telegrambots-abilities/pom.xml +++ b/telegrambots-abilities/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-abilities @@ -104,12 +104,12 @@ org.telegram telegrambots-webhook - 7.6.1 + 7.7.0 org.telegram telegrambots-longpolling - 7.6.1 + 7.7.0 diff --git a/telegrambots-client/pom.xml b/telegrambots-client/pom.xml index 896d59530..6d3b2ebd5 100644 --- a/telegrambots-client/pom.xml +++ b/telegrambots-client/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 Telegram Bots Client diff --git a/telegrambots-extensions/README.md b/telegrambots-extensions/README.md index 1a606a703..7a7ae89be 100644 --- a/telegrambots-extensions/README.md +++ b/telegrambots-extensions/README.md @@ -16,12 +16,12 @@ Just import add the library to your project with one of these options: org.telegram telegrambots-extensions - 7.6.1 + 7.7.0 ``` 2. Using Gradle: ```gradle - implementation 'org.telegram:telegrambots-extensions:7.6.1' + implementation 'org.telegram:telegrambots-extensions:7.7.0' ``` \ No newline at end of file diff --git a/telegrambots-extensions/pom.xml b/telegrambots-extensions/pom.xml index 97bfe9137..e0d3974fa 100644 --- a/telegrambots-extensions/pom.xml +++ b/telegrambots-extensions/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-extensions @@ -89,12 +89,12 @@ org.telegram telegrambots-webhook - 7.6.1 + 7.7.0 org.telegram telegrambots-longpolling - 7.6.1 + 7.7.0 diff --git a/telegrambots-longpolling/pom.xml b/telegrambots-longpolling/pom.xml index 60995060f..2d1da65c9 100644 --- a/telegrambots-longpolling/pom.xml +++ b/telegrambots-longpolling/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-longpolling diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml index 84417495c..dd49f542e 100644 --- a/telegrambots-meta/pom.xml +++ b/telegrambots-meta/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-meta diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java index 51d27fdd1..247e20852 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java @@ -51,6 +51,7 @@ import org.telegram.telegrambots.meta.api.objects.messageorigin.MessageOrigin; import org.telegram.telegrambots.meta.api.objects.passport.PassportData; import org.telegram.telegrambots.meta.api.objects.payments.Invoice; +import org.telegram.telegrambots.meta.api.objects.payments.RefundedPayment; import org.telegram.telegrambots.meta.api.objects.payments.SuccessfulPayment; import org.telegram.telegrambots.meta.api.objects.payments.paidmedia.PaidMediaInfo; import org.telegram.telegrambots.meta.api.objects.polls.Poll; @@ -173,6 +174,7 @@ public class Message implements MaybeInaccessibleMessage { private static final String EFFECT_ID_FIELD = "effect_id"; private static final String SHOW_CAPTION_ABOVE_MEDIA_FIELD = "show_caption_above_media"; private static final String PAID_MEDIA_FIELD = "paid_media"; + private static final String REFUNDED_PAYMENT_FIELD = "refunded_payment"; /** * Integer Unique message identifier @@ -743,6 +745,12 @@ public class Message implements MaybeInaccessibleMessage { */ @JsonProperty(PAID_MEDIA_FIELD) private PaidMediaInfo paidMedia; + /** + * Optional. + * Message is a service message about a refunded payment, information about the payment. + */ + @JsonProperty(REFUNDED_PAYMENT_FIELD) + private RefundedPayment refundedPayment; public List getEntities() { if (entities != null) { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/RefundedPayment.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/RefundedPayment.java new file mode 100644 index 000000000..73e004e2b --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/RefundedPayment.java @@ -0,0 +1,72 @@ +package org.telegram.telegrambots.meta.api.objects.payments; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; + +/** + * @author Ruben Bermudez + * @version 7.7 + * + * This object contains basic information about a refunded payment. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@AllArgsConstructor +@SuperBuilder +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +public class RefundedPayment implements BotApiObject { + private static final String CURRENCY_FIELD = "currency"; + private static final String TOTAL_AMOUNT_FIELD = "total_amount"; + private static final String INVOICE_PAYLOAD_FIELD = "invoice_payload"; + private static final String TELEGRAM_PAYMENT_CHARGE_ID_FIELD = "telegram_payment_charge_id"; + private static final String PROVIDER_PAYMENT_CHARGE_ID_FIELD = "provider_payment_charge_id"; + + /** + * Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. + * Currently, always “XTR” + */ + @JsonProperty(CURRENCY_FIELD) + @NonNull + private String currency; + /** + * Total refunded price in the smallest units of the currency (integer, not float/double). + * For example, for a price of US$ 1.45, total_amount = 145. + * See the exp parameter in currencies.json, it shows the number of digits past the decimal point + * for each currency (2 for the majority of currencies). + */ + @JsonProperty(TOTAL_AMOUNT_FIELD) + @NonNull + private Integer totalAmount; + /** + * Bot-specified invoice payload + */ + @JsonProperty(INVOICE_PAYLOAD_FIELD) + @NonNull + private String invoicePayload; + /** + * Telegram payment identifier + */ + @JsonProperty(TELEGRAM_PAYMENT_CHARGE_ID_FIELD) + @NonNull + private String telegramPaymentChargeId; + /** + * Optional. + * Provider payment identifier + */ + @JsonProperty(PROVIDER_PAYMENT_CHARGE_ID_FIELD) + private String providerPaymentChargeId; +} diff --git a/telegrambots-springboot-longpolling-starter/pom.xml b/telegrambots-springboot-longpolling-starter/pom.xml index be4dfb5ae..a7399ec66 100644 --- a/telegrambots-springboot-longpolling-starter/pom.xml +++ b/telegrambots-springboot-longpolling-starter/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-springboot-longpolling-starter @@ -71,7 +71,7 @@ UTF-8 UTF-8 - 7.6.1 + 7.7.0 3.2.3 diff --git a/telegrambots-springboot-webhook-starter/pom.xml b/telegrambots-springboot-webhook-starter/pom.xml index 68ab5df2d..e662554a9 100644 --- a/telegrambots-springboot-webhook-starter/pom.xml +++ b/telegrambots-springboot-webhook-starter/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-springboot-webhook-starter @@ -71,7 +71,7 @@ UTF-8 UTF-8 - 7.6.1 + 7.7.0 3.2.3 2.16.1 diff --git a/telegrambots-test-reports/pom.xml b/telegrambots-test-reports/pom.xml index df28b5d63..aafecc2d5 100644 --- a/telegrambots-test-reports/pom.xml +++ b/telegrambots-test-reports/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-test-reports diff --git a/telegrambots-webhook/pom.xml b/telegrambots-webhook/pom.xml index 3757d6730..9a841138d 100644 --- a/telegrambots-webhook/pom.xml +++ b/telegrambots-webhook/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.6.1 + 7.7.0 telegrambots-webhook