resurgence-data 1.1.5 → 1.1.6

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.
Files changed (30) hide show
  1. package/dist/biller/biller.dto.d.ts +2 -2
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/payment/api-key/api-key.data.d.ts +21 -0
  5. package/dist/payment/api-key/api-key.data.js +41 -0
  6. package/dist/payment/api-key/api-key.dto.d.ts +4 -0
  7. package/dist/payment/api-key/api-key.dto.js +30 -0
  8. package/dist/payment/api-key/index.d.ts +2 -0
  9. package/dist/payment/api-key/index.js +18 -0
  10. package/dist/payment/bank-account/bank-account.dto.d.ts +14 -0
  11. package/dist/payment/bank-account/bank-account.dto.js +83 -0
  12. package/dist/payment/bank-account/index.d.ts +1 -0
  13. package/dist/payment/bank-account/index.js +17 -0
  14. package/dist/payment/index.d.ts +2 -2
  15. package/dist/payment/index.js +2 -2
  16. package/dist/payment/payment-request/index.d.ts +1 -0
  17. package/dist/payment/payment-request/index.js +17 -0
  18. package/dist/payment/payment-request/payment-request.dto.d.ts +37 -0
  19. package/dist/payment/payment-request/payment-request.dto.js +216 -0
  20. package/package.json +1 -1
  21. package/src/biller/biller.dto.ts +2 -2
  22. package/src/index.ts +1 -1
  23. package/src/payment/{api-key.dto.ts → api-key/api-key.dto.ts} +1 -1
  24. package/src/payment/api-key/index.ts +2 -0
  25. package/src/payment/bank-account/bank-account.dto.ts +60 -0
  26. package/src/payment/bank-account/index.ts +1 -0
  27. package/src/payment/index.ts +2 -2
  28. package/src/payment/payment-request/index.ts +1 -0
  29. package/src/payment/payment-request/payment-request.dto.ts +170 -0
  30. /package/src/payment/{api-key.data.ts → api-key/api-key.data.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { BaseDTO } from "../types/dto.type";
2
- import { BillerApiKeyDto } from "../payment";
2
+ import { BillerApiKeyDto } from "../payment/api-key";
3
3
  /**
4
4
  * DTO for `BillerCategory`
5
5
  */
@@ -58,7 +58,7 @@ export declare class CreateBillerDto extends BaseDTO {
58
58
  updatedAt?: string;
59
59
  }
60
60
  export declare class UpdateBillerDto extends BaseDTO {
61
- id?: string;
61
+ id: string;
62
62
  categoryId?: string;
63
63
  billerProfileId?: string;
64
64
  name?: string;
package/dist/index.d.ts CHANGED
@@ -4,4 +4,4 @@ export * from "./exception";
4
4
  export * from "./user";
5
5
  export * from "./messaging";
6
6
  export * from "./biller";
7
- export * from "./payment";
7
+ export * from "./payment/api-key";
package/dist/index.js CHANGED
@@ -20,4 +20,4 @@ __exportStar(require("./exception"), exports);
20
20
  __exportStar(require("./user"), exports);
21
21
  __exportStar(require("./messaging"), exports);
22
22
  __exportStar(require("./biller"), exports);
23
- __exportStar(require("./payment"), exports);
23
+ __exportStar(require("./payment/api-key"), exports);
@@ -0,0 +1,21 @@
1
+ export declare class BillerApiKeyDto {
2
+ billerId: string;
3
+ active: boolean;
4
+ apiKey: string;
5
+ environment?: string;
6
+ }
7
+ export declare class UpdateBillerApiKeyDto {
8
+ id: string;
9
+ billerId: string;
10
+ active?: boolean;
11
+ apiKey?: string;
12
+ environment?: string;
13
+ }
14
+ export declare class BillerKeyResponseDTO {
15
+ production: string;
16
+ test: string;
17
+ }
18
+ export declare class BillerEnvironmentKeyResponseDTO {
19
+ environment: string;
20
+ key: string;
21
+ }
@@ -0,0 +1,41 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BillerEnvironmentKeyResponseDTO = exports.BillerKeyResponseDTO = exports.UpdateBillerApiKeyDto = exports.BillerApiKeyDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ class BillerApiKeyDto {
15
+ }
16
+ exports.BillerApiKeyDto = BillerApiKeyDto;
17
+ class UpdateBillerApiKeyDto {
18
+ }
19
+ exports.UpdateBillerApiKeyDto = UpdateBillerApiKeyDto;
20
+ class BillerKeyResponseDTO {
21
+ }
22
+ exports.BillerKeyResponseDTO = BillerKeyResponseDTO;
23
+ __decorate([
24
+ (0, swagger_1.ApiProperty)({ description: "production key" }),
25
+ __metadata("design:type", String)
26
+ ], BillerKeyResponseDTO.prototype, "production", void 0);
27
+ __decorate([
28
+ (0, swagger_1.ApiProperty)({ description: "test key" }),
29
+ __metadata("design:type", String)
30
+ ], BillerKeyResponseDTO.prototype, "test", void 0);
31
+ class BillerEnvironmentKeyResponseDTO {
32
+ }
33
+ exports.BillerEnvironmentKeyResponseDTO = BillerEnvironmentKeyResponseDTO;
34
+ __decorate([
35
+ (0, swagger_1.ApiProperty)({ description: "environment" }),
36
+ __metadata("design:type", String)
37
+ ], BillerEnvironmentKeyResponseDTO.prototype, "environment", void 0);
38
+ __decorate([
39
+ (0, swagger_1.ApiProperty)({ description: "key" }),
40
+ __metadata("design:type", String)
41
+ ], BillerEnvironmentKeyResponseDTO.prototype, "key", void 0);
@@ -0,0 +1,4 @@
1
+ export declare class BillerKeyUpdateDto {
2
+ billerId: string;
3
+ environment: string;
4
+ }
@@ -0,0 +1,30 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BillerKeyUpdateDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const biller_type_1 = require("../../types/biller.type");
16
+ class BillerKeyUpdateDto {
17
+ }
18
+ exports.BillerKeyUpdateDto = BillerKeyUpdateDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({ description: "Biller id" }),
21
+ (0, class_validator_1.IsUUID)(4, { message: "Please select a valid biller id" }),
22
+ (0, class_validator_1.IsNotEmpty)({ message: "Please provide a valid biller id" }),
23
+ __metadata("design:type", String)
24
+ ], BillerKeyUpdateDto.prototype, "billerId", void 0);
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({ description: "Environment" }),
27
+ (0, class_validator_1.IsIn)(biller_type_1.environments, { message: "Please select a valid environment" }),
28
+ (0, class_validator_1.IsNotEmpty)({ message: "Please provide an environment for the key update" }),
29
+ __metadata("design:type", String)
30
+ ], BillerKeyUpdateDto.prototype, "environment", void 0);
@@ -0,0 +1,2 @@
1
+ export * from "./api-key.data";
2
+ export * from "./api-key.dto";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api-key.data"), exports);
18
+ __exportStar(require("./api-key.dto"), exports);
@@ -0,0 +1,14 @@
1
+ export declare class BankAccountResolutionDto {
2
+ accountNumber: string;
3
+ bankCode: string;
4
+ }
5
+ export declare class BankValidResponseDto {
6
+ accountNumber: string;
7
+ bankCode: string;
8
+ accountName: string;
9
+ }
10
+ export declare class BankAccountResponseDto {
11
+ valid: boolean;
12
+ message: string;
13
+ account: BankValidResponseDto;
14
+ }
@@ -0,0 +1,83 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BankAccountResponseDto = exports.BankValidResponseDto = exports.BankAccountResolutionDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ class BankAccountResolutionDto {
16
+ }
17
+ exports.BankAccountResolutionDto = BankAccountResolutionDto;
18
+ __decorate([
19
+ (0, swagger_1.ApiProperty)({
20
+ description: "Account number",
21
+ example: "0027338339",
22
+ }),
23
+ (0, class_validator_1.IsString)({ message: "Please enter a valid account number" }),
24
+ (0, class_validator_1.IsNotEmpty)({ message: "Account number cannot be empty" }),
25
+ (0, class_validator_1.Matches)(/^\d{1,10}$/, { message: "Account number must be a string of 1 to 10 digits" }),
26
+ __metadata("design:type", String)
27
+ ], BankAccountResolutionDto.prototype, "accountNumber", void 0);
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({
30
+ description: "Code of the bank",
31
+ example: "044",
32
+ }),
33
+ (0, class_validator_1.IsString)({ message: "Please enter a valid bank code" }),
34
+ (0, class_validator_1.IsNotEmpty)({ message: "Bank code cannot be empty" }),
35
+ __metadata("design:type", String)
36
+ ], BankAccountResolutionDto.prototype, "bankCode", void 0);
37
+ class BankValidResponseDto {
38
+ }
39
+ exports.BankValidResponseDto = BankValidResponseDto;
40
+ __decorate([
41
+ (0, swagger_1.ApiProperty)({
42
+ description: "Account number",
43
+ example: "123456789",
44
+ }),
45
+ __metadata("design:type", String)
46
+ ], BankValidResponseDto.prototype, "accountNumber", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiProperty)({
49
+ description: "Bank code",
50
+ example: "BOA123",
51
+ }),
52
+ __metadata("design:type", String)
53
+ ], BankValidResponseDto.prototype, "bankCode", void 0);
54
+ __decorate([
55
+ (0, swagger_1.ApiProperty)({
56
+ description: "Account name",
57
+ example: "John Doe",
58
+ }),
59
+ __metadata("design:type", String)
60
+ ], BankValidResponseDto.prototype, "accountName", void 0);
61
+ class BankAccountResponseDto {
62
+ }
63
+ exports.BankAccountResponseDto = BankAccountResponseDto;
64
+ __decorate([
65
+ (0, swagger_1.ApiProperty)({
66
+ description: "Indicates if the response is valid",
67
+ example: true,
68
+ }),
69
+ __metadata("design:type", Boolean)
70
+ ], BankAccountResponseDto.prototype, "valid", void 0);
71
+ __decorate([
72
+ (0, swagger_1.ApiProperty)({
73
+ description: "Response message",
74
+ example: "Bank account details are valid",
75
+ }),
76
+ __metadata("design:type", String)
77
+ ], BankAccountResponseDto.prototype, "message", void 0);
78
+ __decorate([
79
+ (0, swagger_1.ApiProperty)({
80
+ description: "Bank account details",
81
+ }),
82
+ __metadata("design:type", BankValidResponseDto)
83
+ ], BankAccountResponseDto.prototype, "account", void 0);
@@ -0,0 +1 @@
1
+ export * from "./bank-account.dto";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./bank-account.dto"), exports);
@@ -1,2 +1,2 @@
1
- export * from "./api-key.data";
2
- export * from "./api-key.dto";
1
+ export * from "./api-key";
2
+ export * from "./payment-request";
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api-key.data"), exports);
18
- __exportStar(require("./api-key.dto"), exports);
17
+ __exportStar(require("./api-key"), exports);
18
+ __exportStar(require("./payment-request"), exports);
@@ -0,0 +1 @@
1
+ export * from "./payment-request.dto";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./payment-request.dto"), exports);
@@ -0,0 +1,37 @@
1
+ export declare class TransactionSplitDto {
2
+ accountId: string;
3
+ splitType: string;
4
+ splitValue: string;
5
+ transactionTotal: number;
6
+ splitAmount?: number;
7
+ }
8
+ export declare class PaymentRequestDto {
9
+ billerId: string;
10
+ customerId?: string;
11
+ invoiceId?: string;
12
+ paymentPageId?: string;
13
+ transactionTotal: number;
14
+ requestChannel: string;
15
+ processorId: string;
16
+ ipAddress?: string;
17
+ requestUrl?: string;
18
+ redirectUrl?: string;
19
+ customerName?: string;
20
+ customerEmailAddress?: string;
21
+ customerPhoneNumber?: string;
22
+ transactionSplits?: TransactionSplitDto[];
23
+ }
24
+ export declare class APIPaymentRequestDto {
25
+ billerId?: string;
26
+ customerId?: string;
27
+ invoiceId?: string;
28
+ paymentPageId?: string;
29
+ ipAddress?: string;
30
+ transactionTotal: number;
31
+ requestUrl?: string;
32
+ redirectUrl?: string;
33
+ customerName?: string;
34
+ customerEmailAddress?: string;
35
+ customerPhoneNumber?: string;
36
+ transactionSplits?: TransactionSplitDto[];
37
+ }
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ // * @apiParam {String} transactionReference Merchants generated unique transaction reference.
3
+ // * @apiParam {String} clientId Merchants client ID.
4
+ // * @apiParam {Integer} amount Transaction amount (In lowrst denomination)
5
+ // * @apiParam {String} [customerEmailAddress] Customer's email address.
6
+ // * @apiParam {String} [customerPhoneNumber] Customer's phone number.
7
+ // * @apiParam {String} [customerName] Customer's name
8
+ // * @apiParam {String} customerId Merchant's preffered customer identifier (eg. email or phone number etc)
9
+ // * @apiParam {String} currencyCode Account holder's email address.
10
+ // * @apiParam {Object} [splitDetails] Transaction split details.
11
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ 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;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ var __metadata = (this && this.__metadata) || function (k, v) {
18
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
22
+ const swagger_1 = require("@nestjs/swagger");
23
+ const class_validator_1 = require("class-validator");
24
+ const class_validator_2 = require("class-validator");
25
+ class TransactionSplitDto {
26
+ }
27
+ exports.TransactionSplitDto = TransactionSplitDto;
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the account" }),
30
+ (0, class_validator_2.IsUUID)("4", { message: "Account ID must be a valid UUID" }),
31
+ (0, class_validator_1.IsNotEmpty)({ message: "Account ID is required" }),
32
+ __metadata("design:type", String)
33
+ ], TransactionSplitDto.prototype, "accountId", void 0);
34
+ __decorate([
35
+ (0, swagger_1.ApiProperty)({ description: "Type of the transaction split" }),
36
+ (0, class_validator_1.IsIn)(["FIXED", "PERCENTAGE", "RATIO"], { message: "Split Type must be a valid enum value" }),
37
+ (0, class_validator_1.IsNotEmpty)({ message: "Split Type is required" }),
38
+ __metadata("design:type", String)
39
+ ], TransactionSplitDto.prototype, "splitType", void 0);
40
+ __decorate([
41
+ (0, swagger_1.ApiProperty)({ description: "Value of the transaction split" }),
42
+ (0, class_validator_1.IsString)({ message: "Split Value must be a string" }),
43
+ (0, class_validator_1.IsNotEmpty)({ message: "Split Value is required" }),
44
+ __metadata("design:type", String)
45
+ ], TransactionSplitDto.prototype, "splitValue", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({ description: "Total amount of the transaction" }),
48
+ (0, class_validator_1.IsNotEmpty)({ message: "Transaction Total is required" }),
49
+ (0, class_validator_1.IsInt)({ message: "Transaction Total must be the lowest currency denomination" }),
50
+ __metadata("design:type", Number)
51
+ ], TransactionSplitDto.prototype, "transactionTotal", void 0);
52
+ __decorate([
53
+ (0, swagger_1.ApiProperty)({ description: "Amount of the transaction split" }),
54
+ (0, class_validator_2.IsOptional)(),
55
+ __metadata("design:type", Number)
56
+ ], TransactionSplitDto.prototype, "splitAmount", void 0);
57
+ class PaymentRequestDto {
58
+ }
59
+ exports.PaymentRequestDto = PaymentRequestDto;
60
+ __decorate([
61
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the biller" }),
62
+ (0, class_validator_2.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
63
+ (0, class_validator_1.IsNotEmpty)({ message: "Biller ID is required" }),
64
+ __metadata("design:type", String)
65
+ ], PaymentRequestDto.prototype, "billerId", void 0);
66
+ __decorate([
67
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the customer", required: false }),
68
+ (0, class_validator_2.IsOptional)(),
69
+ (0, class_validator_2.IsUUID)("4", { message: "Customer ID must be a valid UUID" }),
70
+ __metadata("design:type", String)
71
+ ], PaymentRequestDto.prototype, "customerId", void 0);
72
+ __decorate([
73
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the invoice", required: false }),
74
+ (0, class_validator_2.IsOptional)(),
75
+ (0, class_validator_2.IsUUID)("4", { message: "Invoice ID must be a valid UUID" }),
76
+ __metadata("design:type", String)
77
+ ], PaymentRequestDto.prototype, "invoiceId", void 0);
78
+ __decorate([
79
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the payment page", required: false }),
80
+ (0, class_validator_2.IsOptional)(),
81
+ (0, class_validator_2.IsUUID)("4", { message: "Payment Page ID must be a valid UUID" }),
82
+ __metadata("design:type", String)
83
+ ], PaymentRequestDto.prototype, "paymentPageId", void 0);
84
+ __decorate([
85
+ (0, swagger_1.ApiProperty)({ description: "Total amount of the transaction" }),
86
+ (0, class_validator_1.IsNotEmpty)({ message: "Transaction Total is required" }),
87
+ (0, class_validator_1.IsInt)({ message: "Transaction Total must be the lowest currency denomination" }),
88
+ __metadata("design:type", Number)
89
+ ], PaymentRequestDto.prototype, "transactionTotal", void 0);
90
+ __decorate([
91
+ (0, swagger_1.ApiProperty)({ description: "Channel through which the request was made" }),
92
+ (0, class_validator_1.IsIn)(["WEB", "MOBILE", "POS"], { message: "Request channel must be one of 'WEB', 'MOBILE', 'POS'" }),
93
+ (0, class_validator_1.IsNotEmpty)({ message: "Request channel is required" }),
94
+ __metadata("design:type", String)
95
+ ], PaymentRequestDto.prototype, "requestChannel", void 0);
96
+ __decorate([
97
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the processor" }),
98
+ (0, class_validator_2.IsUUID)("4", { message: "Processor ID must be a valid UUID" }),
99
+ (0, class_validator_1.IsNotEmpty)({ message: "Processor ID is required" }),
100
+ __metadata("design:type", String)
101
+ ], PaymentRequestDto.prototype, "processorId", void 0);
102
+ __decorate([
103
+ (0, swagger_1.ApiProperty)({ description: "IP address of the customer", required: false }),
104
+ (0, class_validator_2.IsOptional)(),
105
+ (0, class_validator_2.IsIP)("4", { message: "IP address must be a valid IP address" }),
106
+ __metadata("design:type", String)
107
+ ], PaymentRequestDto.prototype, "ipAddress", void 0);
108
+ __decorate([
109
+ (0, swagger_1.ApiProperty)({ description: "URL of the request", required: false }),
110
+ (0, class_validator_2.IsOptional)(),
111
+ (0, class_validator_2.IsUrl)({}, { message: "Request URL must be a valid URL" }),
112
+ __metadata("design:type", String)
113
+ ], PaymentRequestDto.prototype, "requestUrl", void 0);
114
+ __decorate([
115
+ (0, swagger_1.ApiProperty)({ description: "Redirect URL after payment", required: false }),
116
+ (0, class_validator_2.IsOptional)(),
117
+ (0, class_validator_2.IsUrl)({}, { message: "Redirect URL must be a valid URL" }),
118
+ __metadata("design:type", String)
119
+ ], PaymentRequestDto.prototype, "redirectUrl", void 0);
120
+ __decorate([
121
+ (0, swagger_1.ApiProperty)({ description: "Name of the customer", required: false }),
122
+ (0, class_validator_2.IsOptional)(),
123
+ (0, class_validator_1.IsString)({ message: "Customer name must be a string" }),
124
+ __metadata("design:type", String)
125
+ ], PaymentRequestDto.prototype, "customerName", void 0);
126
+ __decorate([
127
+ (0, swagger_1.ApiProperty)({ description: "Email address of the customer", required: false }),
128
+ (0, class_validator_2.IsOptional)(),
129
+ (0, class_validator_2.IsEmail)({}, { message: "Customer email address must be a valid email address" }),
130
+ __metadata("design:type", String)
131
+ ], PaymentRequestDto.prototype, "customerEmailAddress", void 0);
132
+ __decorate([
133
+ (0, swagger_1.ApiProperty)({ description: "Phone number of the customer", required: false }),
134
+ (0, class_validator_2.IsOptional)(),
135
+ (0, class_validator_1.IsString)({ message: "Customer phone number must be a string" }),
136
+ __metadata("design:type", String)
137
+ ], PaymentRequestDto.prototype, "customerPhoneNumber", void 0);
138
+ __decorate([
139
+ (0, swagger_1.ApiProperty)({ description: "Array of transaction splits", required: false }),
140
+ (0, class_validator_2.IsOptional)(),
141
+ __metadata("design:type", Array)
142
+ ], PaymentRequestDto.prototype, "transactionSplits", void 0);
143
+ class APIPaymentRequestDto {
144
+ }
145
+ exports.APIPaymentRequestDto = APIPaymentRequestDto;
146
+ __decorate([
147
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the biller" }),
148
+ (0, class_validator_2.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
149
+ (0, class_validator_2.IsOptional)(),
150
+ __metadata("design:type", String)
151
+ ], APIPaymentRequestDto.prototype, "billerId", void 0);
152
+ __decorate([
153
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the customer", required: false }),
154
+ (0, class_validator_2.IsOptional)(),
155
+ (0, class_validator_2.IsUUID)("4", { message: "Customer ID must be a valid UUID" }),
156
+ __metadata("design:type", String)
157
+ ], APIPaymentRequestDto.prototype, "customerId", void 0);
158
+ __decorate([
159
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the invoice", required: false }),
160
+ (0, class_validator_2.IsOptional)(),
161
+ (0, class_validator_2.IsUUID)("4", { message: "Invoice ID must be a valid UUID" }),
162
+ __metadata("design:type", String)
163
+ ], APIPaymentRequestDto.prototype, "invoiceId", void 0);
164
+ __decorate([
165
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the payment page", required: false }),
166
+ (0, class_validator_2.IsOptional)(),
167
+ (0, class_validator_2.IsUUID)("4", { message: "Payment Page ID must be a valid UUID" }),
168
+ __metadata("design:type", String)
169
+ ], APIPaymentRequestDto.prototype, "paymentPageId", void 0);
170
+ __decorate([
171
+ (0, swagger_1.ApiProperty)({ description: "IP address of the customer", required: false }),
172
+ (0, class_validator_2.IsOptional)(),
173
+ (0, class_validator_2.IsIP)("4", { message: "IP address must be a valid IP address" }),
174
+ __metadata("design:type", String)
175
+ ], APIPaymentRequestDto.prototype, "ipAddress", void 0);
176
+ __decorate([
177
+ (0, swagger_1.ApiProperty)({ description: "Total amount of the transaction" }),
178
+ (0, class_validator_1.IsNotEmpty)({ message: "Transaction Total is required" }),
179
+ (0, class_validator_1.IsInt)({ message: "Transaction Total must be the lowest currency denomination" }),
180
+ __metadata("design:type", Number)
181
+ ], APIPaymentRequestDto.prototype, "transactionTotal", void 0);
182
+ __decorate([
183
+ (0, swagger_1.ApiProperty)({ description: "URL of the request", required: false }),
184
+ (0, class_validator_2.IsOptional)(),
185
+ (0, class_validator_2.IsUrl)({}, { message: "Request URL must be a valid URL" }),
186
+ __metadata("design:type", String)
187
+ ], APIPaymentRequestDto.prototype, "requestUrl", void 0);
188
+ __decorate([
189
+ (0, swagger_1.ApiProperty)({ description: "Redirect URL after payment", required: false }),
190
+ (0, class_validator_2.IsOptional)(),
191
+ (0, class_validator_2.IsUrl)({}, { message: "Redirect URL must be a valid URL" }),
192
+ __metadata("design:type", String)
193
+ ], APIPaymentRequestDto.prototype, "redirectUrl", void 0);
194
+ __decorate([
195
+ (0, swagger_1.ApiProperty)({ description: "Name of the customer", required: false }),
196
+ (0, class_validator_2.IsOptional)(),
197
+ (0, class_validator_1.IsString)({ message: "Customer name must be a string" }),
198
+ __metadata("design:type", String)
199
+ ], APIPaymentRequestDto.prototype, "customerName", void 0);
200
+ __decorate([
201
+ (0, swagger_1.ApiProperty)({ description: "Email address of the customer", required: false }),
202
+ (0, class_validator_2.IsOptional)(),
203
+ (0, class_validator_2.IsEmail)({}, { message: "Customer email address must be a valid email address" }),
204
+ __metadata("design:type", String)
205
+ ], APIPaymentRequestDto.prototype, "customerEmailAddress", void 0);
206
+ __decorate([
207
+ (0, swagger_1.ApiProperty)({ description: "Phone number of the customer", required: false }),
208
+ (0, class_validator_2.IsOptional)(),
209
+ (0, class_validator_1.IsString)({ message: "Customer phone number must be a string" }),
210
+ __metadata("design:type", String)
211
+ ], APIPaymentRequestDto.prototype, "customerPhoneNumber", void 0);
212
+ __decorate([
213
+ (0, swagger_1.ApiProperty)({ description: "Array of transaction splits", required: false }),
214
+ (0, class_validator_2.IsOptional)(),
215
+ __metadata("design:type", Array)
216
+ ], APIPaymentRequestDto.prototype, "transactionSplits", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -17,7 +17,7 @@ import {
17
17
  IsArray,
18
18
  } from "class-validator";
19
19
  import { BaseDTO } from "../types/dto.type";
20
- import { BillerApiKeyDto } from "../payment";
20
+ import { BillerApiKeyDto } from "../payment/api-key";
21
21
 
22
22
  /**
23
23
  * DTO for `BillerCategory`
@@ -208,7 +208,7 @@ export class UpdateBillerDto extends BaseDTO {
208
208
  @ApiProperty({ description: "The unique ID of the biller.", example: "uuid-value" })
209
209
  @IsOptional()
210
210
  @IsString({ message: "ID must be a string." })
211
- id?: string;
211
+ id: string;
212
212
 
213
213
  @ApiProperty({ description: "The ID of the category associated with the biller.", example: "uuid-value" })
214
214
  @IsString({ message: "Category ID must be a string." })
package/src/index.ts CHANGED
@@ -4,4 +4,4 @@ export * from "./exception";
4
4
  export * from "./user";
5
5
  export * from "./messaging";
6
6
  export * from "./biller";
7
- export * from "./payment";
7
+ export * from "./payment/api-key";
@@ -1,6 +1,6 @@
1
1
  import { ApiProperty } from "@nestjs/swagger";
2
2
  import { IsIn, IsNotEmpty, IsUUID } from "class-validator";
3
- import { environments } from "../types/biller.type";
3
+ import { environments } from "../../types/biller.type";
4
4
 
5
5
  export class BillerKeyUpdateDto {
6
6
  @ApiProperty({ description: "Biller id" })
@@ -0,0 +1,2 @@
1
+ export * from "./api-key.data";
2
+ export * from "./api-key.dto";
@@ -0,0 +1,60 @@
1
+ import { IsString, IsNotEmpty, Matches } from "class-validator";
2
+ import { ApiProperty } from "@nestjs/swagger";
3
+
4
+ export class BankAccountResolutionDto {
5
+ @ApiProperty({
6
+ description: "Account number",
7
+ example: "0027338339",
8
+ })
9
+ @IsString({ message: "Please enter a valid account number" })
10
+ @IsNotEmpty({ message: "Account number cannot be empty" })
11
+ @Matches(/^\d{1,10}$/, { message: "Account number must be a string of 1 to 10 digits" })
12
+ accountNumber: string;
13
+
14
+ @ApiProperty({
15
+ description: "Code of the bank",
16
+ example: "044",
17
+ })
18
+ @IsString({ message: "Please enter a valid bank code" })
19
+ @IsNotEmpty({ message: "Bank code cannot be empty" })
20
+ bankCode: string;
21
+ }
22
+
23
+ export class BankValidResponseDto {
24
+ @ApiProperty({
25
+ description: "Account number",
26
+ example: "123456789",
27
+ })
28
+ accountNumber: string;
29
+
30
+ @ApiProperty({
31
+ description: "Bank code",
32
+ example: "BOA123",
33
+ })
34
+ bankCode: string;
35
+
36
+ @ApiProperty({
37
+ description: "Account name",
38
+ example: "John Doe",
39
+ })
40
+ accountName: string;
41
+ }
42
+
43
+ export class BankAccountResponseDto {
44
+ @ApiProperty({
45
+ description: "Indicates if the response is valid",
46
+ example: true,
47
+ })
48
+ valid: boolean;
49
+
50
+ @ApiProperty({
51
+ description: "Response message",
52
+ example: "Bank account details are valid",
53
+ })
54
+ message: string;
55
+
56
+ @ApiProperty({
57
+ description: "Bank account details",
58
+ })
59
+ account: BankValidResponseDto;
60
+ }
@@ -0,0 +1 @@
1
+ export * from "./bank-account.dto"
@@ -1,2 +1,2 @@
1
- export * from "./api-key.data";
2
- export * from "./api-key.dto";
1
+ export * from "./api-key";
2
+ export * from "./payment-request";
@@ -0,0 +1 @@
1
+ export * from "./payment-request.dto";
@@ -0,0 +1,170 @@
1
+ // * @apiParam {String} transactionReference Merchants generated unique transaction reference.
2
+ // * @apiParam {String} clientId Merchants client ID.
3
+ // * @apiParam {Integer} amount Transaction amount (In lowrst denomination)
4
+ // * @apiParam {String} [customerEmailAddress] Customer's email address.
5
+ // * @apiParam {String} [customerPhoneNumber] Customer's phone number.
6
+ // * @apiParam {String} [customerName] Customer's name
7
+ // * @apiParam {String} customerId Merchant's preffered customer identifier (eg. email or phone number etc)
8
+ // * @apiParam {String} currencyCode Account holder's email address.
9
+ // * @apiParam {Object} [splitDetails] Transaction split details.
10
+
11
+ import { ApiProperty } from "@nestjs/swagger";
12
+ import { IsIn, IsInt, IsNotEmpty, IsNumber, IsString } from "class-validator";
13
+ import { IsOptional, IsUUID, IsEnum, IsIP, IsUrl, IsEmail } from "class-validator";
14
+
15
+ export class TransactionSplitDto {
16
+ @ApiProperty({ description: "Unique identifier for the account" })
17
+ @IsUUID("4", { message: "Account ID must be a valid UUID" })
18
+ @IsNotEmpty({ message: "Account ID is required" })
19
+ accountId: string;
20
+
21
+ @ApiProperty({ description: "Type of the transaction split" })
22
+ @IsIn(["FIXED", "PERCENTAGE", "RATIO"], { message: "Split Type must be a valid enum value" })
23
+ @IsNotEmpty({ message: "Split Type is required" })
24
+ splitType: string;
25
+
26
+ @ApiProperty({ description: "Value of the transaction split" })
27
+ @IsString({ message: "Split Value must be a string" })
28
+ @IsNotEmpty({ message: "Split Value is required" })
29
+ splitValue: string;
30
+
31
+ @ApiProperty({ description: "Total amount of the transaction" })
32
+ @IsNotEmpty({ message: "Transaction Total is required" })
33
+ @IsInt({ message: "Transaction Total must be the lowest currency denomination" })
34
+ transactionTotal: number;
35
+
36
+ @ApiProperty({ description: "Amount of the transaction split" })
37
+ @IsOptional()
38
+ splitAmount?: number;
39
+ }
40
+ export class PaymentRequestDto {
41
+ @ApiProperty({ description: "Unique identifier for the biller" })
42
+ @IsUUID("4", { message: "Biller ID must be a valid UUID" })
43
+ @IsNotEmpty({ message: "Biller ID is required" })
44
+ billerId: string;
45
+
46
+ @ApiProperty({ description: "Unique identifier for the customer", required: false })
47
+ @IsOptional()
48
+ @IsUUID("4", { message: "Customer ID must be a valid UUID" })
49
+ customerId?: string;
50
+
51
+ @ApiProperty({ description: "Unique identifier for the invoice", required: false })
52
+ @IsOptional()
53
+ @IsUUID("4", { message: "Invoice ID must be a valid UUID" })
54
+ invoiceId?: string;
55
+
56
+ @ApiProperty({ description: "Unique identifier for the payment page", required: false })
57
+ @IsOptional()
58
+ @IsUUID("4", { message: "Payment Page ID must be a valid UUID" })
59
+ paymentPageId?: string;
60
+
61
+ @ApiProperty({ description: "Total amount of the transaction" })
62
+ @IsNotEmpty({ message: "Transaction Total is required" })
63
+ @IsInt({ message: "Transaction Total must be the lowest currency denomination" })
64
+ transactionTotal: number;
65
+
66
+ @ApiProperty({ description: "Channel through which the request was made" })
67
+ @IsIn(["WEB", "MOBILE", "POS"], { message: "Request channel must be one of 'WEB', 'MOBILE', 'POS'" })
68
+ @IsNotEmpty({ message: "Request channel is required" })
69
+ requestChannel: string;
70
+
71
+ @ApiProperty({ description: "Unique identifier for the processor" })
72
+ @IsUUID("4", { message: "Processor ID must be a valid UUID" })
73
+ @IsNotEmpty({ message: "Processor ID is required" })
74
+ processorId: string;
75
+
76
+ @ApiProperty({ description: "IP address of the customer", required: false })
77
+ @IsOptional()
78
+ @IsIP("4", { message: "IP address must be a valid IP address" })
79
+ ipAddress?: string;
80
+
81
+ @ApiProperty({ description: "URL of the request", required: false })
82
+ @IsOptional()
83
+ @IsUrl({}, { message: "Request URL must be a valid URL" })
84
+ requestUrl?: string;
85
+
86
+ @ApiProperty({ description: "Redirect URL after payment", required: false })
87
+ @IsOptional()
88
+ @IsUrl({}, { message: "Redirect URL must be a valid URL" })
89
+ redirectUrl?: string;
90
+
91
+ @ApiProperty({ description: "Name of the customer", required: false })
92
+ @IsOptional()
93
+ @IsString({ message: "Customer name must be a string" })
94
+ customerName?: string;
95
+
96
+ @ApiProperty({ description: "Email address of the customer", required: false })
97
+ @IsOptional()
98
+ @IsEmail({}, { message: "Customer email address must be a valid email address" })
99
+ customerEmailAddress?: string;
100
+
101
+ @ApiProperty({ description: "Phone number of the customer", required: false })
102
+ @IsOptional()
103
+ @IsString({ message: "Customer phone number must be a string" })
104
+ customerPhoneNumber?: string;
105
+
106
+ @ApiProperty({ description: "Array of transaction splits", required: false })
107
+ @IsOptional()
108
+ transactionSplits?: TransactionSplitDto[];
109
+ }
110
+
111
+ export class APIPaymentRequestDto {
112
+ @ApiProperty({ description: "Unique identifier for the biller" })
113
+ @IsUUID("4", { message: "Biller ID must be a valid UUID" })
114
+ @IsOptional()
115
+ billerId?: string;
116
+
117
+ @ApiProperty({ description: "Unique identifier for the customer", required: false })
118
+ @IsOptional()
119
+ @IsUUID("4", { message: "Customer ID must be a valid UUID" })
120
+ customerId?: string;
121
+
122
+ @ApiProperty({ description: "Unique identifier for the invoice", required: false })
123
+ @IsOptional()
124
+ @IsUUID("4", { message: "Invoice ID must be a valid UUID" })
125
+ invoiceId?: string;
126
+
127
+ @ApiProperty({ description: "Unique identifier for the payment page", required: false })
128
+ @IsOptional()
129
+ @IsUUID("4", { message: "Payment Page ID must be a valid UUID" })
130
+ paymentPageId?: string;
131
+
132
+ @ApiProperty({ description: "IP address of the customer", required: false })
133
+ @IsOptional()
134
+ @IsIP("4", { message: "IP address must be a valid IP address" })
135
+ ipAddress?: string;
136
+
137
+ @ApiProperty({ description: "Total amount of the transaction" })
138
+ @IsNotEmpty({ message: "Transaction Total is required" })
139
+ @IsInt({ message: "Transaction Total must be the lowest currency denomination" })
140
+ transactionTotal: number;
141
+
142
+ @ApiProperty({ description: "URL of the request", required: false })
143
+ @IsOptional()
144
+ @IsUrl({}, { message: "Request URL must be a valid URL" })
145
+ requestUrl?: string;
146
+
147
+ @ApiProperty({ description: "Redirect URL after payment", required: false })
148
+ @IsOptional()
149
+ @IsUrl({}, { message: "Redirect URL must be a valid URL" })
150
+ redirectUrl?: string;
151
+
152
+ @ApiProperty({ description: "Name of the customer", required: false })
153
+ @IsOptional()
154
+ @IsString({ message: "Customer name must be a string" })
155
+ customerName?: string;
156
+
157
+ @ApiProperty({ description: "Email address of the customer", required: false })
158
+ @IsOptional()
159
+ @IsEmail({}, { message: "Customer email address must be a valid email address" })
160
+ customerEmailAddress?: string;
161
+
162
+ @ApiProperty({ description: "Phone number of the customer", required: false })
163
+ @IsOptional()
164
+ @IsString({ message: "Customer phone number must be a string" })
165
+ customerPhoneNumber?: string;
166
+
167
+ @ApiProperty({ description: "Array of transaction splits", required: false })
168
+ @IsOptional()
169
+ transactionSplits?: TransactionSplitDto[];
170
+ }