Class SuccessfulPayment

Hierarchy (view full)

  • Base
    • SuccessfulPayment

Constructors

Properties

currency: string

Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars

isFirstRecurring: boolean

True, if the payment is the first payment for a subscription

isRecurring: boolean

True, if the payment is a recurring payment for a subscription

orderInfo?: OrderInfo

Order information provided by the user

payload: string

Bot specified invoice payload

providedPaymentId: string

Provider payment identifier

shippingId?: string

Identifier of the shipping option chosen by the user

subscriptionExpirationUnixTime?: number

Expiration date of the subscription, in Unix time; for recurring payments only

telegramPaymentId: string

Telegram payment identifier

totalAmount: number

Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass 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).

Accessors

  • get editedAt(): null | Date
  • Date the subscription

    Returns null | Date

  • get subscriptionExpirationTimestamp(): null | number
  • Return the timestamp subscription, in milliseconds

    Returns null | number

Methods

  • Protected

    Creates a clone of the current instance

    Returns Base

    A clone of the current instance

  • Protected

    Patches the current instance with new data

    Parameters

    • data: Record<string, any>

      The data to patch the instance with

    Returns Record<string, any>

    The patched data

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars.

    Parameters

    • options: {
          isCanceled: boolean;
          userId: string | number;
      }

      out parameters.

      • isCanceled: boolean

        Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.

      • userId: string | number

        Identifier of the user whose subscription will be edited.

    Returns Promise<true>

    Returns True on success.

  • Refunds a successful payment in Telegram Stars.

    Parameters

    • userId: string | number

      Identifier of the user whose payment will be refunded

    Returns Promise<true>

    Returns True on success.

  • Flatten an object. Any properties that are collections will get converted to an array of keys.

    Parameters

    • OptionalpropsRecursive: boolean

      Optional. If true, calls toJSON method on nested objects.

    • Rest...props: Record<string, string | boolean>[]

      Optional. Specific properties to include/exclude, or rename.

    Returns Record<string, any>

    Flattened object.

  • Returns the id instance Chat, User, ChatMember and other

    Returns null | string