sdk-nave-nodejs 0.0.3 → 0.0.5
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 +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/client-types.d.ts +402 -22
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.NaveClient = void 0;
|
|
4
18
|
const NaveClient_1 = require("./lib/NaveClient");
|
|
5
19
|
Object.defineProperty(exports, "NaveClient", { enumerable: true, get: function () { return NaveClient_1.NaveClient; } });
|
|
20
|
+
__exportStar(require("./lib/client-types"), exports);
|
|
6
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA8C;AAErC,2FAFA,uBAAU,OAEA;AADnB,qDAAmC"}
|
|
@@ -4,6 +4,10 @@ export interface ResponseNaveToken {
|
|
|
4
4
|
expires_in: number;
|
|
5
5
|
token_type: string;
|
|
6
6
|
}
|
|
7
|
+
export interface NaveAmount {
|
|
8
|
+
currency: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
7
11
|
export interface NaveBuyer {
|
|
8
12
|
user_id: string;
|
|
9
13
|
doc_type?: string;
|
|
@@ -13,24 +17,21 @@ export interface NaveBuyer {
|
|
|
13
17
|
phone?: string;
|
|
14
18
|
billing_address?: NaveBillingAddress;
|
|
15
19
|
}
|
|
16
|
-
export
|
|
20
|
+
export interface NaveBillingAddress {
|
|
17
21
|
street_1: string;
|
|
18
22
|
street_2?: string;
|
|
19
23
|
city: string;
|
|
20
24
|
region: string;
|
|
21
25
|
country: string;
|
|
22
26
|
zip_code: string;
|
|
23
|
-
}
|
|
24
|
-
export
|
|
27
|
+
}
|
|
28
|
+
export interface NaveProduct {
|
|
25
29
|
id: string;
|
|
26
30
|
name: string;
|
|
27
31
|
description: string;
|
|
28
32
|
quantity: number;
|
|
29
|
-
unit_price:
|
|
30
|
-
|
|
31
|
-
value: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
33
|
+
unit_price: NaveAmount;
|
|
34
|
+
}
|
|
34
35
|
export interface BodyNaveCreateOrder {
|
|
35
36
|
/**
|
|
36
37
|
* Platform identifier: Provided by Nave
|
|
@@ -56,10 +57,7 @@ export interface BodyNaveCreateOrder {
|
|
|
56
57
|
payment_request: {
|
|
57
58
|
transactions: {
|
|
58
59
|
products: NaveProduct[];
|
|
59
|
-
amount:
|
|
60
|
-
currency: string;
|
|
61
|
-
value: string;
|
|
62
|
-
};
|
|
60
|
+
amount: NaveAmount;
|
|
63
61
|
}[];
|
|
64
62
|
buyer: NaveBuyer;
|
|
65
63
|
};
|
|
@@ -74,10 +72,7 @@ export interface ResponseNaveCreateOrder {
|
|
|
74
72
|
qr_data: string;
|
|
75
73
|
payment_request_id: string;
|
|
76
74
|
checkout_url: string;
|
|
77
|
-
amount:
|
|
78
|
-
currency: string;
|
|
79
|
-
value: string;
|
|
80
|
-
};
|
|
75
|
+
amount: NaveAmount;
|
|
81
76
|
redirect_to: string;
|
|
82
77
|
};
|
|
83
78
|
success: boolean;
|
|
@@ -86,20 +81,405 @@ export interface ResponseNaveCreateOrder {
|
|
|
86
81
|
export interface ResponseNaveGetOrder {
|
|
87
82
|
id: string;
|
|
88
83
|
external_payment_id: string;
|
|
89
|
-
payment_id: string
|
|
90
|
-
order_id: string;
|
|
84
|
+
payment_id: string;
|
|
91
85
|
expiration_date: string;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
payment_retries_allowed: number;
|
|
87
|
+
application: string;
|
|
88
|
+
integrator_id: null | string;
|
|
89
|
+
shop_id: null | string;
|
|
90
|
+
creation_date: string;
|
|
91
|
+
status: string;
|
|
92
|
+
checkout_url: string;
|
|
93
|
+
payment_attemps: number;
|
|
94
|
+
payment_type: string;
|
|
95
|
+
transactions: Array<{
|
|
96
|
+
store_id: string;
|
|
97
|
+
amount: NaveAmount;
|
|
98
|
+
ranty_id: string;
|
|
99
|
+
installment_plan: {
|
|
100
|
+
is_government_plan: boolean;
|
|
101
|
+
installment_amount: NaveAmount & {
|
|
102
|
+
components: Array<{
|
|
103
|
+
name: string;
|
|
104
|
+
amount: NaveAmount;
|
|
105
|
+
id: number;
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
annual_nominal_rate: number;
|
|
109
|
+
promo_id: null | string;
|
|
110
|
+
total_financial_cost: string;
|
|
111
|
+
installment_plan_type_id: string;
|
|
112
|
+
installments: number;
|
|
113
|
+
total_amount: NaveAmount;
|
|
114
|
+
name: string;
|
|
115
|
+
interest_rate: string;
|
|
116
|
+
installments_plan_gateway_id: string;
|
|
117
|
+
has_interest: boolean;
|
|
118
|
+
id: string;
|
|
119
|
+
original_id: string;
|
|
120
|
+
};
|
|
121
|
+
date_created: number;
|
|
122
|
+
contract: {
|
|
123
|
+
entity_id: string;
|
|
124
|
+
merchant_id: string;
|
|
125
|
+
};
|
|
126
|
+
reconciliation_status_entity: string;
|
|
127
|
+
transaction_type: string;
|
|
128
|
+
auth_data: {
|
|
129
|
+
reason: string;
|
|
130
|
+
code: string;
|
|
131
|
+
auth_id: string;
|
|
132
|
+
acquirer_ref_number: string;
|
|
133
|
+
id: string;
|
|
134
|
+
gateway_code: string;
|
|
135
|
+
gateway_reason: string;
|
|
136
|
+
status: string;
|
|
137
|
+
};
|
|
138
|
+
products: Array<{
|
|
139
|
+
name: string;
|
|
140
|
+
description: string;
|
|
141
|
+
id: string;
|
|
142
|
+
quantity: number;
|
|
143
|
+
unit_price: NaveAmount;
|
|
144
|
+
}>;
|
|
145
|
+
stage: string;
|
|
146
|
+
soft_descriptor: string;
|
|
147
|
+
payment_id: string;
|
|
148
|
+
id: string;
|
|
149
|
+
payment_method: {
|
|
150
|
+
data_privacy: {
|
|
151
|
+
encrypted: {
|
|
152
|
+
data: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
card_holder_name: string;
|
|
156
|
+
bin: string;
|
|
157
|
+
card_holder_doc_type: string;
|
|
158
|
+
type: string;
|
|
159
|
+
expiration_date: string;
|
|
160
|
+
card_type: string;
|
|
161
|
+
expiration_year: string;
|
|
162
|
+
data_privacy_type: string;
|
|
163
|
+
product_id: string;
|
|
164
|
+
expiration_month: string;
|
|
165
|
+
name: string;
|
|
166
|
+
pan: string;
|
|
167
|
+
card_holder_doc_number: string;
|
|
168
|
+
};
|
|
169
|
+
}>;
|
|
95
170
|
additional_info: {
|
|
96
|
-
order_id: string;
|
|
97
171
|
callback_url: string;
|
|
98
172
|
mobile: boolean;
|
|
173
|
+
integration_store_id: string;
|
|
174
|
+
order_id: string;
|
|
99
175
|
platform: string;
|
|
100
176
|
};
|
|
177
|
+
seller: {
|
|
178
|
+
store_id: string;
|
|
179
|
+
country: string;
|
|
180
|
+
fantasy_name: string;
|
|
181
|
+
company_id: string;
|
|
182
|
+
store_data: {
|
|
183
|
+
country: string;
|
|
184
|
+
address: {
|
|
185
|
+
number: string;
|
|
186
|
+
street: string;
|
|
187
|
+
notes: string;
|
|
188
|
+
};
|
|
189
|
+
fantasy_name: string;
|
|
190
|
+
updated_at: string;
|
|
191
|
+
city: string;
|
|
192
|
+
id: string;
|
|
193
|
+
state: string;
|
|
194
|
+
mcc: string;
|
|
195
|
+
zip_code: string;
|
|
196
|
+
};
|
|
197
|
+
city: string;
|
|
198
|
+
owner_data: {
|
|
199
|
+
business_name: string;
|
|
200
|
+
country: string;
|
|
201
|
+
address: {
|
|
202
|
+
number: string;
|
|
203
|
+
street: string;
|
|
204
|
+
notes: string;
|
|
205
|
+
};
|
|
206
|
+
city: string;
|
|
207
|
+
tax_registration_date: string;
|
|
208
|
+
external_id: string;
|
|
209
|
+
zip_code: string;
|
|
210
|
+
tax_id: string;
|
|
211
|
+
updated_at: string;
|
|
212
|
+
tax_id_type: string;
|
|
213
|
+
id: string;
|
|
214
|
+
state: string;
|
|
215
|
+
owner_type: string;
|
|
216
|
+
};
|
|
217
|
+
owner_id: string;
|
|
218
|
+
store_address: {
|
|
219
|
+
zipcode: string;
|
|
220
|
+
country: string;
|
|
221
|
+
street_1: string;
|
|
222
|
+
region: string;
|
|
223
|
+
city: string;
|
|
224
|
+
};
|
|
225
|
+
tax_id: string;
|
|
226
|
+
features_allowed: string[];
|
|
227
|
+
category_id: string;
|
|
228
|
+
branch_id: string;
|
|
229
|
+
user_id: string;
|
|
230
|
+
pos_id: string;
|
|
231
|
+
tax_id_type: string;
|
|
232
|
+
name: string;
|
|
233
|
+
branch_data: {
|
|
234
|
+
country: string;
|
|
235
|
+
address: {
|
|
236
|
+
number: string;
|
|
237
|
+
street: string;
|
|
238
|
+
notes: string;
|
|
239
|
+
};
|
|
240
|
+
city: string;
|
|
241
|
+
name: string;
|
|
242
|
+
id: string;
|
|
243
|
+
state: string;
|
|
244
|
+
zip_code: string;
|
|
245
|
+
};
|
|
246
|
+
onboarding_date: string;
|
|
247
|
+
};
|
|
248
|
+
buyer: {
|
|
249
|
+
user_id: string;
|
|
250
|
+
};
|
|
251
|
+
shipping: null;
|
|
252
|
+
contracts: null;
|
|
253
|
+
fraud_prevention: {
|
|
254
|
+
skip_fraud_service: boolean;
|
|
255
|
+
services: Array<{
|
|
256
|
+
priority: number;
|
|
257
|
+
config_id: string;
|
|
258
|
+
acquirer_id: string;
|
|
259
|
+
service_id: string;
|
|
260
|
+
}>;
|
|
261
|
+
};
|
|
262
|
+
payment_gateway: Array<{
|
|
263
|
+
store_id: string;
|
|
264
|
+
id: string;
|
|
265
|
+
}>;
|
|
266
|
+
qr_data: string;
|
|
267
|
+
amount_type: null;
|
|
268
|
+
payment_inputs: {
|
|
269
|
+
card_on_file: {
|
|
270
|
+
payment_methods: {
|
|
271
|
+
card_payment: {
|
|
272
|
+
gateways: Array<{
|
|
273
|
+
name: string;
|
|
274
|
+
id: string;
|
|
275
|
+
}>;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
manual_input: {
|
|
280
|
+
payment_methods: {
|
|
281
|
+
card_payment: {
|
|
282
|
+
gateways: Array<{
|
|
283
|
+
name: string;
|
|
284
|
+
id: string;
|
|
285
|
+
}>;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
wallet: {
|
|
290
|
+
payment_methods: {
|
|
291
|
+
card_payment: {
|
|
292
|
+
gateways: Array<{
|
|
293
|
+
name: string;
|
|
294
|
+
id: string;
|
|
295
|
+
}>;
|
|
296
|
+
};
|
|
297
|
+
transfer: {
|
|
298
|
+
gateways: Array<{
|
|
299
|
+
name: string;
|
|
300
|
+
id: string;
|
|
301
|
+
}>;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
click_to_pay: {
|
|
306
|
+
payment_methods: {
|
|
307
|
+
card_payment: {
|
|
308
|
+
gateways: Array<{
|
|
309
|
+
name: string;
|
|
310
|
+
id: string;
|
|
311
|
+
}>;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
payment_settings: {
|
|
317
|
+
payment_types: {
|
|
318
|
+
ecommerce: {
|
|
319
|
+
payment_inputs: {
|
|
320
|
+
card_on_file: {
|
|
321
|
+
reason: string;
|
|
322
|
+
payment_methods: {
|
|
323
|
+
card_payment: {
|
|
324
|
+
payment_gateways: {
|
|
325
|
+
sonqo: {
|
|
326
|
+
reason: string;
|
|
327
|
+
status: string;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
reason: string;
|
|
331
|
+
status: string;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
status: string;
|
|
335
|
+
};
|
|
336
|
+
card_not_present: {
|
|
337
|
+
reason: string;
|
|
338
|
+
payment_methods: {
|
|
339
|
+
card_payment: {
|
|
340
|
+
payment_gateways: {
|
|
341
|
+
naranja: {
|
|
342
|
+
reason: string;
|
|
343
|
+
status: string;
|
|
344
|
+
};
|
|
345
|
+
sonqo: {
|
|
346
|
+
reason: string;
|
|
347
|
+
status: string;
|
|
348
|
+
};
|
|
349
|
+
payzen: {
|
|
350
|
+
reason: string;
|
|
351
|
+
status: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
reason: string;
|
|
355
|
+
status: string;
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
status: string;
|
|
359
|
+
};
|
|
360
|
+
manual_input: {
|
|
361
|
+
reason: string;
|
|
362
|
+
payment_methods: {
|
|
363
|
+
card_payment: {
|
|
364
|
+
payment_gateways: {
|
|
365
|
+
naranja: {
|
|
366
|
+
reason: string;
|
|
367
|
+
status: string;
|
|
368
|
+
};
|
|
369
|
+
sonqo: {
|
|
370
|
+
reason: string;
|
|
371
|
+
status: string;
|
|
372
|
+
};
|
|
373
|
+
payzen: {
|
|
374
|
+
reason: string;
|
|
375
|
+
status: string;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
reason: string;
|
|
379
|
+
status: string;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
status: string;
|
|
383
|
+
};
|
|
384
|
+
wallet: {
|
|
385
|
+
reason: string;
|
|
386
|
+
payment_methods: {
|
|
387
|
+
card_payment: {
|
|
388
|
+
payment_gateways: {
|
|
389
|
+
naranja: {
|
|
390
|
+
reason: string;
|
|
391
|
+
status: string;
|
|
392
|
+
};
|
|
393
|
+
sonqo: {
|
|
394
|
+
reason: string;
|
|
395
|
+
status: string;
|
|
396
|
+
};
|
|
397
|
+
payzen: {
|
|
398
|
+
reason: string;
|
|
399
|
+
status: string;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
reason: string;
|
|
403
|
+
status: string;
|
|
404
|
+
};
|
|
405
|
+
transfer: {
|
|
406
|
+
payment_gateways: {
|
|
407
|
+
coelsa: {
|
|
408
|
+
reason: string;
|
|
409
|
+
status: string;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
reason: string;
|
|
413
|
+
status: string;
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
status: string;
|
|
417
|
+
};
|
|
418
|
+
dynamic_qr: {
|
|
419
|
+
reason: string;
|
|
420
|
+
payment_methods: {
|
|
421
|
+
card_payment: {
|
|
422
|
+
payment_gateways: {
|
|
423
|
+
naranja: {
|
|
424
|
+
reason: string;
|
|
425
|
+
status: string;
|
|
426
|
+
};
|
|
427
|
+
sonqo: {
|
|
428
|
+
reason: string;
|
|
429
|
+
status: string;
|
|
430
|
+
};
|
|
431
|
+
payzen: {
|
|
432
|
+
reason: string;
|
|
433
|
+
status: string;
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
reason: string;
|
|
437
|
+
status: string;
|
|
438
|
+
};
|
|
439
|
+
transfer: {
|
|
440
|
+
payment_gateways: {
|
|
441
|
+
coelsa: {
|
|
442
|
+
reason: string;
|
|
443
|
+
status: string;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
reason: string;
|
|
447
|
+
status: string;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
status: string;
|
|
451
|
+
};
|
|
452
|
+
click_to_pay: {
|
|
453
|
+
reason: string;
|
|
454
|
+
payment_methods: {
|
|
455
|
+
card_payment: {
|
|
456
|
+
payment_gateways: {
|
|
457
|
+
sonqo: {
|
|
458
|
+
reason: string;
|
|
459
|
+
status: string;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
reason: string;
|
|
463
|
+
status: string;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
status: string;
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
reason: string;
|
|
470
|
+
status: string;
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
};
|
|
101
474
|
}
|
|
102
475
|
export interface ResponseNaveCancelOrder {
|
|
103
476
|
status: 'CANCELLING';
|
|
104
477
|
message: string;
|
|
105
478
|
}
|
|
479
|
+
export interface NotificationNavePayment {
|
|
480
|
+
payment_id: string;
|
|
481
|
+
payment_check_url: string;
|
|
482
|
+
payment_request_id: string;
|
|
483
|
+
order_id: string;
|
|
484
|
+
status: ResponseNaveGetOrder['status'];
|
|
485
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdk-nave-nodejs",
|
|
3
3
|
"description": "Nave SDK for Node.js",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "commonjs",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"test": "vitest run",
|
|
16
16
|
"build": "tsc",
|
|
17
|
+
"prepack": "yarn clean && yarn build",
|
|
17
18
|
"clean": "rm -rf ./dist/*"
|
|
18
19
|
},
|
|
19
20
|
"author": "Emilio Astarita (https://github.com/emilioastarita/)",
|