resurgence-data 1.1.25 → 1.1.27

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.
@@ -59,6 +59,87 @@ export interface FlutterwaveCardChargeResponseDTO {
59
59
  };
60
60
  };
61
61
  }
62
+ export interface FlutterwaveCardValidationResponseDTO {
63
+ status: string;
64
+ message: string;
65
+ data: {
66
+ id: number;
67
+ tx_ref: string;
68
+ flw_ref: string;
69
+ device_fingerprint: string;
70
+ amount: number;
71
+ charged_amount: number;
72
+ app_fee: number;
73
+ merchant_fee: number;
74
+ processor_response: string;
75
+ auth_model: string;
76
+ currency: string;
77
+ ip: string;
78
+ narration: string;
79
+ status: string;
80
+ auth_url: string;
81
+ payment_type: string;
82
+ fraud_status: string;
83
+ charge_type: string;
84
+ created_at: string;
85
+ account_id: number;
86
+ customer: {
87
+ id: number;
88
+ phone_number: string;
89
+ name: string;
90
+ email: string;
91
+ created_at: string;
92
+ };
93
+ card: {
94
+ first_6digits: string;
95
+ last_4digits: string;
96
+ issuer: string;
97
+ country: string;
98
+ type: string;
99
+ expiry: string;
100
+ };
101
+ };
102
+ }
103
+ export interface FlutterwaveCardVerificationResponseDTO {
104
+ status: string;
105
+ message: string;
106
+ data: {
107
+ id: number;
108
+ tx_ref: string;
109
+ flw_ref: string;
110
+ device_fingerprint: string;
111
+ amount: number;
112
+ currency: string;
113
+ charged_amount: number;
114
+ app_fee: number;
115
+ merchant_fee: number;
116
+ processor_response: string;
117
+ auth_model: string;
118
+ ip: string;
119
+ narration: string;
120
+ status: string;
121
+ payment_type: string;
122
+ created_at: string;
123
+ account_id: number;
124
+ card: {
125
+ first_6digits: string;
126
+ last_4digits: string;
127
+ issuer: string;
128
+ country: string;
129
+ type: string;
130
+ token: string;
131
+ expiry: string;
132
+ };
133
+ amount_settled: number;
134
+ customer: {
135
+ id: number;
136
+ phone_number: string;
137
+ name: string;
138
+ email: string;
139
+ created_at: string;
140
+ };
141
+ };
142
+ }
62
143
  export interface FlutterwaveCardChargePayload {
63
144
  cardNumber: string;
64
145
  expiryMonth: string;
@@ -163,3 +244,7 @@ export interface VerifyPaymentResponseDTO {
163
244
  };
164
245
  };
165
246
  }
247
+ export interface FlutterwaveOTPPayload {
248
+ otp: string;
249
+ flwRef: string;
250
+ }
@@ -1 +1,2 @@
1
1
  export * from "./payment-request.dto";
2
+ export * from "./payment.data";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./payment-request.dto"), exports);
18
+ __exportStar(require("./payment.data"), exports);
@@ -50,3 +50,13 @@ export declare class CardChargeDTO {
50
50
  cardHolderName?: string;
51
51
  redirectUrl?: string;
52
52
  }
53
+ export declare class CardChargeAuthorizationDto {
54
+ transactionReference: string;
55
+ mode: string;
56
+ pin?: string;
57
+ city?: string;
58
+ address?: string;
59
+ state?: string;
60
+ country?: string;
61
+ zipcode?: string;
62
+ }
@@ -1,13 +1,4 @@
1
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
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -18,16 +9,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
18
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
10
  };
20
11
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.CardChargeDTO = exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
12
+ exports.CardChargeAuthorizationDto = exports.CardChargeDTO = exports.APIPaymentRequestDto = exports.PaymentRequestDto = exports.TransactionSplitDto = void 0;
22
13
  const swagger_1 = require("@nestjs/swagger");
23
14
  const class_validator_1 = require("class-validator");
24
- const class_validator_2 = require("class-validator");
25
15
  class TransactionSplitDto {
26
16
  }
27
17
  exports.TransactionSplitDto = TransactionSplitDto;
