Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/mno/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM node:18-alpine as development
FROM node:18-alpine AS development
WORKDIR /app
COPY . ./
RUN npm i --legacy-peer-deps
RUN npm i azampay --legacy-peer-deps

FROM development as build
FROM development AS build
WORKDIR /app
RUN app=mnos npm run package

FROM node:lts-alpine3.16 as release
FROM node:lts-alpine3.16 AS release
ENV NODE_ENV production
RUN apk add --no-cache tzdata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
NameLookupResponse,
PartnersResponse,
TransactionStatusResponse,
} from 'azampay/lib/shared/interfaces/base.interface';
} from 'azampay';
import { Response } from 'express';
import { AzamService } from '../services/azam.service';

Expand Down
2 changes: 1 addition & 1 deletion apps/mno/src/modules/azampay/services/azam.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
PostCheckOutInterface,
TokenResponse,
TransactionStatusResponse,
} from 'azampay/lib/shared/interfaces/base.interface';
} from 'azampay';

@Injectable()
export class AzamService {
Expand Down
6 changes: 1 addition & 5 deletions apps/mno/src/modules/selcom/controllers/selcom.controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Body, Controller, Post, Res } from '@nestjs/common';
import {
CheckoutResponse,
ErrorResponse,
MnoCheckout,
} from 'azampay/lib/shared/interfaces/base.interface';
import { CheckoutResponse, ErrorResponse, MnoCheckout } from 'azampay';
import { SelcomService } from '../services/selcom.service';
import { Response } from 'express';

Expand Down
12 changes: 4 additions & 8 deletions apps/mno/src/modules/selcom/services/selcom.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { APPENV, phoneNumber } from '@flexpay/common';
import { HttpStatus, Injectable } from '@nestjs/common';
import {
CheckoutResponse,
MnoCheckout,
ErrorResponse,
} from 'azampay/lib/shared/interfaces/base.interface';
import { CheckoutResponse, MnoCheckout, ErrorResponse } from 'azampay';
import * as crypto from 'crypto';

// Types
Expand Down Expand Up @@ -65,7 +61,7 @@ export class SelcomService {
selcomPush = async (
request: MnoCheckout,
): Promise<CheckoutResponse | ErrorResponse> => {
const { valid, value, withCode } = phoneNumber(request.accountNumber);
const { valid, withCode } = phoneNumber(request.accountNumber);
if (!valid) {
return {
statusCode: HttpStatus.BAD_REQUEST,
Expand All @@ -82,14 +78,14 @@ export class SelcomService {
const url = `${APPENV.SELCOM_APIURL}/checkout/wallet-payment`;

const payload: SelcomPayload = {
utilityref: value,
utilityref: APPENV.SELCOM_VENDOR,
transid: request.externalId,
amount: request.amount,
vendor: APPENV.SELCOM_VENDOR,
msisdn: withCode,
};

const authorization = Buffer.from(apiKey).toString('hex');
const authorization = Buffer.from(apiKey, 'ascii').toString('base64');
const timestamp = new Date().toISOString();
const signedFields = Object.keys(payload).join(',');
const digest = this.computeSignature(
Expand Down
56 changes: 28 additions & 28 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
version: '3.4'
# version: '3.4'
services:
api:
build:
context: .
dockerfile: ./apps/api/Dockerfile
target: development
command: npm run start:dev api
# api:
# build:
# context: .
# dockerfile: ./apps/api/Dockerfile
# target: development
# command: npm run start:dev api

env_file:
- ./apps/api/.env
volumes:
- .:/app
- /app/node_modules
ports:
- '2000:1000'
# env_file:
# - ./apps/api/.env
# volumes:
# - .:/app
# - /app/node_modules
# ports:
# - '2000:1000'

restart: always
# restart: always

auth:
build:
context: .
dockerfile: ./apps/auth/Dockerfile
target: development
command: npm run start:dev auth
# auth:
# build:
# context: .
# dockerfile: ./apps/auth/Dockerfile
# target: development
# command: npm run start:dev auth

env_file:
- ./.env
volumes:
- .:/app
- /app/node_modules
restart: always
# env_file:
# - ./.env
# volumes:
# - .:/app
# - /app/node_modules
# restart: always

mno:
build:
Expand All @@ -44,7 +44,7 @@ services:
- /app/node_modules
restart: always
ports:
- 2001:2000
- 2001:3001

volumes:
postdb-data:
Expand Down
2 changes: 1 addition & 1 deletion libs/common/src/interfaces/mno.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
PostCheckOut,
RequestOptions,
TransactionStatus,
} from 'azampay/lib/shared/interfaces/base.interface';
} from 'azampay';

export interface RestCheckout {
checkout: MnoCheckout | BankCheckout;
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@nestjs/typeorm": "^9.0.1",
"amqp-connection-manager": "^4.1.10",
"amqplib": "^0.10.3",
"azampay": "^0.0.4",
"azampay": "^0.0.5",
"bcrypt": "^5.1.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
Expand Down
Loading