Skip to content

Commit

Permalink
Api Version 7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenlagus committed Jul 7, 2024
1 parent 7ea74eb commit 0d19e55
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<packaging>pom</packaging>
<version>7.6.1</version>
<version>7.7.0</version>

<modules>
<module>telegrambots-meta</module>
Expand Down
6 changes: 3 additions & 3 deletions telegrambots-abilities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-abilities</artifactId>
Expand Down Expand Up @@ -104,12 +104,12 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-webhook</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</dependency>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-longpolling</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<name>Telegram Bots Client</name>
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-extensions</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambots-extensions:7.6.1'
implementation 'org.telegram:telegrambots-extensions:7.7.0'
```
6 changes: 3 additions & 3 deletions telegrambots-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-extensions</artifactId>
Expand Down Expand Up @@ -89,12 +89,12 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-webhook</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</dependency>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-longpolling</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-longpolling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-longpolling</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-meta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-meta</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<MessageEntity> getEntities() {
if (entities != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 2 additions & 2 deletions telegrambots-springboot-longpolling-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-springboot-longpolling-starter</artifactId>
Expand Down Expand Up @@ -71,7 +71,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<telegrambots.version>7.6.1</telegrambots.version>
<telegrambots.version>7.7.0</telegrambots.version>
<spring.version>3.2.3</spring.version>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions telegrambots-springboot-webhook-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-springboot-webhook-starter</artifactId>
Expand Down Expand Up @@ -71,7 +71,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<telegrambots.version>7.6.1</telegrambots.version>
<telegrambots.version>7.7.0</telegrambots.version>
<spring.version>3.2.3</spring.version>
<jackson.version>2.16.1</jackson.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-test-reports/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-test-reports</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-webhook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>7.6.1</version>
<version>7.7.0</version>
</parent>

<artifactId>telegrambots-webhook</artifactId>
Expand Down

0 comments on commit 0d19e55

Please sign in to comment.