feat: add payment module and factory
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
|
||||
export function zarinpalConfig() {
|
||||
return {
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService) => ({
|
||||
merchantId: configService.getOrThrow<string>("ZARINPAL_MERCHANT_ID"),
|
||||
gatewayApiUrl: configService.getOrThrow<string>("ZARINPAL_API_URL"),
|
||||
callBackUrl: configService.getOrThrow<string>("CALLBACK_URL"),
|
||||
ipgType: configService.getOrThrow<string>("IPG_TYPE"),
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
export interface IZarinpalConfig {
|
||||
merchantId: string;
|
||||
gatewayApiUrl: string;
|
||||
callBackUrl: string;
|
||||
ipgType: string;
|
||||
}
|
||||
Reference in New Issue
Block a user