Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenlagus committed Jun 11, 2024
1 parent 61b18fb commit 725c84c
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 56 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.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</version>
</dependency>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-longpolling</artifactId>
<version>7.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambots-extensions:7.4.0'
implementation 'org.telegram:telegrambots-extensions:7.4.1'
```
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.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</version>
</dependency>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-longpolling</artifactId>
<version>7.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</version>
</parent>

<artifactId>telegrambots-meta</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.telegram.telegrambots.meta.api.methods.payments;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
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.methods.botapimethods.BotApiMethodBoolean;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;

/**
* @author Ruben Bermudez
* @version 7.4
*
* Refunds a successful payment in Telegram Stars. Returns True on success.
*/
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
public class RefundStarPayment extends BotApiMethodBoolean {
public static final String PATH = "refundStarPayment";

private static final String USER_ID_FIELD = "user_id";
private static final String TELEGRAM_PAYMENT_CHARGE_ID_FIELD = "telegram_payment_charge_id";

/**
* Identifier of the user whose payment will be refunded
*/
@JsonProperty(USER_ID_FIELD)
@NonNull
private Integer userId;
/**
* Telegram payment identifier
*/
@JsonProperty(TELEGRAM_PAYMENT_CHARGE_ID_FIELD)
@NonNull
private String telegramPaymentChargeId;

@Override
public String getMethod() {
return PATH;
}

@Override
public void validate() throws TelegramApiValidationException {
if (telegramPaymentChargeId.isEmpty()) {
throw new TelegramApiValidationException("TelegramPaymentChargeId parameter can't be empty", this);
}
}
}

This file was deleted.

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.4.0</version>
<version>7.4.1</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.4.0</telegrambots.version>
<telegrambots.version>7.4.1</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.4.0</version>
<version>7.4.1</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.4.0</telegrambots.version>
<telegrambots.version>7.4.1</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.4.0</version>
<version>7.4.1</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.4.0</version>
<version>7.4.1</version>
</parent>

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

0 comments on commit 725c84c

Please sign in to comment.