1.0.2 • Published 4 years ago
ayoopo-test-library v1.0.2
How To Use Ventaja Library
- IMPORT Ventaja Module In AppModule
import {Module} from "@nestjs/common";
import {AyoopoModule} from "ventaja-nest-library";
@Module({
imports: [
AyoopoModule.forRoot({
certificatePath: "./private.key",
ventajaUrl: "https://demo.ventaja.com/",
id: "131191912345",
uid: "compiler",
pwd: "password@1234",
countryCode: "IN"
})],
providers: [AppService],
controllers: [AppController]
})
export class AppModule {
}
- IMPORT Ventaja Service in AppService
import {HttpService, Injectable, InternalServerErrorException} from "@nestjs/common";
import {ConfigService} from "./config.service";
import {VentajaService} from "ventaja-nest-library";
@Injectable()
export class WalletService {
constructor(
private readonly configService: ConfigService,
private readonly httpService: HttpService,
private readonly ventajaService: VentajaService
) {
} // End of constructor
public async getBalance(): Promise<any> {
try {
const balanceInfo = await this.ventajaService.getBalance();
// Add your business logic here
return balanceInfo;
} catch (error) {
return error
}
}
}
Ventaja Functions | Category | purpose |
---|---|---|
getBalance | Bill Payments | returns balance info |
validateTopUpWallet | Bill Payments | validates data |
topUpWalletProcess | Bill Payments | process top up wallet |
topUpTransactionInquiry | Bill Payments | top up transaction inquiry |
processReservationDetail | Bill Payments | reservation detail |
validateReservationPaymentDetail | Bill Payments | validate reservation details data |
processReservationPayment | Bill Payments | process reservation payment |
reservationPaymentEnquiry | Bill Payments | reservation payment inquiry |
pullTransactionDetails | Bill Payments | pull transaction details |
validateBilling | Bill Payments | validate billing data |
processBilling | Bill Payments | process billing data |
@ Credits Flexm