diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 286acc02c..630779dab 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1531,7 +1531,7 @@ orderInfo name:string phone_number:string email_address:string shipping_address: //@description One shipping option @id Shipping option identifier @title Option title @price_parts A list of objects used to calculate the total shipping costs shippingOption id:string title:string price_parts:vector = ShippingOption; -//@description Contains information about saved card credentials @id Unique identifier of the saved credentials @title Title of the saved credentials +//@description Contains information about saved payment credentials @id Unique identifier of the saved credentials @title Title of the saved credentials savedCredentials id:string title:string = SavedCredentials; @@ -1574,13 +1574,13 @@ paymentOption title:string url:string = PaymentOption; //@payment_provider Information about the payment provider //@additional_payment_options The list of additional payment options //@saved_order_info Saved server-side order information; may be null -//@saved_credentials Information about saved card credentials; may be null +//@saved_credentials The list of saved payment credentials //@can_save_credentials True, if the user can choose to save credentials //@need_password True, if the user will be able to save credentials protected by a password they set up //@product_title Product title //@product_description Product description //@product_photo Product photo; may be null -paymentForm id:int64 invoice:invoice seller_bot_user_id:int53 payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector saved_order_info:orderInfo saved_credentials:savedCredentials can_save_credentials:Bool need_password:Bool product_title:string product_description:formattedText product_photo:photo = PaymentForm; +paymentForm id:int64 invoice:invoice seller_bot_user_id:int53 payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector saved_order_info:orderInfo saved_credentials:vector can_save_credentials:Bool need_password:Bool product_title:string product_description:formattedText product_photo:photo = PaymentForm; //@description Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options validatedOrderInfo order_info_id:string shipping_options:vector = ValidatedOrderInfo; diff --git a/td/telegram/Payments.cpp b/td/telegram/Payments.cpp index 47153d013..7aa3c52fa 100644 --- a/td/telegram/Payments.cpp +++ b/td/telegram/Payments.cpp @@ -331,13 +331,12 @@ static tl_object_ptr convert_order_info( convert_address(std::move(order_info->shipping_address_))); } -static tl_object_ptr convert_saved_credentials( +static vector> convert_saved_credentials( vector> saved_credentials) { - if (saved_credentials.empty()) { - return nullptr; - } - return make_tl_object(std::move(saved_credentials[0]->id_), - std::move(saved_credentials[0]->title_)); + return transform( + std::move(saved_credentials), [](tl_object_ptr &&credentials) { + return make_tl_object(std::move(credentials->id_), std::move(credentials->title_)); + }); } class GetPaymentFormQuery final : public Td::ResultHandler {