-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fa45c6a
commit 8d5a2f3
Showing
17 changed files
with
158 additions
and
21 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
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
69 changes: 69 additions & 0 deletions
69
...org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/AffiliateInfo.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,69 @@ | ||
package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
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.interfaces.BotApiObject; | ||
import org.telegram.telegrambots.meta.api.objects.User; | ||
import org.telegram.telegrambots.meta.api.objects.chat.Chat; | ||
|
||
/** | ||
* @author Ruben Bermudez | ||
* @version 8.1 | ||
* Contains information about the affiliate that received a commission via this transaction. | ||
*/ | ||
@EqualsAndHashCode(callSuper = false) | ||
@Getter | ||
@Setter | ||
@ToString | ||
@RequiredArgsConstructor | ||
@SuperBuilder | ||
@Jacksonized | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class AffiliateInfo implements BotApiObject { | ||
private static final String AFFILIATE_USER_FIELD = "affiliate_user"; | ||
private static final String AFFILIATE_CHAT_FIELD = "affiliate_chat"; | ||
private static final String COMMISSION_PER_MILLE_FIELD = "commission_per_mille"; | ||
private static final String AMOUNT_FIELD = "amount"; | ||
private static final String NANO_STAR_AMOUNT_FIELD = "nanostar_amount"; | ||
|
||
/** | ||
* Optional. | ||
* The bot or the user that received an affiliate commission if it was received by a bot or a user | ||
*/ | ||
@JsonProperty(AFFILIATE_USER_FIELD) | ||
private User affiliateUser; | ||
/** | ||
* Optional. | ||
* The chat that received an affiliate commission if it was received by a chat | ||
*/ | ||
@JsonProperty(AFFILIATE_CHAT_FIELD) | ||
private Chat affiliateChat; | ||
/** | ||
* The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users | ||
*/ | ||
@JsonProperty(COMMISSION_PER_MILLE_FIELD) | ||
@NonNull | ||
private Integer commissionPerMille; | ||
/** | ||
* Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds | ||
*/ | ||
@JsonProperty(AMOUNT_FIELD) | ||
@NonNull | ||
private Integer amount; | ||
/** | ||
* Optional. | ||
* The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds | ||
*/ | ||
@JsonProperty(NANO_STAR_AMOUNT_FIELD) | ||
private Integer nanoStarAmount; | ||
} |
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
50 changes: 50 additions & 0 deletions
50
...bots/meta/api/objects/payments/transactionpartner/TransactionPartnerAffiliateProgram.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,50 @@ | ||
package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
import lombok.extern.jackson.Jacksonized; | ||
import org.telegram.telegrambots.meta.api.objects.User; | ||
|
||
/** | ||
* @author Ruben Bermudez | ||
* @version 8.1 | ||
* | ||
* Describes the affiliate program that issued the affiliate commission received via this transaction. | ||
*/ | ||
|
||
@EqualsAndHashCode(callSuper = false) | ||
@Getter | ||
@Setter | ||
@ToString | ||
@RequiredArgsConstructor | ||
@Jacksonized | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@SuperBuilder | ||
public class TransactionPartnerAffiliateProgram implements TransactionPartner { | ||
private static final String TYPE_FIELD = "type"; | ||
private static final String SPONSOR_USER_FIELD = "sponsor_user"; | ||
private static final String COMMISSION_PER_MILLE_FIELD = "commission_per_mille"; | ||
|
||
/** | ||
* Type of the transaction partner, always “affiliate_program” | ||
*/ | ||
@JsonProperty(TYPE_FIELD) | ||
private final String type = "affiliate_program"; | ||
/** | ||
* Optional. | ||
* Information about the bot that sponsored the affiliate program | ||
*/ | ||
@JsonProperty(SPONSOR_USER_FIELD) | ||
private User sponsorUser; | ||
/** | ||
* The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users | ||
*/ | ||
@JsonProperty(COMMISSION_PER_MILLE_FIELD) | ||
private Integer commissionPerMille; | ||
} |
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