Merge pull request #754 from snake-eaterr/debits-fixies

log user idenifier and debit manager gets lnd and application manager
This commit is contained in:
Justin (shocknet) 2024-09-18 17:06:23 -04:00 committed by GitHub
commit 2229b3dfdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -50,6 +50,8 @@ export default class {
const user = await this.storage.userStorage.GetUser(ctx.user_id)
const app = await this.storage.applicationStorage.GetApplication(ctx.app_id)
const appUser = await this.storage.applicationStorage.GetAppUserFromUser(app, user.user_id)
console.log("User Identifier/pointer here", appUser?.identifier)
if (!appUser) {
throw new Error(`app user ${ctx.user_id} not found`) // TODO: fix logs doxing
}

View file

@ -42,8 +42,10 @@ export class DebitManager {
storage: Storage
lnd: LND
logger = getLogger({ component: 'DebitManager' })
constructor(storage: Storage) {
constructor(storage: Storage, lnd: LND, applicationManager: ApplicationManager) {
this.storage = storage
this.lnd = lnd
this.applicationManager = applicationManager
}
AuthorizeDebit = async (ctx: Types.UserContext, req: Types.DebitAuthorizationRequest): Promise<Types.DebitAuthorization> => {

View file

@ -71,7 +71,7 @@ export default class {
this.productManager = new ProductManager(this.storage, this.paymentManager, this.settings)
this.applicationManager = new ApplicationManager(this.storage, this.settings, this.paymentManager)
this.appUserManager = new AppUserManager(this.storage, this.settings, this.applicationManager)
this.debitManager = new DebitManager(this.storage)
this.debitManager = new DebitManager(this.storage, this.lnd, this.applicationManager)
}
Stop() {