TransactionPartner.affiliateProgram constructor
- @Assert('type == TransactionPartnerType.affiliateProgram', 'type must be TransactionPartnerType.affiliateProgram')
- @JsonKey(name: 'type') @Default(TransactionPartnerType.affiliateProgram) TransactionPartnerType type,
- @JsonKey(name: 'sponsor_user') User? sponsorUser,
- @JsonKey(name: 'commission_per_mille') required int commissionPerMille,
Describes the affiliate program that issued the affiliate commission received via this transaction
Implementation
@Assert(
'type == TransactionPartnerType.affiliateProgram',
'type must be TransactionPartnerType.affiliateProgram',
)
const factory TransactionPartner.affiliateProgram({
/// Type of the transaction partner, must be "affiliate_program"
@JsonKey(name: 'type')
@Default(TransactionPartnerType.affiliateProgram)
TransactionPartnerType type,
/// Information about the bot that sponsored the affiliate program.
@JsonKey(name: 'sponsor_user') final 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.
@JsonKey(name: 'commission_per_mille')
required final int commissionPerMille,
}) = TransactionPartnerAffiliateProgram;