resurgence-data 1.1.21 → 1.1.24

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.
@@ -6,6 +6,7 @@ export declare class TransactionSplitDto {
6
6
  splitAmount?: number;
7
7
  }
8
8
  export declare class PaymentRequestDto {
9
+ uniqueTransactionRef?: string;
9
10
  billerId: string;
10
11
  apiKey?: string;
11
12
  customerId?: string;
@@ -13,7 +14,7 @@ export declare class PaymentRequestDto {
13
14
  paymentPageId?: string;
14
15
  transactionTotal: number;
15
16
  requestChannel: string;
16
- processorId: string;
17
+ processorId?: string;
17
18
  ipAddress?: string;
18
19
  requestUrl?: string;
19
20
  redirectUrl?: string;
@@ -23,6 +24,7 @@ export declare class PaymentRequestDto {
23
24
  transactionSplits?: TransactionSplitDto[];
24
25
  }
25
26
  export declare class APIPaymentRequestDto {
27
+ uniqueTransactionRef?: string;
26
28
  billerId?: string;
27
29
  apiKey?: string;
28
30
  customerId?: string;
@@ -37,3 +39,14 @@ export declare class APIPaymentRequestDto {
37
39
  customerPhoneNumber?: string;
38
40
  transactionSplits?: TransactionSplitDto[];
39
41
  }
42
+ export declare class CardChargeDTO {
43
+ currency: string;
44
+ cardNumber: string;
45
+ cvv: string;
46
+ expiryMonth: string;
47
+ expiryYear: string;
48
+ emailAddress: string;
49
+ transactionReference: string;
50
+ cardHolderName?: string;
51
+ redirectUrl?: string;
52
+ }
@@ -18,7 +18,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
18
18
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
21
+ exports.CardChargeDTO = exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
22
22
  const swagger_1 = require("@nestjs/swagger");
23
23
  const class_validator_1 = require("class-validator");
24
24
  const class_validator_2 = require("class-validator");
@@ -57,6 +57,11 @@ __decorate([
57
57
  class PaymentRequestDto {
58
58
  }
59
59
  exports.PaymentRequestDto = PaymentRequestDto;
60
+ __decorate([
61
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the transaction from the biller" }),
62
+ (0, class_validator_1.IsNotEmpty)({ message: "Your unique transaction reference is required" }),
63
+ __metadata("design:type", String)
64
+ ], PaymentRequestDto.prototype, "uniqueTransactionRef", void 0);
60
65
  __decorate([
61
66
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the biller" }),
62
67
  (0, class_validator_2.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
@@ -102,7 +107,7 @@ __decorate([
102
107
  __decorate([
103
108
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the processor" }),
104
109
  (0, class_validator_2.IsUUID)("4", { message: "Processor ID must be a valid UUID" }),
105
- (0, class_validator_1.IsNotEmpty)({ message: "Processor ID is required" }),
110
+ (0, class_validator_2.IsOptional)(),
106
111
  __metadata("design:type", String)
107
112
  ], PaymentRequestDto.prototype, "processorId", void 0);
108
113
  __decorate([
@@ -149,6 +154,11 @@ __decorate([
149
154
  class APIPaymentRequestDto {
150
155
  }
151
156
  exports.APIPaymentRequestDto = APIPaymentRequestDto;
157
+ __decorate([
158
+ (0, swagger_1.ApiProperty)({ description: "Unique identifier for the transaction from the biller" }),
159
+ (0, class_validator_1.IsNotEmpty)({ message: "Your unique transaction reference is required" }),
160
+ __metadata("design:type", String)
161
+ ], APIPaymentRequestDto.prototype, "uniqueTransactionRef", void 0);
152
162
  __decorate([
153
163
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the biller" }),
154
164
  (0, class_validator_2.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
@@ -226,3 +236,59 @@ __decorate([
226
236
  (0, class_validator_2.IsOptional)(),
227
237
  __metadata("design:type", Array)
228
238
  ], APIPaymentRequestDto.prototype, "transactionSplits", void 0);
239
+ class CardChargeDTO {
240
+ }
241
+ exports.CardChargeDTO = CardChargeDTO;
242
+ __decorate([
243
+ (0, swagger_1.ApiProperty)({ description: "Charge currency" }),
244
+ (0, class_validator_1.IsNotEmpty)({ message: "Please check your currency" }),
245
+ __metadata("design:type", String)
246
+ ], CardChargeDTO.prototype, "currency", void 0);
247
+ __decorate([
248
+ (0, swagger_1.ApiProperty)({ description: "Card number" }),
249
+ (0, class_validator_1.IsNotEmpty)({ message: "Seems you need to check the card number" }),
250
+ (0, class_validator_1.IsNumberString)(),
251
+ (0, class_validator_1.MinLength)(8, { message: "Please check you card number" }),
252
+ __metadata("design:type", String)
253
+ ], CardChargeDTO.prototype, "cardNumber", void 0);
254
+ __decorate([
255
+ (0, swagger_1.ApiProperty)({ description: "Charge CVV" }),
256
+ (0, class_validator_1.IsNotEmpty)({ message: "You must provide a security code" }),
257
+ (0, class_validator_1.IsNumberString)(),
258
+ (0, class_validator_1.Length)(3, 3, { message: "Please check your security code" }),
259
+ __metadata("design:type", String)
260
+ ], CardChargeDTO.prototype, "cvv", void 0);
261
+ __decorate([
262
+ (0, swagger_1.ApiProperty)({ description: "Card Expiry month" }),
263
+ (0, class_validator_1.IsNotEmpty)({ message: "Check your card expiry month" }),
264
+ (0, class_validator_1.IsNumberString)(),
265
+ (0, class_validator_1.Length)(2, 2, { message: "Expiry month must be 2 digits" }),
266
+ __metadata("design:type", String)
267
+ ], CardChargeDTO.prototype, "expiryMonth", void 0);
268
+ __decorate([
269
+ (0, swagger_1.ApiProperty)({ description: "Card Expiry year" }),
270
+ (0, class_validator_1.IsNotEmpty)({ message: "Check your card expiry year" }),
271
+ (0, class_validator_1.IsNumberString)(),
272
+ (0, class_validator_1.Length)(2, 2, { message: "Expiry year must be 2 digits" }),
273
+ __metadata("design:type", String)
274
+ ], CardChargeDTO.prototype, "expiryYear", void 0);
275
+ __decorate([
276
+ (0, swagger_1.ApiProperty)({ description: "Email address for the customer" }),
277
+ (0, class_validator_1.IsNotEmpty)({ message: "Customer email address is required" }),
278
+ __metadata("design:type", String)
279
+ ], CardChargeDTO.prototype, "emailAddress", void 0);
280
+ __decorate([
281
+ (0, swagger_1.ApiProperty)({ description: "Transaction reference" }),
282
+ (0, class_validator_1.IsNotEmpty)({ message: "Transaction reference is required" }),
283
+ __metadata("design:type", String)
284
+ ], CardChargeDTO.prototype, "transactionReference", void 0);
285
+ __decorate([
286
+ (0, swagger_1.ApiProperty)({ description: "Card holders full name" }),
287
+ (0, class_validator_2.IsOptional)(),
288
+ __metadata("design:type", String)
289
+ ], CardChargeDTO.prototype, "cardHolderName", void 0);
290
+ __decorate([
291
+ (0, swagger_1.ApiProperty)({ description: "3D Secure redirect url for customer" }),
292
+ (0, class_validator_2.IsOptional)(),
293
+ __metadata("design:type", String)
294
+ ], CardChargeDTO.prototype, "redirectUrl", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.21",
3
+ "version": "1.1.24",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,17 @@
9
9
  // * @apiParam {Object} [splitDetails] Transaction split details.
10
10
 
11
11
  import { ApiProperty } from "@nestjs/swagger";
12
- import { IsIn, IsInt, IsNotEmpty, IsNumber, IsString } from "class-validator";
12
+ import {
13
+ IsIn,
14
+ IsInt,
15
+ IsNotEmpty,
16
+ IsNumber,
17
+ isNumberString,
18
+ IsNumberString,
19
+ IsString,
20
+ Length,
21
+ MinLength,
22
+ } from "class-validator";
13
23
  import { IsOptional, IsUUID, IsEnum, IsIP, IsUrl, IsEmail } from "class-validator";
14
24
 
15
25
  export class TransactionSplitDto {
@@ -38,6 +48,10 @@ export class TransactionSplitDto {
38
48
  splitAmount?: number;
39
49
  }
40
50
  export class PaymentRequestDto {
51
+ @ApiProperty({ description: "Unique identifier for the transaction from the biller" })
52
+ @IsNotEmpty({ message: "Your unique transaction reference is required" })
53
+ uniqueTransactionRef?: string;
54
+
41
55
  @ApiProperty({ description: "Unique identifier for the biller" })
42
56
  @IsUUID("4", { message: "Biller ID must be a valid UUID" })
43
57
  @IsNotEmpty({ message: "Biller ID is required" })
@@ -75,8 +89,8 @@ export class PaymentRequestDto {
75
89
 
76
90
  @ApiProperty({ description: "Unique identifier for the processor" })
77
91
  @IsUUID("4", { message: "Processor ID must be a valid UUID" })
78
- @IsNotEmpty({ message: "Processor ID is required" })
79
- processorId: string;
92
+ @IsOptional()
93
+ processorId?: string;
80
94
 
81
95
  @ApiProperty({ description: "IP address of the customer", required: false })
82
96
  @IsOptional()
@@ -114,6 +128,10 @@ export class PaymentRequestDto {
114
128
  }
115
129
 
116
130
  export class APIPaymentRequestDto {
131
+ @ApiProperty({ description: "Unique identifier for the transaction from the biller" })
132
+ @IsNotEmpty({ message: "Your unique transaction reference is required" })
133
+ uniqueTransactionRef?: string;
134
+
117
135
  @ApiProperty({ description: "Unique identifier for the biller" })
118
136
  @IsUUID("4", { message: "Biller ID must be a valid UUID" })
119
137
  @IsOptional()
@@ -178,3 +196,41 @@ export class APIPaymentRequestDto {
178
196
  @IsOptional()
179
197
  transactionSplits?: TransactionSplitDto[];
180
198
  }
199
+
200
+ export class CardChargeDTO {
201
+ @ApiProperty({ description: "Charge currency" })
202
+ @IsNotEmpty({ message: "Please check your currency" })
203
+ currency: string;
204
+ @ApiProperty({ description: "Card number" })
205
+ @IsNotEmpty({ message: "Seems you need to check the card number" })
206
+ @IsNumberString()
207
+ @MinLength(8, { message: "Please check you card number" })
208
+ cardNumber: string;
209
+ @ApiProperty({ description: "Charge CVV" })
210
+ @IsNotEmpty({ message: "You must provide a security code" })
211
+ @IsNumberString()
212
+ @Length(3, 3, { message: "Please check your security code" })
213
+ cvv: string;
214
+ @ApiProperty({ description: "Card Expiry month" })
215
+ @IsNotEmpty({ message: "Check your card expiry month" })
216
+ @IsNumberString()
217
+ @Length(2, 2, { message: "Expiry month must be 2 digits" })
218
+ expiryMonth: string;
219
+ @ApiProperty({ description: "Card Expiry year" })
220
+ @IsNotEmpty({ message: "Check your card expiry year" })
221
+ @IsNumberString()
222
+ @Length(2, 2, { message: "Expiry year must be 2 digits" })
223
+ expiryYear: string;
224
+ @ApiProperty({ description: "Email address for the customer" })
225
+ @IsNotEmpty({ message: "Customer email address is required" })
226
+ emailAddress: string;
227
+ @ApiProperty({ description: "Transaction reference" })
228
+ @IsNotEmpty({ message: "Transaction reference is required" })
229
+ transactionReference: string;
230
+ @ApiProperty({ description: "Card holders full name" })
231
+ @IsOptional()
232
+ cardHolderName?: string;
233
+ @ApiProperty({ description: "3D Secure redirect url for customer" })
234
+ @IsOptional()
235
+ redirectUrl?: string;
236
+ }