示例#1
0
        public static string CreateInvoiceLink(this BotClient api, string title, string description, string payload, string providerToken, string currency, IEnumerable <LabeledPrice> prices, [Optional] uint?maxTipAmount, [Optional] IEnumerable <uint>?suggestedTipAmounts, [Optional] string?providerData, [Optional] string?photoUrl, [Optional] uint?photoSize, [Optional] uint?photoWidth, [Optional] uint?photoHeight, [Optional] bool?needName, [Optional] bool?needPhoneNumber, [Optional] bool?needEmail, [Optional] bool?needShippingAddress, [Optional] bool?sendPhoneNumberToProvider, [Optional] bool?sendEmailToProvider, [Optional] bool?isFlexible)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new CreateInvoiceLinkArgs(title, description, payload, providerToken, currency, prices)
            {
                MaxTipAmount              = maxTipAmount,
                SuggestedTipAmounts       = suggestedTipAmounts,
                ProviderData              = providerData,
                PhotoUrl                  = photoUrl,
                PhotoSize                 = photoSize,
                PhotoWidth                = photoWidth,
                PhotoHeight               = photoHeight,
                NeedName                  = needName,
                NeedPhoneNumber           = needPhoneNumber,
                NeedEmail                 = needEmail,
                NeedShippingAddress       = needShippingAddress,
                SendPhoneNumberToProvider = sendPhoneNumberToProvider,
                SendEmailToProvider       = sendEmailToProvider,
                IsFlexible                = isFlexible
            };

            return(api.RPC <string>(MethodNames.CreateInvoiceLink, args));
        }
示例#2
0
 public static async Task <string> CreateInvoiceLinkAsync(this BotClient api, CreateInvoiceLinkArgs args, [Optional] CancellationToken cancellationToken)
 {
     if (api == null)
     {
         throw new ArgumentNullException(nameof(api));
     }
     if (args == default)
     {
         throw new ArgumentNullException(nameof(args));
     }
     return(await api.RPCA <string>(MethodNames.CreateInvoiceLink, args, cancellationToken).ConfigureAwait(false));
 }
示例#3
0
 public static string CreateInvoiceLink(this BotClient api, CreateInvoiceLinkArgs args)
 {
     if (api == null)
     {
         throw new ArgumentNullException(nameof(api));
     }
     if (args == default)
     {
         throw new ArgumentNullException(nameof(args));
     }
     return(api.RPC <string>(MethodNames.CreateInvoiceLink, args));
 }