This commit is contained in:
hatim 2023-05-12 21:48:53 +02:00
parent ad75ba66c2
commit 494277a2d5
2 changed files with 4 additions and 3 deletions

View file

@ -132,6 +132,7 @@ export default class {
} }
async GetAppUserLNURLInfo(appId: string, req: Types.GetAppUserLNURLInfoRequest): Promise<Types.LnurlPayInfoResponse> { async GetAppUserLNURLInfo(appId: string, req: Types.GetAppUserLNURLInfoRequest): Promise<Types.LnurlPayInfoResponse> {
const user = await this.storage.applicationStorage.GetApplicationUser(appId, req.user_identifier) const user = await this.storage.applicationStorage.GetApplicationUser(appId, req.user_identifier)
return this.paymentManager.GetLnurlPayInfoFromUser(user.user.user_id, req.base_url_override) const app = await this.storage.applicationStorage.GetApplication(appId)
return this.paymentManager.GetLnurlPayInfoFromUser(user.user.user_id, app, req.base_url_override)
} }
} }

View file

@ -204,8 +204,8 @@ export default class {
} }
} }
async GetLnurlPayInfoFromUser(userId: string, baseUrl?: string): Promise<Types.LnurlPayInfoResponse> { async GetLnurlPayInfoFromUser(userId: string, linkedApplication?: Application, baseUrl?: string): Promise<Types.LnurlPayInfoResponse> {
const payK1 = await this.storage.paymentStorage.AddUserEphemeralKey(userId, 'pay') const payK1 = await this.storage.paymentStorage.AddUserEphemeralKey(userId, 'pay', linkedApplication)
const url = baseUrl ? baseUrl : `${this.settings.serviceUrl}/api/guest/lnurl_pay/handle` const url = baseUrl ? baseUrl : `${this.settings.serviceUrl}/api/guest/lnurl_pay/handle`
return { return {
tag: 'payRequest', tag: 'payRequest',