forked from rubenlagus/TelegramBots
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61b18fb
commit 725c84c
Showing
13 changed files
with
78 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
.../src/main/java/org/telegram/telegrambots/meta/api/methods/payments/RefundStarPayment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
38 changes: 0 additions & 38 deletions
38
.../src/main/java/org/telegram/telegrambots/meta/api/objects/payments/RefundStarPayment.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters