ovi-kit 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/shared/decorators/luhn.d.ts +6 -0
- package/dist/shared/decorators/luhn.js +55 -0
- package/dist/shared/decorators/luhn.js.map +1 -0
- package/dist/shared/modules/http/atmos.service.d.ts +38 -0
- package/dist/shared/modules/http/atmos.service.js +193 -0
- package/dist/shared/modules/http/atmos.service.js.map +1 -0
- package/dist/shared/modules/http/http.module.js +3 -2
- package/dist/shared/modules/http/http.module.js.map +1 -1
- package/dist/shared/types/card.d.ts +1 -0
- package/dist/shared/types/card.js +3 -0
- package/dist/shared/types/card.js.map +1 -0
- package/dist/shared/types/payment-provider-setting.d.ts +3 -0
- package/dist/shared/types/payment-provider-setting.js +3 -0
- package/dist/shared/types/payment-provider-setting.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export { ApiMeta } from './shared/decorators/api-meta.decorator';
|
|
|
26
26
|
export { API_META_KEY } from './shared/decorators/api-meta.decorator';
|
|
27
27
|
export type { ApiMetaOptions } from './shared/decorators/api-meta.decorator';
|
|
28
28
|
export { CustomDate } from './shared/decorators/custom-date';
|
|
29
|
+
export { IsLuhn } from './shared/decorators/luhn';
|
|
29
30
|
export { RedisService } from './shared/modules/redis/redis.service';
|
|
30
31
|
export { CustomHttpService } from './shared/modules/http/http.service';
|
|
31
32
|
export { RedisModule } from './shared/modules/redis/redis.module';
|
|
@@ -46,6 +47,8 @@ export type { PaymentStatus } from './shared/types/payment-status';
|
|
|
46
47
|
export type { PaymentType } from './shared/types/payment-type';
|
|
47
48
|
export type { LeadSource } from './shared/types/lead-source';
|
|
48
49
|
export type { PaymentProviderType } from './shared/types/payment-provider';
|
|
50
|
+
export type { PaymentProviderSetting } from './shared/types/payment-provider-setting';
|
|
51
|
+
export type { CardType } from './shared/types/card';
|
|
49
52
|
export { WEEKDAYS } from './shared/arrays/weekdays';
|
|
50
53
|
export { CustomRpcException } from './shared/exceptions/custom-rpc.exception';
|
|
51
54
|
export { RpcErrorCode } from './shared/enums/exception-codes';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INTERNAL_SERVER_ERROR = exports.RpcErrorCode = exports.CustomRpcException = exports.WEEKDAYS = exports.SharedModule = exports.CustomHttpModule = exports.RedisModule = exports.CustomHttpService = exports.RedisService = exports.CustomDate = exports.API_META_KEY = exports.ApiMeta = exports.BaseEntity = exports.createRandomPassword = exports.getFiveMinutesLater = exports.uuid = exports.PasswordVo = exports.UserMinimalDataResponseDto = exports.GetByIdsDto = exports.CheckUserDto = exports.LoginDto = exports.BaseDto = exports.BaseResponseDto = exports.GetByIdDto = exports.GetByNameDto = exports.MetaDataDto = exports.PaginationResponseDto = exports.PaginationDto = exports.DeleteUserDto = exports.ForgotPasswordDto = exports.UserConfirmDto = exports.RevokeSessionDto = exports.ResetPasswordDto = exports.ResendOtpDto = exports.RecoveryPasswordDto = exports.MetaDto = void 0;
|
|
3
|
+
exports.INTERNAL_SERVER_ERROR = exports.RpcErrorCode = exports.CustomRpcException = exports.WEEKDAYS = exports.SharedModule = exports.CustomHttpModule = exports.RedisModule = exports.CustomHttpService = exports.RedisService = exports.IsLuhn = exports.CustomDate = exports.API_META_KEY = exports.ApiMeta = exports.BaseEntity = exports.createRandomPassword = exports.getFiveMinutesLater = exports.uuid = exports.PasswordVo = exports.UserMinimalDataResponseDto = exports.GetByIdsDto = exports.CheckUserDto = exports.LoginDto = exports.BaseDto = exports.BaseResponseDto = exports.GetByIdDto = exports.GetByNameDto = exports.MetaDataDto = exports.PaginationResponseDto = exports.PaginationDto = exports.DeleteUserDto = exports.ForgotPasswordDto = exports.UserConfirmDto = exports.RevokeSessionDto = exports.ResetPasswordDto = exports.ResendOtpDto = exports.RecoveryPasswordDto = exports.MetaDto = void 0;
|
|
4
4
|
var meta_data_dto_1 = require("./shared/dto/meta-data.dto");
|
|
5
5
|
Object.defineProperty(exports, "MetaDto", { enumerable: true, get: function () { return meta_data_dto_1.MetaDto; } });
|
|
6
6
|
var recovery_password_dto_1 = require("./shared/dto/recovery-password.dto");
|
|
@@ -55,6 +55,8 @@ var api_meta_decorator_2 = require("./shared/decorators/api-meta.decorator");
|
|
|
55
55
|
Object.defineProperty(exports, "API_META_KEY", { enumerable: true, get: function () { return api_meta_decorator_2.API_META_KEY; } });
|
|
56
56
|
var custom_date_1 = require("./shared/decorators/custom-date");
|
|
57
57
|
Object.defineProperty(exports, "CustomDate", { enumerable: true, get: function () { return custom_date_1.CustomDate; } });
|
|
58
|
+
var luhn_1 = require("./shared/decorators/luhn");
|
|
59
|
+
Object.defineProperty(exports, "IsLuhn", { enumerable: true, get: function () { return luhn_1.IsLuhn; } });
|
|
58
60
|
var redis_service_1 = require("./shared/modules/redis/redis.service");
|
|
59
61
|
Object.defineProperty(exports, "RedisService", { enumerable: true, get: function () { return redis_service_1.RedisService; } });
|
|
60
62
|
var http_service_1 = require("./shared/modules/http/http.service");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,4DAAqD;AAA5C,wGAAA,OAAO,OAAA;AAChB,4EAAyE;AAAhE,4HAAA,mBAAmB,OAAA;AAC5B,8DAA2D;AAAlD,8GAAA,YAAY,OAAA;AACrB,sEAAmE;AAA1D,sHAAA,gBAAgB,OAAA;AACzB,sEAAmE;AAA1D,sHAAA,gBAAgB,OAAA;AACzB,kEAA+D;AAAtD,kHAAA,cAAc,OAAA;AACvB,wEAAqE;AAA5D,wHAAA,iBAAiB,OAAA;AAC1B,gEAA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6 @@
|
|
|
1
|
+
import { ValidationOptions, ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
|
|
2
|
+
export declare class IsLuhnConstraint implements ValidatorConstraintInterface {
|
|
3
|
+
validate(value: any, _args: ValidationArguments): boolean;
|
|
4
|
+
defaultMessage(_args: ValidationArguments): string;
|
|
5
|
+
}
|
|
6
|
+
export declare function IsLuhn(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsLuhnConstraint = void 0;
|
|
10
|
+
exports.IsLuhn = IsLuhn;
|
|
11
|
+
const class_validator_1 = require("class-validator");
|
|
12
|
+
function luhnValidateRaw(numStr) {
|
|
13
|
+
const cleaned = numStr.replace(/[\s-]+/g, '');
|
|
14
|
+
if (!/^\d+$/.test(cleaned))
|
|
15
|
+
return false;
|
|
16
|
+
let sum = 0;
|
|
17
|
+
let shouldDouble = false;
|
|
18
|
+
for (let i = cleaned.length - 1; i >= 0; i--) {
|
|
19
|
+
let digit = parseInt(cleaned[i], 10);
|
|
20
|
+
if (shouldDouble) {
|
|
21
|
+
digit *= 2;
|
|
22
|
+
if (digit > 9)
|
|
23
|
+
digit -= 9;
|
|
24
|
+
}
|
|
25
|
+
sum += digit;
|
|
26
|
+
shouldDouble = !shouldDouble;
|
|
27
|
+
}
|
|
28
|
+
return sum % 10 === 0;
|
|
29
|
+
}
|
|
30
|
+
let IsLuhnConstraint = class IsLuhnConstraint {
|
|
31
|
+
validate(value, _args) {
|
|
32
|
+
if (typeof value !== 'string')
|
|
33
|
+
return false;
|
|
34
|
+
return luhnValidateRaw(value);
|
|
35
|
+
}
|
|
36
|
+
defaultMessage(_args) {
|
|
37
|
+
return 'Field must be a valid number according to Luhn algorithm';
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.IsLuhnConstraint = IsLuhnConstraint;
|
|
41
|
+
exports.IsLuhnConstraint = IsLuhnConstraint = __decorate([
|
|
42
|
+
(0, class_validator_1.ValidatorConstraint)({ async: false })
|
|
43
|
+
], IsLuhnConstraint);
|
|
44
|
+
function IsLuhn(validationOptions) {
|
|
45
|
+
return function (object, propertyName) {
|
|
46
|
+
(0, class_validator_1.registerDecorator)({
|
|
47
|
+
target: object.constructor,
|
|
48
|
+
propertyName: propertyName,
|
|
49
|
+
options: validationOptions,
|
|
50
|
+
constraints: [],
|
|
51
|
+
validator: IsLuhnConstraint,
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=luhn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"luhn.js","sourceRoot":"","sources":["../../../src/shared/decorators/luhn.ts"],"names":[],"mappings":";;;;;;;;;AA2CA,wBAUC;AApDD,qDAMyB;AAEzB,SAAS,eAAe,CAAC,MAAc;IAErC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAEzC,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,IAAI,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACrC,IAAI,YAAY,EAAE,CAAC;YACjB,KAAK,IAAI,CAAC,CAAC;YACX,IAAI,KAAK,GAAG,CAAC;gBAAE,KAAK,IAAI,CAAC,CAAC;QAC5B,CAAC;QACD,GAAG,IAAI,KAAK,CAAC;QACb,YAAY,GAAG,CAAC,YAAY,CAAC;IAC/B,CAAC;IACD,OAAO,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,QAAQ,CAAC,KAAU,EAAE,KAA0B;QAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,cAAc,CAAC,KAA0B;QACvC,OAAO,0DAA0D,CAAC;IACpE,CAAC;CACF,CAAA;AATY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,qCAAmB,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;GACzB,gBAAgB,CAS5B;AAKD,SAAgB,MAAM,CAAC,iBAAqC;IAC1D,OAAO,UAAU,MAAc,EAAE,YAAoB;QACnD,IAAA,mCAAiB,EAAC;YAChB,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,gBAAgB;SAC5B,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
2
|
+
import { RedisService } from '../redis/redis.service';
|
|
3
|
+
import { PaymentProviderSetting } from 'src/shared/types/payment-provider-setting';
|
|
4
|
+
export declare class AtmosHttpService {
|
|
5
|
+
private readonly http;
|
|
6
|
+
private readonly redis;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly tokenCacheKey;
|
|
9
|
+
private token;
|
|
10
|
+
private header;
|
|
11
|
+
constructor(http: HttpService, redis: RedisService);
|
|
12
|
+
createCard(data: PaymentProviderSetting, card: {
|
|
13
|
+
number: string;
|
|
14
|
+
expiry: string;
|
|
15
|
+
}, retryCount?: number): Promise<{
|
|
16
|
+
transaction_id: string;
|
|
17
|
+
}>;
|
|
18
|
+
verifyCard(data: PaymentProviderSetting, payload: {
|
|
19
|
+
transaction_id: string;
|
|
20
|
+
otp: string;
|
|
21
|
+
}, retryCount?: number): Promise<{
|
|
22
|
+
card_id: string;
|
|
23
|
+
}>;
|
|
24
|
+
resendOtp(data: PaymentProviderSetting, card: {
|
|
25
|
+
number: string;
|
|
26
|
+
expiry: string;
|
|
27
|
+
}, retryCount?: number): Promise<{
|
|
28
|
+
transaction_id: string;
|
|
29
|
+
}>;
|
|
30
|
+
deleteCard(data: PaymentProviderSetting, payload: {
|
|
31
|
+
id: number;
|
|
32
|
+
card_token: string;
|
|
33
|
+
}, retryCount?: number): any;
|
|
34
|
+
private createAtmosToken;
|
|
35
|
+
private setToken;
|
|
36
|
+
private setHeader;
|
|
37
|
+
private refreshToken;
|
|
38
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var AtmosHttpService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.AtmosHttpService = void 0;
|
|
14
|
+
const axios_1 = require("@nestjs/axios");
|
|
15
|
+
const common_1 = require("@nestjs/common");
|
|
16
|
+
const redis_service_1 = require("../redis/redis.service");
|
|
17
|
+
const custom_rpc_exception_1 = require("../../exceptions/custom-rpc.exception");
|
|
18
|
+
const exception_codes_1 = require("../../enums/exception-codes");
|
|
19
|
+
let AtmosHttpService = AtmosHttpService_1 = class AtmosHttpService {
|
|
20
|
+
http;
|
|
21
|
+
redis;
|
|
22
|
+
logger = new common_1.Logger(AtmosHttpService_1.name);
|
|
23
|
+
tokenCacheKey = 'atmos_token_cache_key' + process.env.ATMOS_STORE_ID;
|
|
24
|
+
token;
|
|
25
|
+
header;
|
|
26
|
+
constructor(http, redis) {
|
|
27
|
+
this.http = http;
|
|
28
|
+
this.redis = redis;
|
|
29
|
+
}
|
|
30
|
+
async createCard(data, card, retryCount = 0) {
|
|
31
|
+
try {
|
|
32
|
+
await this.setHeader(data);
|
|
33
|
+
const url = data.base_url + 'partner/bind-card/init';
|
|
34
|
+
const body = {
|
|
35
|
+
card_number: card.number,
|
|
36
|
+
expiry: card.expiry,
|
|
37
|
+
};
|
|
38
|
+
const response = await this.http.axiosRef.post(url, body, {
|
|
39
|
+
headers: this.header,
|
|
40
|
+
});
|
|
41
|
+
if (response.data.result?.code !== 'OK') {
|
|
42
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, response.data.result?.code, +' ' + response.data.result?.description);
|
|
43
|
+
}
|
|
44
|
+
return { transaction_id: response.data.transaction_id };
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
const status = err?.response?.status;
|
|
48
|
+
if (status === 401 && retryCount < 3) {
|
|
49
|
+
this.logger.warn(`401 detected → refreshing token → retry #${retryCount + 1}`);
|
|
50
|
+
await this.refreshToken(data);
|
|
51
|
+
return this.createCard(data, card, retryCount + 1);
|
|
52
|
+
}
|
|
53
|
+
this.logger.error(`CreateCard failed. retry=${retryCount}, status=${status}`);
|
|
54
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, 'ATMOS card creation failed');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async verifyCard(data, payload, retryCount = 0) {
|
|
58
|
+
try {
|
|
59
|
+
await this.setHeader(data);
|
|
60
|
+
const url = data.base_url + 'partner/bind-card/confirm';
|
|
61
|
+
const body = {
|
|
62
|
+
transaction_id: payload.transaction_id,
|
|
63
|
+
otp: payload.otp,
|
|
64
|
+
};
|
|
65
|
+
const response = await this.http.axiosRef.post(url, body, {
|
|
66
|
+
headers: this.header,
|
|
67
|
+
});
|
|
68
|
+
if (response.data.result?.code !== 'OK') {
|
|
69
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, response.data.result?.code, +' ' + response.data.result?.description);
|
|
70
|
+
}
|
|
71
|
+
return response.data;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
const status = err?.response?.status;
|
|
75
|
+
if (status === 401 && retryCount < 3) {
|
|
76
|
+
this.logger.warn(`401 detected → refreshing token → retry #${retryCount + 1}`);
|
|
77
|
+
await this.refreshToken(data);
|
|
78
|
+
return this.verifyCard(data, payload, retryCount + 1);
|
|
79
|
+
}
|
|
80
|
+
this.logger.error(`CreateCard failed. retry=${retryCount}, status=${status}`);
|
|
81
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, 'ATMOS card creation failed');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async resendOtp(data, card, retryCount = 0) {
|
|
85
|
+
try {
|
|
86
|
+
await this.setHeader(data);
|
|
87
|
+
const url = data.base_url + 'partner/bind-card/init';
|
|
88
|
+
const body = {
|
|
89
|
+
card_number: card.number,
|
|
90
|
+
expiry: card.expiry,
|
|
91
|
+
};
|
|
92
|
+
const response = await this.http.axiosRef.post(url, body, {
|
|
93
|
+
headers: this.header,
|
|
94
|
+
});
|
|
95
|
+
if (response.data.result?.code !== 'OK') {
|
|
96
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, response.data.result?.code, +' ' + response.data.result?.description);
|
|
97
|
+
}
|
|
98
|
+
return { transaction_id: response.data.transaction_id };
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
const status = err?.response?.status;
|
|
102
|
+
if (status === 401 && retryCount < 3) {
|
|
103
|
+
this.logger.warn(`401 detected → refreshing token → retry #${retryCount + 1}`);
|
|
104
|
+
await this.refreshToken(data);
|
|
105
|
+
return this.resendOtp(data, card, retryCount + 1);
|
|
106
|
+
}
|
|
107
|
+
this.logger.error(`Resend Otp failed. retry=${retryCount}, status=${status}`);
|
|
108
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, 'ATMOS card creation failed');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async deleteCard(data, payload, retryCount = 0) {
|
|
112
|
+
try {
|
|
113
|
+
await this.setHeader(data);
|
|
114
|
+
const url = data.base_url + 'partner/remove-card';
|
|
115
|
+
const body = {
|
|
116
|
+
id: payload.id,
|
|
117
|
+
token: payload.card_token,
|
|
118
|
+
};
|
|
119
|
+
const response = await this.http.axiosRef.post(url, body, {
|
|
120
|
+
headers: this.header,
|
|
121
|
+
});
|
|
122
|
+
if (response.data.result?.code !== 'OK') {
|
|
123
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, response.data.result?.code, +' ' + response.data.result?.description);
|
|
124
|
+
}
|
|
125
|
+
return response.data;
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
const status = err?.response?.status;
|
|
129
|
+
if (status === 401 && retryCount < 3) {
|
|
130
|
+
this.logger.warn(`401 detected → refreshing token → retry #${retryCount + 1}`);
|
|
131
|
+
await this.refreshToken(data);
|
|
132
|
+
return this.deleteCard(data, payload, retryCount + 1);
|
|
133
|
+
}
|
|
134
|
+
this.logger.error(`Resend Otp failed. retry=${retryCount}, status=${status}`);
|
|
135
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, 'ATMOS card creation failed');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async createAtmosToken(data) {
|
|
139
|
+
try {
|
|
140
|
+
const url = data.base_url + 'token';
|
|
141
|
+
const credentials = Buffer.from(`${process.env.ATMOS_CONSUMER_KEY}:${process.env.ATMOS_CONSUMER_SECRET}`).toString('base64');
|
|
142
|
+
const headers = {
|
|
143
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
144
|
+
Authorization: `Basic ${credentials}`,
|
|
145
|
+
};
|
|
146
|
+
const form = new FormData();
|
|
147
|
+
form.append('grant_type', 'client_credentials');
|
|
148
|
+
const response = await this.http.axiosRef.post(url, form, { headers });
|
|
149
|
+
if (response.data.error) {
|
|
150
|
+
this.logger.error(`Error while when create atmos token: ${response.data.message}`);
|
|
151
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, response.data.message);
|
|
152
|
+
}
|
|
153
|
+
return response.data.result.access_token;
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
this.logger.error(err.data.message);
|
|
157
|
+
throw new custom_rpc_exception_1.CustomRpcException(exception_codes_1.RpcErrorCode.InternalError, 'Internal server error');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async setToken(data) {
|
|
161
|
+
const tokenInCache = (await this.redis.get(this.tokenCacheKey));
|
|
162
|
+
if (tokenInCache) {
|
|
163
|
+
this.token = tokenInCache;
|
|
164
|
+
return tokenInCache;
|
|
165
|
+
}
|
|
166
|
+
const createdToken = await this.createAtmosToken(data);
|
|
167
|
+
await this.redis.set(this.tokenCacheKey, createdToken, 3600);
|
|
168
|
+
this.token = createdToken;
|
|
169
|
+
}
|
|
170
|
+
async setHeader(data) {
|
|
171
|
+
await this.setToken(data);
|
|
172
|
+
this.header = {
|
|
173
|
+
'Content-Type': 'application/json',
|
|
174
|
+
Authorization: `Bearer ${this.token}`,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async refreshToken(data) {
|
|
178
|
+
const newToken = await this.createAtmosToken(data);
|
|
179
|
+
await this.redis.set(this.tokenCacheKey, newToken, 3600);
|
|
180
|
+
this.token = newToken;
|
|
181
|
+
this.header = {
|
|
182
|
+
'Content-Type': 'application/json',
|
|
183
|
+
Authorization: `Bearer ${this.token}`,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
exports.AtmosHttpService = AtmosHttpService;
|
|
188
|
+
exports.AtmosHttpService = AtmosHttpService = AtmosHttpService_1 = __decorate([
|
|
189
|
+
(0, common_1.Injectable)(),
|
|
190
|
+
__metadata("design:paramtypes", [axios_1.HttpService,
|
|
191
|
+
redis_service_1.RedisService])
|
|
192
|
+
], AtmosHttpService);
|
|
193
|
+
//# sourceMappingURL=atmos.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmos.service.js","sourceRoot":"","sources":["../../../../src/shared/modules/http/atmos.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAKA,yCAA4C;AAC5C,2CAAoD;AACpD,0DAAsD;AACtD,gFAAgF;AAChF,iEAAgE;AAIzD,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAcR;IACA;IAdF,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAE3C,aAAa,GAC5B,uBAAuB,GA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AAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;QAE7D,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC;IAC5B,CAAC;IAEO,KAAK,CAAC,SAAS,CAAC,IAA4B;QAClD,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE1B,IAAI,CAAC,MAAM,GAAG;YACZ,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,IAAI,CAAC,KAAK,EAAE;SACtC,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,IAA4B;QACrD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEnD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAEzD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;QAEtB,IAAI,CAAC,MAAM,GAAG;YACZ,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,IAAI,CAAC,KAAK,EAAE;SACtC,CAAC;IACJ,CAAC;CACF,CAAA;AA/SY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAec,mBAAW;QACV,4BAAY;GAf3B,gBAAgB,CA+S5B"}
|
|
@@ -11,14 +11,15 @@ const axios_1 = require("@nestjs/axios");
|
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
12
|
const redis_module_1 = require("../redis/redis.module");
|
|
13
13
|
const http_service_1 = require("./http.service");
|
|
14
|
+
const atmos_service_1 = require("./atmos.service");
|
|
14
15
|
let CustomHttpModule = class CustomHttpModule {
|
|
15
16
|
};
|
|
16
17
|
exports.CustomHttpModule = CustomHttpModule;
|
|
17
18
|
exports.CustomHttpModule = CustomHttpModule = __decorate([
|
|
18
19
|
(0, common_1.Module)({
|
|
19
20
|
imports: [axios_1.HttpModule, redis_module_1.RedisModule.forRootAsync()],
|
|
20
|
-
providers: [http_service_1.CustomHttpService],
|
|
21
|
-
exports: [http_service_1.CustomHttpService],
|
|
21
|
+
providers: [http_service_1.CustomHttpService, atmos_service_1.AtmosHttpService],
|
|
22
|
+
exports: [http_service_1.CustomHttpService, atmos_service_1.AtmosHttpService],
|
|
22
23
|
})
|
|
23
24
|
], CustomHttpModule);
|
|
24
25
|
//# sourceMappingURL=http.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../../src/shared/modules/http/http.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAwC;AACxC,wDAAoD;AACpD,iDAAmD;AAO5C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,kBAAU,EAAE,0BAAW,CAAC,YAAY,EAAE,CAAC;QACjD,SAAS,EAAE,CAAC,gCAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../../src/shared/modules/http/http.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAwC;AACxC,wDAAoD;AACpD,iDAAmD;AACnD,mDAAmD;AAO5C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,kBAAU,EAAE,0BAAW,CAAC,YAAY,EAAE,CAAC;QACjD,SAAS,EAAE,CAAC,gCAAiB,EAAE,gCAAgB,CAAC;QAChD,OAAO,EAAE,CAAC,gCAAiB,EAAE,gCAAgB,CAAC;KAC/C,CAAC;GACW,gBAAgB,CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CardType = 'humo' | 'uzcard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../../src/shared/types/card.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-provider-setting.js","sourceRoot":"","sources":["../../../src/shared/types/payment-provider-setting.ts"],"names":[],"mappings":""}
|