28
18
  __decorate([
29
19
  (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" }),
20
+ (0, class_validator_1.IsUUID)("4", { message: "Account ID must be a valid UUID" }),
31
21
  (0, class_validator_1.IsNotEmpty)({ message: "Account ID is required" }),
32
22
  __metadata("design:type", String)
33
23
  ], TransactionSplitDto.prototype, "accountId", void 0);
@@ -51,7 +41,7 @@ __decorate([
51
41
  ], TransactionSplitDto.prototype, "transactionTotal", void 0);
52
42
  __decorate([
53
43
  (0, swagger_1.ApiProperty)({ description: "Amount of the transaction split" }),
54
- (0, class_validator_2.IsOptional)(),
44
+ (0, class_validator_1.IsOptional)(),
55
45
  __metadata("design:type", Number)
56
46
  ], TransactionSplitDto.prototype, "splitAmount", void 0);
57
47
  class PaymentRequestDto {
@@ -64,32 +54,32 @@ __decorate([
64
54
  ], PaymentRequestDto.prototype, "uniqueTransactionRef", void 0);
65
55
  __decorate([
66
56
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the biller" }),
67
- (0, class_validator_2.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
57
+ (0, class_validator_1.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
68
58
  (0, class_validator_1.IsNotEmpty)({ message: "Biller ID is required" }),
69
59
  __metadata("design:type", String)
70
60
  ], PaymentRequestDto.prototype, "billerId", void 0);
71
61
  __decorate([
72
62
  (0, swagger_1.ApiProperty)({ description: "API Key for the biller" }),
73
63
  (0, class_validator_1.IsString)({ message: "API key is not provided" }),
74
- (0, class_validator_2.IsOptional)(),
64
+ (0, class_validator_1.IsOptional)(),
75
65
  __metadata("design:type", String)
76
66
  ], PaymentRequestDto.prototype, "apiKey", void 0);
77
67
  __decorate([
78
68
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the customer", required: false }),
79
- (0, class_validator_2.IsOptional)(),
80
- (0, class_validator_2.IsUUID)("4", { message: "Customer ID must be a valid UUID" }),
69
+ (0, class_validator_1.IsOptional)(),
70
+ (0, class_validator_1.IsUUID)("4", { message: "Customer ID must be a valid UUID" }),
81
71
  __metadata("design:type", String)
82
72
  ], PaymentRequestDto.prototype, "customerId", void 0);
83
73
  __decorate([
84
74
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the invoice", required: false }),
85
- (0, class_validator_2.IsOptional)(),
86
- (0, class_validator_2.IsUUID)("4", { message: "Invoice ID must be a valid UUID" }),
75
+ (0, class_validator_1.IsOptional)(),
76
+ (0, class_validator_1.IsUUID)("4", { message: "Invoice ID must be a valid UUID" }),
87
77
  __metadata("design:type", String)
88
78
  ], PaymentRequestDto.prototype, "invoiceId", void 0);
89
79
  __decorate([
90
80
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the payment page", required: false }),
91
- (0, class_validator_2.IsOptional)(),
92
- (0, class_validator_2.IsUUID)("4", { message: "Payment Page ID must be a valid UUID" }),
81
+ (0, class_validator_1.IsOptional)(),
82
+ (0, class_validator_1.IsUUID)("4", { message: "Payment Page ID must be a valid UUID" }),
93
83
  __metadata("design:type", String)
94
84
  ], PaymentRequestDto.prototype, "paymentPageId", void 0);
95
85
  __decorate([
@@ -106,49 +96,49 @@ __decorate([
106
96
  ], PaymentRequestDto.prototype, "requestChannel", void 0);
107
97
  __decorate([
108
98
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the processor" }),
109
- (0, class_validator_2.IsUUID)("4", { message: "Processor ID must be a valid UUID" }),
110
- (0, class_validator_2.IsOptional)(),
99
+ (0, class_validator_1.IsUUID)("4", { message: "Processor ID must be a valid UUID" }),
100
+ (0, class_validator_1.IsOptional)(),
111
101
  __metadata("design:type", String)
112
102
  ], PaymentRequestDto.prototype, "processorId", void 0);
113
103
  __decorate([
114
104
  (0, swagger_1.ApiProperty)({ description: "IP address of the customer", required: false }),
115
- (0, class_validator_2.IsOptional)(),
116
- (0, class_validator_2.IsIP)("4", { message: "IP address must be a valid IP address" }),
105
+ (0, class_validator_1.IsOptional)(),
106
+ (0, class_validator_1.IsIP)("4", { message: "IP address must be a valid IP address" }),
117
107
  __metadata("design:type", String)
118
108
  ], PaymentRequestDto.prototype, "ipAddress", void 0);
119
109
  __decorate([
120
110
  (0, swagger_1.ApiProperty)({ description: "URL of the request", required: false }),
121
- (0, class_validator_2.IsOptional)(),
122
- (0, class_validator_2.IsUrl)({}, { message: "Request URL must be a valid URL" }),
111
+ (0, class_validator_1.IsOptional)(),
112
+ (0, class_validator_1.IsUrl)({}, { message: "Request URL must be a valid URL" }),
123
113
  __metadata("design:type", String)
124
114
  ], PaymentRequestDto.prototype, "requestUrl", void 0);
125
115
  __decorate([
126
116
  (0, swagger_1.ApiProperty)({ description: "Redirect URL after payment", required: false }),
127
- (0, class_validator_2.IsOptional)(),
128
- (0, class_validator_2.IsUrl)({}, { message: "Redirect URL must be a valid URL" }),
117
+ (0, class_validator_1.IsOptional)(),
118
+ (0, class_validator_1.IsUrl)({}, { message: "Redirect URL must be a valid URL" }),
129
119
  __metadata("design:type", String)
130
120
  ], PaymentRequestDto.prototype, "redirectUrl", void 0);
131
121
  __decorate([
132
122
  (0, swagger_1.ApiProperty)({ description: "Name of the customer", required: false }),
133
- (0, class_validator_2.IsOptional)(),
123
+ (0, class_validator_1.IsOptional)(),
134
124
  (0, class_validator_1.IsString)({ message: "Customer name must be a string" }),
135
125
  __metadata("design:type", String)
136
126
  ], PaymentRequestDto.prototype, "customerName", void 0);
137
127
  __decorate([
138
128
  (0, swagger_1.ApiProperty)({ description: "Email address of the customer", required: false }),
139
- (0, class_validator_2.IsOptional)(),
140
- (0, class_validator_2.IsEmail)({}, { message: "Customer email address must be a valid email address" }),
129
+ (0, class_validator_1.IsOptional)(),
130
+ (0, class_validator_1.IsEmail)({}, { message: "Customer email address must be a valid email address" }),
141
131
  __metadata("design:type", String)
142
132
  ], PaymentRequestDto.prototype, "customerEmailAddress", void 0);
143
133
  __decorate([
144
134
  (0, swagger_1.ApiProperty)({ description: "Phone number of the customer", required: false }),
145
- (0, class_validator_2.IsOptional)(),
135
+ (0, class_validator_1.IsOptional)(),
146
136
  (0, class_validator_1.IsString)({ message: "Customer phone number must be a string" }),
147
137
  __metadata("design:type", String)
148
138
  ], PaymentRequestDto.prototype, "customerPhoneNumber", void 0);
149
139
  __decorate([
150
140
  (0, swagger_1.ApiProperty)({ description: "Array of transaction splits", required: false }),
151
- (0, class_validator_2.IsOptional)(),
141
+ (0, class_validator_1.IsOptional)(),
152
142
  __metadata("design:type", Array)
153
143
  ], PaymentRequestDto.prototype, "transactionSplits", void 0);
154
144
  class APIPaymentRequestDto {
@@ -161,38 +151,38 @@ __decorate([
161
151
  ], APIPaymentRequestDto.prototype, "uniqueTransactionRef", void 0);
162
152
  __decorate([
163
153
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the biller" }),
164
- (0, class_validator_2.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
165
- (0, class_validator_2.IsOptional)(),
154
+ (0, class_validator_1.IsUUID)("4", { message: "Biller ID must be a valid UUID" }),
155
+ (0, class_validator_1.IsOptional)(),
166
156
  __metadata("design:type", String)
167
157
  ], APIPaymentRequestDto.prototype, "billerId", void 0);
168
158
  __decorate([
169
159
  (0, swagger_1.ApiProperty)({ description: "API Key for the biller" }),
170
160
  (0, class_validator_1.IsString)({ message: "API key is not provided" }),
171
- (0, class_validator_2.IsOptional)(),
161
+ (0, class_validator_1.IsOptional)(),
172
162
  __metadata("design:type", String)
173
163
  ], APIPaymentRequestDto.prototype, "apiKey", void 0);
174
164
  __decorate([
175
165
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the customer", required: false }),
176
- (0, class_validator_2.IsOptional)(),
177
- (0, class_validator_2.IsUUID)("4", { message: "Customer ID must be a valid UUID" }),
166
+ (0, class_validator_1.IsOptional)(),
167
+ (0, class_validator_1.IsUUID)("4", { message: "Customer ID must be a valid UUID" }),
178
168
  __metadata("design:type", String)
179
169
  ], APIPaymentRequestDto.prototype, "customerId", void 0);
180
170
  __decorate([
181
171
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the invoice", required: false }),
182
- (0, class_validator_2.IsOptional)(),
183
- (0, class_validator_2.IsUUID)("4", { message: "Invoice ID must be a valid UUID" }),
172
+ (0, class_validator_1.IsOptional)(),
173
+ (0, class_validator_1.IsUUID)("4", { message: "Invoice ID must be a valid UUID" }),
184
174
  __metadata("design:type", String)
185
175
  ], APIPaymentRequestDto.prototype, "invoiceId", void 0);
186
176
  __decorate([
187
177
  (0, swagger_1.ApiProperty)({ description: "Unique identifier for the payment page", required: false }),
188
- (0, class_validator_2.IsOptional)(),
189
- (0, class_validator_2.IsUUID)("4", { message: "Payment Page ID must be a valid UUID" }),
178
+ (0, class_validator_1.IsOptional)(),
179
+ (0, class_validator_1.IsUUID)("4", { message: "Payment Page ID must be a valid UUID" }),
190
180
  __metadata("design:type", String)
191
181
  ], APIPaymentRequestDto.prototype, "paymentPageId", void 0);
192
182
  __decorate([
193
183
  (0, swagger_1.ApiProperty)({ description: "IP address of the customer", required: false }),
194
- (0, class_validator_2.IsOptional)(),
195
- (0, class_validator_2.IsIP)("4", { message: "IP address must be a valid IP address" }),
184
+ (0, class_validator_1.IsOptional)(),
185
+ (0, class_validator_1.IsIP)("4", { message: "IP address must be a valid IP address" }),
196
186
  __metadata("design:type", String)
197
187
  ], APIPaymentRequestDto.prototype, "ipAddress", void 0);
198
188
  __decorate([
@@ -203,37 +193,37 @@ __decorate([
203
193
  ], APIPaymentRequestDto.prototype, "transactionTotal", void 0);
204
194
  __decorate([
205
195
  (0, swagger_1.ApiProperty)({ description: "URL of the request", required: false }),
206
- (0, class_validator_2.IsOptional)(),
207
- (0, class_validator_2.IsUrl)({}, { message: "Request URL must be a valid URL" }),
196
+ (0, class_validator_1.IsOptional)(),
197
+ (0, class_validator_1.IsUrl)({}, { message: "Request URL must be a valid URL" }),
208
198
  __metadata("design:type", String)
209
199
  ], APIPaymentRequestDto.prototype, "requestUrl", void 0);
210
200
  __decorate([
211
201
  (0, swagger_1.ApiProperty)({ description: "Redirect URL after payment", required: false }),
212
- (0, class_validator_2.IsOptional)(),
213
- (0, class_validator_2.IsUrl)({}, { message: "Redirect URL must be a valid URL" }),
202
+ (0, class_validator_1.IsOptional)(),
203
+ (0, class_validator_1.IsUrl)({}, { message: "Redirect URL must be a valid URL" }),
214
204
  __metadata("design:type", String)
215
205
  ], APIPaymentRequestDto.prototype, "redirectUrl", void 0);
216
206
  __decorate([
217
207
  (0, swagger_1.ApiProperty)({ description: "Name of the customer", required: false }),
218
- (0, class_validator_2.IsOptional)(),
208
+ (0, class_validator_1.IsOptional)(),
219
209
  (0, class_validator_1.IsString)({ message: "Customer name must be a string" }),
220
210
  __metadata("design:type", String)
221
211
  ], APIPaymentRequestDto.prototype, "customerName", void 0);
222
212
  __decorate([
223
213
  (0, swagger_1.ApiProperty)({ description: "Email address of the customer", required: false }),
224
- (0, class_validator_2.IsOptional)(),
225
- (0, class_validator_2.IsEmail)({}, { message: "Customer email address must be a valid email address" }),
214
+ (0, class_validator_1.IsOptional)(),
215
+ (0, class_validator_1.IsEmail)({}, { message: "Customer email address must be a valid email address" }),
226
216
  __metadata("design:type", String)
227
217
  ], APIPaymentRequestDto.prototype, "customerEmailAddress", void 0);
228
218
  __decorate([
229
219
  (0, swagger_1.ApiProperty)({ description: "Phone number of the customer", required: false }),
230
- (0, class_validator_2.IsOptional)(),
220
+ (0, class_validator_1.IsOptional)(),
231
221
  (0, class_validator_1.IsString)({ message: "Customer phone number must be a string" }),
232
222
  __metadata("design:type", String)
233
223
  ], APIPaymentRequestDto.prototype, "customerPhoneNumber", void 0);
234
224
  __decorate([
235
225
  (0, swagger_1.ApiProperty)({ description: "Array of transaction splits", required: false }),
236
- (0, class_validator_2.IsOptional)(),
226
+ (0, class_validator_1.IsOptional)(),
237
227
  __metadata("design:type", Array)
238
228
  ], APIPaymentRequestDto.prototype, "transactionSplits", void 0);
239
229
  class CardChargeDTO {
@@ -284,11 +274,59 @@ __decorate([
284
274
  ], CardChargeDTO.prototype, "transactionReference", void 0);
285
275
  __decorate([
286
276
  (0, swagger_1.ApiProperty)({ description: "Card holders full name" }),
287
- (0, class_validator_2.IsOptional)(),
277
+ (0, class_validator_1.IsOptional)(),
288
278
  __metadata("design:type", String)
289
279
  ], CardChargeDTO.prototype, "cardHolderName", void 0);
290
280
  __decorate([
291
281
  (0, swagger_1.ApiProperty)({ description: "3D Secure redirect url for customer" }),
292
- (0, class_validator_2.IsOptional)(),
282
+ (0, class_validator_1.IsOptional)(),
293
283
  __metadata("design:type", String)
294
284
  ], CardChargeDTO.prototype, "redirectUrl", void 0);
285
+ class CardChargeAuthorizationDto {
286
+ }
287
+ exports.CardChargeAuthorizationDto = CardChargeAuthorizationDto;
288
+ __decorate([
289
+ (0, class_validator_1.IsNotEmpty)({ message: "Transaction reference is required" }),
290
+ (0, class_validator_1.IsString)({ message: "Transaction reference must be a string" }),
291
+ __metadata("design:type", String)
292
+ ], CardChargeAuthorizationDto.prototype, "transactionReference", void 0);
293
+ __decorate([
294
+ (0, class_validator_1.IsIn)(["pin", "redirect", "avs_noauth"], { message: "Mode must be one of 'pin', 'redirect', 'avs_noauth'" }),
295
+ __metadata("design:type", String)
296
+ ], CardChargeAuthorizationDto.prototype, "mode", void 0);
297
+ __decorate([
298
+ (0, class_validator_1.ValidateIf)((o) => o.mode === "pin"),
299
+ (0, class_validator_1.IsNotEmpty)({ message: "Please enter your card pin" }),
300
+ (0, class_validator_1.IsString)({ message: "Please enter a 4 digit pin" }),
301
+ __metadata("design:type", String)
302
+ ], CardChargeAuthorizationDto.prototype, "pin", void 0);
303
+ __decorate([
304
+ (0, class_validator_1.ValidateIf)((o) => o.mode === "avs_noauth"),
305
+ (0, class_validator_1.IsNotEmpty)({ message: "City is required for AVS no-auth mode" }),
306
+ (0, class_validator_1.IsString)({ message: "Please enter your address city" }),
307
+ __metadata("design:type", String)
308
+ ], CardChargeAuthorizationDto.prototype, "city", void 0);
309
+ __decorate([
310
+ (0, class_validator_1.ValidateIf)((o) => o.mode === "avs_noauth"),
311
+ (0, class_validator_1.IsNotEmpty)({ message: "Address is required for AVS no-auth mode" }),
312
+ (0, class_validator_1.IsString)({ message: "Please enter your address" }),
313
+ __metadata("design:type", String)
314
+ ], CardChargeAuthorizationDto.prototype, "address", void 0);
315
+ __decorate([
316
+ (0, class_validator_1.ValidateIf)((o) => o.mode === "avs_noauth"),
317
+ (0, class_validator_1.IsNotEmpty)({ message: "State is required for AVS no-auth mode" }),
318
+ (0, class_validator_1.IsString)({ message: "Please enter your state" }),
319
+ __metadata("design:type", String)
320
+ ], CardChargeAuthorizationDto.prototype, "state", void 0);
321
+ __decorate([
322
+ (0, class_validator_1.ValidateIf)((o) => o.mode === "avs_noauth"),
323
+ (0, class_validator_1.IsNotEmpty)({ message: "Country is required for AVS no-auth mode" }),
324
+ (0, class_validator_1.IsString)({ message: "Please enter your country" }),
325
+ __metadata("design:type", String)
326
+ ], CardChargeAuthorizationDto.prototype, "country", void 0);
327
+ __decorate([
328
+ (0, class_validator_1.ValidateIf)((o) => o.mode === "avs_noauth"),
329
+ (0, class_validator_1.IsNotEmpty)({ message: "Zipcode is required for AVS no-auth mode" }),
330
+ (0, class_validator_1.IsString)({ message: "Please enter your zip code" }),
331
+ __metadata("design:type", String)
332
+ ], CardChargeAuthorizationDto.prototype, "zipcode", void 0);
@@ -0,0 +1,9 @@
1
+ export declare class PaymentDto {
2
+ id: string;
3
+ paymentRequestId: string;
4
+ billerId: string;
5
+ processorId: string;
6
+ processorReference: string;
7
+ processorResponse?: any;
8
+ paymentType: string;
9
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentDto = void 0;
4
+ class PaymentDto {
5
+ }
6
+ exports.PaymentDto = PaymentDto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -62,6 +62,88 @@ export interface FlutterwaveCardChargeResponseDTO {
62
62
  };
63
63
  }
64
64
 
65
+ export interface FlutterwaveCardValidationResponseDTO {
66
+ status: string;
67
+ message: string;
68
+ data: {
69
+ id: number;
70
+ tx_ref: string;
71
+ flw_ref: string;
72
+ device_fingerprint: string;
73
+ amount: number;
74
+ charged_amount: number;
75
+ app_fee: number;
76
+ merchant_fee: number;
77
+ processor_response: string;
78
+ auth_model: string;
79
+ currency: string;
80
+ ip: string;
81
+ narration: string;
82
+ status: string;
83
+ auth_url: string;
84
+ payment_type: string;
85
+ fraud_status: string;
86
+ charge_type: string;
87
+ created_at: string;
88
+ account_id: number;
89
+ customer: {
90
+ id: number;
91
+ phone_number: string;
92
+ name: string;
93
+ email: string;
94
+ created_at: string;
95
+ };
96
+ card: {
97
+ first_6digits: string;
98
+ last_4digits: string;
99
+ issuer: string;
100
+ country: string;
101
+ type: string;
102
+ expiry: string;
103
+ };
104
+ };
105
+ }
106
+ export interface FlutterwaveCardVerificationResponseDTO {
107
+ status: string;
108
+ message: string;
109
+ data: {
110
+ id: number;
111
+ tx_ref: string;
112
+ flw_ref: string;
113
+ device_fingerprint: string;
114
+ amount: number;
115
+ currency: string;
116
+ charged_amount: number;
117
+ app_fee: number;
118
+ merchant_fee: number;
119
+ processor_response: string;
120
+ auth_model: string;
121
+ ip: string;
122
+ narration: string;
123
+ status: string;
124
+ payment_type: string;
125
+ created_at: string;
126
+ account_id: number;
127
+ card: {
128
+ first_6digits: string;
129
+ last_4digits: string;
130
+ issuer: string;
131
+ country: string;
132
+ type: string;
133
+ token: string;
134
+ expiry: string;
135
+ };
136
+ amount_settled: number;
137
+ customer: {
138
+ id: number;
139
+ phone_number: string;
140
+ name: string;
141
+ email: string;
142
+ created_at: string;
143
+ };
144
+ };
145
+ }
146
+
65
147
  export interface FlutterwaveCardChargePayload {
66
148
  cardNumber: string;
67
149
  expiryMonth: string;
@@ -176,3 +258,8 @@ export interface VerifyPaymentResponseDTO {
176
258
  };
177
259
  };
178
260
  }
261
+
262
+ export interface FlutterwaveOTPPayload {
263
+ otp: string;
264
+ flwRef: string;
265
+ }
@@ -1 +1,2 @@
1
1
  export * from "./payment-request.dto";
2
+ export * from "./payment.data";
@@ -1,26 +1,19 @@
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
1
  import { ApiProperty } from "@nestjs/swagger";
12
2
  import {
13
3
  IsIn,
14
4
  IsInt,
15
5
  IsNotEmpty,
16
- IsNumber,
17
- isNumberString,
18
6
  IsNumberString,
19
7
  IsString,
20
8
  Length,
21
9
  MinLength,
10
+ ValidateIf,
11
+ IsOptional,
12
+ IsUUID,
13
+ IsIP,
14
+ IsUrl,
15
+ IsEmail,
22
16
  } from "class-validator";
23
- import { IsOptional, IsUUID, IsEnum, IsIP, IsUrl, IsEmail } from "class-validator";
24
17
 
25
18
  export class TransactionSplitDto {
26
19
  @ApiProperty({ description: "Unique identifier for the account" })
@@ -234,3 +227,42 @@ export class CardChargeDTO {
234
227
  @IsOptional()
235
228
  redirectUrl?: string;
236
229
  }
230
+
231
+ export class CardChargeAuthorizationDto {
232
+ @IsNotEmpty({ message: "Transaction reference is required" })
233
+ @IsString({ message: "Transaction reference must be a string" })
234
+ transactionReference: string;
235
+
236
+ @IsIn(["pin", "redirect", "avs_noauth"], { message: "Mode must be one of 'pin', 'redirect', 'avs_noauth'" })
237
+ mode: string;
238
+
239
+ @ValidateIf((o) => o.mode === "pin")
240
+ @IsNotEmpty({ message: "Please enter your card pin" })
241
+ @IsString({ message: "Please enter a 4 digit pin" })
242
+ pin?: string;
243
+
244
+ @ValidateIf((o) => o.mode === "avs_noauth")
245
+ @IsNotEmpty({ message: "City is required for AVS no-auth mode" })
246
+ @IsString({ message: "Please enter your address city" })
247
+ city?: string;
248
+
249
+ @ValidateIf((o) => o.mode === "avs_noauth")
250
+ @IsNotEmpty({ message: "Address is required for AVS no-auth mode" })
251
+ @IsString({ message: "Please enter your address" })
252
+ address?: string;
253
+
254
+ @ValidateIf((o) => o.mode === "avs_noauth")
255
+ @IsNotEmpty({ message: "State is required for AVS no-auth mode" })
256
+ @IsString({ message: "Please enter your state" })
257
+ state?: string;
258
+
259
+ @ValidateIf((o) => o.mode === "avs_noauth")
260
+ @IsNotEmpty({ message: "Country is required for AVS no-auth mode" })
261
+ @IsString({ message: "Please enter your country" })
262
+ country?: string;
263
+
264
+ @ValidateIf((o) => o.mode === "avs_noauth")
265
+ @IsNotEmpty({ message: "Zipcode is required for AVS no-auth mode" })
266
+ @IsString({ message: "Please enter your zip code" })
267
+ zipcode?: string;
268
+ }
@@ -0,0 +1,9 @@
1
+ export class PaymentDto {
2
+ id: string;
3
+ paymentRequestId: string;
4
+ billerId: string;
5
+ processorId: string;
6
+ processorReference: string;
7
+ processorResponse?: any;
8
+ paymentType: string;
9
+ }