Star gifts API

This commit is contained in:
Ilya Laktyushin
2024-09-16 15:51:26 +04:00
parent f18f337f2c
commit f3eee0c021
25 changed files with 1333 additions and 826 deletions

View File

@@ -51,8 +51,14 @@ public final class BotCheckoutController: ViewController {
return .generic
}
|> mapToSignal { paymentForm -> Signal<InputData, FetchError> in
return context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: paymentForm.paymentBotId))
|> castError(FetchError.self)
let botPeer: Signal<EnginePeer?, FetchError>
if let paymentBotId = paymentForm.paymentBotId {
botPeer = context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: paymentBotId))
|> castError(FetchError.self)
} else {
botPeer = .single(nil)
}
return botPeer
|> mapToSignal { botPeer -> Signal<InputData, FetchError> in
if let current = paymentForm.savedInfo {
return context.engine.payments.validateBotPaymentForm(saveInfo: true, source: source, formInfo: current)