import { ConfigService, registerAs } from '@nestjs/config'
import { config } from 'dotenv'

config()

const configService = new ConfigService()

export default registerAs('weixin', () => {
    return {
        appId: configService.get<string>('WX_APP_ID'),
        appSecret: configService.get<string>('WX_APP_SECRET'),
        mchId: configService.get<string>('WX_MCH_ID'),
        mchKey: configService.get<string>('WX_MCH_KEY'),
        certSerial: configService.get<string>('WX_MCH_CERT_SERIAL'),
        certPath: configService.get<string>('WX_MCH_CERT_PATH'),
        notifyUrl: configService.get<string>('WX_NOTIFY_URL'),
    }
})
