diff --git a/README.md b/README.md index 2538533e..d103872c 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,14 @@ Java library for interacting with [Telegram Bot API](https://core.telegram.org/b Gradle: ```groovy -implementation 'com.github.pengrad:java-telegram-bot-api:7.6.0' +implementation 'com.github.pengrad:java-telegram-bot-api:7.7.0' ``` Maven: ```xml com.github.pengrad java-telegram-bot-api - 7.6.0 + 7.7.0 ``` [JAR with all dependencies on release page](https://github.com/pengrad/java-telegram-bot-api/releases) diff --git a/README_RU.md b/README_RU.md index 100b98ec..01dfb343 100644 --- a/README_RU.md +++ b/README_RU.md @@ -13,14 +13,14 @@ Java библиотека, созданная для работы с [Telegram B Gradle: ```groovy -implementation 'com.github.pengrad:java-telegram-bot-api:7.6.0' +implementation 'com.github.pengrad:java-telegram-bot-api:7.7.0' ``` Maven: ```xml com.github.pengrad java-telegram-bot-api - 7.6.0 + 7.7.0 ``` Также JAR со всеми зависимостями можно найти [в релизах](https://github.com/pengrad/java-telegram-bot-api/releases). diff --git a/gradle.properties b/gradle.properties index 43e7f867..865d7b10 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.github.pengrad -VERSION_NAME=7.6.0 +VERSION_NAME=7.7.0 POM_DESCRIPTION=Java API for Telegram Bot API POM_URL=https://github.com/pengrad/java-telegram-bot-api/ diff --git a/library/src/main/java/com/pengrad/telegrambot/model/Message.java b/library/src/main/java/com/pengrad/telegrambot/model/Message.java index 1ce20713..bb1d17c7 100644 --- a/library/src/main/java/com/pengrad/telegrambot/model/Message.java +++ b/library/src/main/java/com/pengrad/telegrambot/model/Message.java @@ -77,6 +77,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable { private MaybeInaccessibleMessage pinned_message; private Invoice invoice; private SuccessfulPayment successful_payment; + private RefundedPayment refunded_payment; private Story story; private UserShared user_shared; //@deprectated private UsersShared users_shared; @@ -399,6 +400,10 @@ public SuccessfulPayment successfulPayment() { return successful_payment; } + public RefundedPayment refundedPayment() { + return refunded_payment; + } + public Story story() { return story; } @@ -576,6 +581,7 @@ public boolean equals(Object o) { Objects.equals(pinned_message, message.pinned_message) && Objects.equals(invoice, message.invoice) && Objects.equals(successful_payment, message.successful_payment) && + Objects.equals(refunded_payment, message.refunded_payment) && Objects.equals(story, message.story) && Objects.equals(user_shared, message.user_shared) && Objects.equals(users_shared, message.users_shared) && @@ -667,6 +673,7 @@ public String toString() { ", pinned_message=" + pinned_message + ", invoice=" + invoice + ", successful_payment=" + successful_payment + + ", refunded_payment=" + refunded_payment + ", story=" + story + ", user_shared=" + user_shared + ", users_shared=" + users_shared + diff --git a/library/src/main/java/com/pengrad/telegrambot/model/RefundedPayment.java b/library/src/main/java/com/pengrad/telegrambot/model/RefundedPayment.java new file mode 100644 index 00000000..b780fc6e --- /dev/null +++ b/library/src/main/java/com/pengrad/telegrambot/model/RefundedPayment.java @@ -0,0 +1,73 @@ +package com.pengrad.telegrambot.model; + +import com.pengrad.telegrambot.model.stars.StarTransaction; + +import java.io.Serializable; +import java.util.Objects; + +public class RefundedPayment implements Serializable { + + private final static long serialVersionUID = 0L; + + private String currency; + + private Integer total_amount; + + private String invoice_payload; + + private String telegram_payment_charge_id; + + private String provider_payment_charge_id; + + public String currency() { + return currency; + } + + public Integer totalAmount() { + return total_amount; + } + + public String invoicePayload() { + return invoice_payload; + } + + public String telegramPaymentChargeId() { + return telegram_payment_charge_id; + } + + public String providerPaymentChargeId() { + return provider_payment_charge_id; + } + + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + RefundedPayment that = (RefundedPayment) o; + return Objects.equals(currency, that.currency) && + Objects.equals(total_amount, that.total_amount) && + Objects.equals(invoice_payload, that.invoice_payload) && + Objects.equals(telegram_payment_charge_id, that.telegram_payment_charge_id) && + Objects.equals(provider_payment_charge_id, that.provider_payment_charge_id); + } + + @Override + public int hashCode() { + return Objects.hash(currency, total_amount, invoice_payload, telegram_payment_charge_id, provider_payment_charge_id); + } + + @Override + public String toString() { + return "RefundedPayment{" + + "currency='" + currency + "'," + + "total_amount='" + total_amount + "'," + + "invoice_payload='" + invoice_payload + "'," + + "telegram_payment_charge_id='" + telegram_payment_charge_id + "'," + + "provider_payment_charge_id='" + provider_payment_charge_id + "'" + + '}'; + } + + +} diff --git a/pom.xml b/pom.xml index 00a83f6c..9493b2f4 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 com.github.pengrad java-telegram-bot-api - 7.6.0 + 7.7.0 JavaTelegramBotApi Java API for Telegram Bot API https://github.com/pengrad/java-telegram-bot-api/