resurgence-data 1.1.28 → 1.1.30

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.
@@ -248,3 +248,7 @@ export interface FlutterwaveOTPPayload {
248
248
  otp: string;
249
249
  flwRef: string;
250
250
  }
251
+ export interface TransactionCachePayload {
252
+ flwRef: string;
253
+ transactionReference: string;
254
+ }
@@ -49,6 +49,7 @@ export declare class CardChargeDTO {
49
49
  transactionReference: string;
50
50
  cardHolderName?: string;
51
51
  redirectUrl?: string;
52
+ amount: number;
52
53
  }
53
54
  export declare class CardChargeAuthorizationDto {
54
55
  transactionReference: string;
@@ -60,3 +61,7 @@ export declare class CardChargeAuthorizationDto {
60
61
  country?: string;
61
62
  zipcode?: string;
62
63
  }
64
+ export declare class CardValidationPayload {
65
+ transactionReference: string;
66
+ otp: string;
67
+ }
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CardChargeAuthorizationDto = exports.CardChargeDTO = exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
12
+ exports.CardValidationPayload = exports.CardChargeAuthorizationDto = exports.CardChargeDTO = exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  class TransactionSplitDto {
@@ -242,7 +242,7 @@ __decorate([
242
242
  __metadata("design:type", String)
243
243
  ], CardChargeDTO.prototype, "cardNumber", void 0);
244
244
  __decorate([
245
- (0, swagger_1.ApiProperty)({ description: "Charge CVV" }),
245
+ (0, swagger_1.ApiProperty)({ description: "Card CVV" }),
246
246
  (0, class_validator_1.IsNotEmpty)({ message: "You must provide a security code" }),
247
247
  (0, class_validator_1.IsNumberString)(),
248
248
  (0, class_validator_1.Length)(3, 3, { message: "Please check your security code" }),
@@ -282,6 +282,12 @@ __decorate([
282
282
  (0, class_validator_1.IsOptional)(),
283
283
  __metadata("design:type", String)
284
284
  ], CardChargeDTO.prototype, "redirectUrl", void 0);
285
+ __decorate([
286
+ (0, swagger_1.ApiProperty)({ description: "amount to be paid" }),
287
+ (0, class_validator_1.IsNumber)({ allowNaN: false, allowInfinity: false }, { message: "Amount must be a number" }),
288
+ (0, class_validator_1.IsNotEmpty)({ message: "Please specify the amount to be paid" }),
289
+ __metadata("design:type", Number)
290
+ ], CardChargeDTO.prototype, "amount", void 0);
285
291
  class CardChargeAuthorizationDto {
286
292
  }
287
293
  exports.CardChargeAuthorizationDto = CardChargeAuthorizationDto;
@@ -330,3 +336,16 @@ __decorate([
330
336
  (0, class_validator_1.IsString)({ message: "Please enter your zip code" }),
331
337
  __metadata("design:type", String)
332
338
  ], CardChargeAuthorizationDto.prototype, "zipcode", void 0);
339
+ class CardValidationPayload {
340
+ }
341
+ exports.CardValidationPayload = CardValidationPayload;
342
+ __decorate([
343
+ (0, swagger_1.ApiProperty)({ description: "Transaction reference" }),
344
+ (0, class_validator_1.IsNotEmpty)({ message: "Transaction reference is required" }),
345
+ __metadata("design:type", String)
346
+ ], CardValidationPayload.prototype, "transactionReference", void 0);
347
+ __decorate([
348
+ (0, swagger_1.ApiProperty)({ description: "OTP sent to the customer" }),
349
+ (0, class_validator_1.IsNotEmpty)({ message: "OTP is required" }),
350
+ __metadata("design:type", String)
351
+ ], CardValidationPayload.prototype, "otp", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -263,3 +263,7 @@ export interface FlutterwaveOTPPayload {
263
263
  otp: string;
264
264
  flwRef: string;
265
265
  }
266
+ export interface TransactionCachePayload {
267
+ flwRef: string;
268
+ transactionReference: string;
269
+ }
@@ -13,6 +13,7 @@ import {
13
13
  IsIP,
14
14
  IsUrl,
15
15
  IsEmail,
16
+ IsNumber,
16
17
  } from "class-validator";
17
18
 
18
19
  export class TransactionSplitDto {
@@ -199,7 +200,7 @@ export class CardChargeDTO {
199
200
  @IsNumberString()
200
201
  @MinLength(8, { message: "Please check you card number" })
201
202
  cardNumber: string;
202
- @ApiProperty({ description: "Charge CVV" })
203
+ @ApiProperty({ description: "Card CVV" })
203
204
  @IsNotEmpty({ message: "You must provide a security code" })
204
205
  @IsNumberString()
205
206
  @Length(3, 3, { message: "Please check your security code" })
@@ -226,6 +227,10 @@ export class CardChargeDTO {
226
227
  @ApiProperty({ description: "3D Secure redirect url for customer" })
227
228
  @IsOptional()
228
229
  redirectUrl?: string;
230
+ @ApiProperty({ description: "amount to be paid" })
231
+ @IsNumber({ allowNaN: false, allowInfinity: false }, { message: "Amount must be a number" })
232
+ @IsNotEmpty({ message: "Please specify the amount to be paid" })
233
+ amount: number;
229
234
  }
230
235
 
231
236
  export class CardChargeAuthorizationDto {
@@ -266,3 +271,13 @@ export class CardChargeAuthorizationDto {
266
271
  @IsString({ message: "Please enter your zip code" })
267
272
  zipcode?: string;
268
273
  }
274
+
275
+ export class CardValidationPayload {
276
+ @ApiProperty({ description: "Transaction reference" })
277
+ @IsNotEmpty({ message: "Transaction reference is required" })
278
+ transactionReference: string;
279
+
280
+ @ApiProperty({ description: "OTP sent to the customer" })
281
+ @IsNotEmpty({ message: "OTP is required" })
282
+ otp: string;
283
+ }