@yosle/tropipayjs 0.1.22 → 0.1.23

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.
@@ -1,70 +1,70 @@
1
- export interface DepositAccountConfig {
2
- searchValue?: string;
3
- alias: string;
4
- userRelationTypeId: number;
5
- beneficiaryType: BeneficiaryType;
6
- searchBy?: number;
7
- accountNumber?: string;
8
- swift?: string;
9
- type: DepositAccountType;
10
- firstName?: string;
11
- lastName?: string;
12
- secondLastName?: string;
13
- countryDestinationId?: number;
14
- city?: string;
15
- postalCode?: number;
16
- address?: string;
17
- documentNumber?: string;
18
- phone?: string;
19
- province?: string;
20
- paymentType?: string;
21
- documentTypeId?: number;
22
- documentExpirationDate: string;
23
- }
24
- type INTERNAL = 1;
25
- type EXTERNAL = 2;
26
-
27
- export type BeneficiaryType = INTERNAL | EXTERNAL;
28
-
29
- export const DepositAccountTypesList = {
30
- /**
31
- * Banco Metropolitano (Cuba) Bank Account
32
- */
33
- BANMET_BANK_ACCOUNT: 0,
34
- /**
35
- * Banco Popular de Ahorro
36
- */
37
- BPA_BANK_ACCOUNT: 1,
38
- /**
39
- * Banco de Credito y Comercio (Cuba) Bank Account
40
- */
41
- BANDEC_BANK_ACCOUNT: 2,
42
- /**
43
- * Banco Metropilitano (Cuba) card
44
- */
45
- BANMET_CARD: 3,
46
- /**
47
- * Banco Popular de Ahorro (Cuba) card
48
- */
49
- BPA_CARD: 4,
50
- /**
51
- * Not available anymore
52
- * @deprecated
53
- */
54
- AIS_CUC_CARD: 5,
55
- /**
56
- * Not available
57
- * @deprecated
58
- */
59
- AIS_USD_CARD: 6,
60
- /**
61
- * For international bank accounts
62
- */
63
- OTHER: 7,
64
- /**
65
- * Banco de Credito y comercio card
66
- */
67
- BANDEC_CARD: 8,
68
- } as const;
69
-
70
- export type DepositAccountType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11;
1
+ export interface DepositAccountConfig {
2
+ searchValue?: string;
3
+ alias: string;
4
+ userRelationTypeId: number;
5
+ beneficiaryType: BeneficiaryType;
6
+ searchBy?: number;
7
+ accountNumber?: string;
8
+ swift?: string;
9
+ type: DepositAccountType;
10
+ firstName?: string;
11
+ lastName?: string;
12
+ secondLastName?: string;
13
+ countryDestinationId?: number;
14
+ city?: string;
15
+ postalCode?: number;
16
+ address?: string;
17
+ documentNumber?: string;
18
+ phone?: string;
19
+ province?: string;
20
+ paymentType?: string;
21
+ documentTypeId?: number;
22
+ documentExpirationDate: string;
23
+ }
24
+ type INTERNAL = 1;
25
+ type EXTERNAL = 2;
26
+
27
+ export type BeneficiaryType = INTERNAL | EXTERNAL;
28
+
29
+ export const DepositAccountTypesList = {
30
+ /**
31
+ * Banco Metropolitano (Cuba) Bank Account
32
+ */
33
+ BANMET_BANK_ACCOUNT: 0,
34
+ /**
35
+ * Banco Popular de Ahorro
36
+ */
37
+ BPA_BANK_ACCOUNT: 1,
38
+ /**
39
+ * Banco de Credito y Comercio (Cuba) Bank Account
40
+ */
41
+ BANDEC_BANK_ACCOUNT: 2,
42
+ /**
43
+ * Banco Metropilitano (Cuba) card
44
+ */
45
+ BANMET_CARD: 3,
46
+ /**
47
+ * Banco Popular de Ahorro (Cuba) card
48
+ */
49
+ BPA_CARD: 4,
50
+ /**
51
+ * Not available anymore
52
+ * @deprecated
53
+ */
54
+ AIS_CUC_CARD: 5,
55
+ /**
56
+ * Not available
57
+ * @deprecated
58
+ */
59
+ AIS_USD_CARD: 6,
60
+ /**
61
+ * For international bank accounts
62
+ */
63
+ OTHER: 7,
64
+ /**
65
+ * Banco de Credito y comercio card
66
+ */
67
+ BANDEC_CARD: 8,
68
+ } as const;
69
+
70
+ export type DepositAccountType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11;
@@ -1,2 +1,2 @@
1
- "use strict";
1
+ "use strict";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,197 +1,201 @@
1
- import { ServerMode } from "../constants/TropipayConstants";
2
-
3
- export type AccountBalance = {
4
- balance: number;
5
- pendingIn: number;
6
- pendingOut: number;
7
- };
8
-
9
- export interface TropipayConfig {
10
- clientId: string;
11
- clientSecret: string;
12
- scopes?: string[];
13
- serverMode?: ServerMode;
14
- }
15
-
16
- export type TropipayCredentials = { clientId: string; clientSecret: string };
17
- export type HookEventType =
18
- | "transaction_completed"
19
- | "transaction_charged"
20
- | "transaction_guarded"
21
- | "user_signup"
22
- | "user_kyc"
23
- | "payment_in_state_change"
24
- | "payment_out_state_change"
25
- | "beneficiary_added"
26
- | "beneficiary_updated"
27
- | "beneficiary_deleted"
28
- | "transaction_new"
29
- | "transaction_preauthorized"
30
- | "transaction_pendingin"
31
- | "transaction_processing"
32
- | "transaction_error"
33
- | "transaction_bloqued"
34
- | "transaction_guarded_send"
35
- | "transaction_guarded_mediation"
36
- | "user_after_update"
37
- | "user_after_create"
38
- | "userDetail_after_create"
39
- | "userDetail_after_update"
40
- | "tpv_callback_ok"
41
- | "fraud_state_on_change";
42
-
43
- export type HookTargetType = "web" | "email";
44
- export interface UserHook {
45
- event: HookEventType;
46
- target: string;
47
- value: string;
48
- }
49
- export interface UserHookSubscribed extends UserHook {
50
- createdAt: string;
51
- updatedAt: string;
52
- }
53
-
54
- export interface UserHook {
55
- event: HookEventType;
56
- target: string;
57
- value: string;
58
- }
59
- export interface UserHookSubscribed extends UserHook {
60
- createdAt: string;
61
- updatedAt: string;
62
- }
63
-
64
- export interface PaymentLinkPayload {
65
- reference: string;
66
- concept: string;
67
- favorite: boolean;
68
- amount: number;
69
- currency: string;
70
- description: string;
71
- singleUse: boolean;
72
- reasonId: number;
73
- expirationDays: number;
74
- lang: string;
75
- urlSuccess: string;
76
- urlFailed: string;
77
- urlNotification: string;
78
- serviceDate: string;
79
- client: {
80
- name: string;
81
- lastName: string;
82
- address: string;
83
- phone: string;
84
- email: string;
85
- countryId?: number;
86
- countryIso?: string;
87
- termsAndConditions: boolean;
88
- } | null;
89
- directPayment: boolean;
90
- paymentMethods?: string[];
91
- imageBase?: string;
92
- saveToken?: boolean;
93
- }
94
-
95
- export interface PaymentLink extends PaymentLinkPayload {
96
- expirationDate: string;
97
- hasClient: boolean;
98
- updatedAt: string;
99
- createdAt: string;
100
- qrImage: string;
101
- shortUrl: string;
102
- paymentUrl: string;
103
- }
104
-
105
- export interface MediationPaymentCardConfig {
106
- amount: number;
107
- currency: "EUR" | "USD";
108
- concept: string;
109
- description: string;
110
- reference: string;
111
- singleUse: boolean;
112
- lang: string;
113
- productUrl?: string;
114
- buyer: null | any;
115
- seller: {
116
- sellerId?: number;
117
- type?: number;
118
- email?: string;
119
- };
120
- feePercent?: number;
121
- feeFixed?: number;
122
- sendMail: boolean;
123
- }
124
-
125
- export type LoginResponse = {
126
- access_token: string;
127
- refresh_token: string;
128
- token_type: "Bearer";
129
- expires_in: number;
130
- scope: string;
131
- };
132
-
133
- export type LoginError = {
134
- error: string;
135
- };
136
-
137
- export type Country = {
138
- id: number;
139
- name: string;
140
- sepaZone: boolean;
141
- state: number;
142
- slug: string;
143
- slugn: number;
144
- callingCode: number;
145
- isDestination: boolean;
146
- isRisky: boolean;
147
- currentCurrency: string | null;
148
- createdAt: string;
149
- updatedAt: string;
150
- isFavorite: boolean;
151
- position: any;
152
- };
153
-
154
- export type Deposit = {
155
- id: number;
156
- accountNumber: string;
157
- alias: string;
158
- swift: string;
159
- type: number;
160
- country: number | null;
161
- firstName: string;
162
- default: null;
163
- state: number;
164
- userId: string;
165
- countryDestinationId: number;
166
- lastName: string;
167
- documentNumber: number;
168
- userRelationTypeId: number;
169
- city: string;
170
- postalCode: string;
171
- address: string;
172
- phone: string;
173
- checked: boolean;
174
- province: string;
175
- beneficiaryType: number;
176
- relatedUserId: null | string;
177
- currency: string;
178
- correspondent?: any;
179
- location: any;
180
- office: any;
181
- officeValue: any;
182
- paymentType: number;
183
- paymentEntityBeneficiaryId: number;
184
- paymentEntityAccountId: number;
185
- verified: any;
186
- paymentEntityInfo: any;
187
- documentTypeId: any;
188
- documentExpirationDate: Date;
189
- createdAt: Date;
190
- updatedAt: Date;
191
- countryDestination: Country;
192
- };
193
-
194
- export type AccountDeposits = {
195
- count: number;
196
- rows: Deposit[];
197
- };
1
+ import { ServerMode } from "../constants/TropipayConstants";
2
+
3
+ export type AccountBalance = {
4
+ balance: number;
5
+ pendingIn: number;
6
+ pendingOut: number;
7
+ };
8
+
9
+ export interface TropipayConfig {
10
+ clientId: string;
11
+ clientSecret: string;
12
+ scopes?: string[];
13
+ serverMode?: ServerMode;
14
+ // Custom tropipay environment for testing
15
+ customTropipayUrl?: string;
16
+ }
17
+
18
+ export type TropipayCredentials = { clientId: string; clientSecret: string };
19
+ export type HookEventType =
20
+ | "transaction_completed"
21
+ | "transaction_charged"
22
+ | "transaction_guarded"
23
+ | "user_signup"
24
+ | "user_kyc"
25
+ | "payment_in_state_change"
26
+ | "payment_out_state_change"
27
+ | "beneficiary_added"
28
+ | "beneficiary_updated"
29
+ | "beneficiary_deleted"
30
+ | "transaction_new"
31
+ | "transaction_preauthorized"
32
+ | "transaction_pendingin"
33
+ | "transaction_processing"
34
+ | "transaction_error"
35
+ | "transaction_bloqued"
36
+ | "transaction_guarded_send"
37
+ | "transaction_guarded_mediation"
38
+ | "user_after_update"
39
+ | "user_after_create"
40
+ | "userDetail_after_create"
41
+ | "userDetail_after_update"
42
+ | "tpv_callback_ok"
43
+ | "fraud_state_on_change";
44
+
45
+ export type HookTargetType = "web" | "email";
46
+ export interface UserHook {
47
+ event: HookEventType;
48
+ target: string;
49
+ value: string;
50
+ }
51
+ export interface UserHookSubscribed extends UserHook {
52
+ createdAt: string;
53
+ updatedAt: string;
54
+ }
55
+
56
+ export interface UserHook {
57
+ event: HookEventType;
58
+ target: string;
59
+ value: string;
60
+ }
61
+ export interface UserHookSubscribed extends UserHook {
62
+ createdAt: string;
63
+ updatedAt: string;
64
+ }
65
+
66
+ export interface PaymentLinkPayload {
67
+ reference: string;
68
+ concept: string;
69
+ favorite: boolean;
70
+ amount: number;
71
+ currency: string;
72
+ description: string;
73
+ singleUse: boolean;
74
+ reasonId: number;
75
+ expirationDays: number;
76
+ lang: string;
77
+ urlSuccess: string;
78
+ urlFailed: string;
79
+ urlNotification: string;
80
+ serviceDate: string;
81
+ client?: {
82
+ name?: string;
83
+ lastName?: string;
84
+ address?: string;
85
+ phone?: string;
86
+ email?: string;
87
+ countryId?: number;
88
+ countryIso?: string;
89
+ city: string;
90
+ postCode: string;
91
+ termsAndConditions: boolean;
92
+ } | null;
93
+ directPayment: boolean;
94
+ paymentMethods?: string[];
95
+ imageBase?: string;
96
+ saveToken?: boolean;
97
+ }
98
+
99
+ export interface PaymentLink extends PaymentLinkPayload {
100
+ expirationDate: string;
101
+ hasClient: boolean;
102
+ updatedAt: string;
103
+ createdAt: string;
104
+ qrImage: string;
105
+ shortUrl: string;
106
+ paymentUrl: string;
107
+ }
108
+
109
+ export interface MediationPaymentCardConfig {
110
+ amount: number;
111
+ currency: "EUR" | "USD";
112
+ concept: string;
113
+ description: string;
114
+ reference: string;
115
+ singleUse: boolean;
116
+ lang: string;
117
+ productUrl?: string;
118
+ buyer: null | any;
119
+ seller: {
120
+ sellerId?: number;
121
+ type?: number;
122
+ email?: string;
123
+ };
124
+ feePercent?: number;
125
+ feeFixed?: number;
126
+ sendMail: boolean;
127
+ }
128
+
129
+ export type LoginResponse = {
130
+ access_token: string;
131
+ refresh_token: string;
132
+ token_type: "Bearer";
133
+ expires_in: number;
134
+ scope: string;
135
+ };
136
+
137
+ export type LoginError = {
138
+ error: string;
139
+ };
140
+
141
+ export type Country = {
142
+ id: number;
143
+ name: string;
144
+ sepaZone: boolean;
145
+ state: number;
146
+ slug: string;
147
+ slugn: number;
148
+ callingCode: number;
149
+ isDestination: boolean;
150
+ isRisky: boolean;
151
+ currentCurrency: string | null;
152
+ createdAt: string;
153
+ updatedAt: string;
154
+ isFavorite: boolean;
155
+ position: any;
156
+ };
157
+
158
+ export type Deposit = {
159
+ id: number;
160
+ accountNumber: string;
161
+ alias: string;
162
+ swift: string;
163
+ type: number;
164
+ country: number | null;
165
+ firstName: string;
166
+ default: null;
167
+ state: number;
168
+ userId: string;
169
+ countryDestinationId: number;
170
+ lastName: string;
171
+ documentNumber: number;
172
+ userRelationTypeId: number;
173
+ city: string;
174
+ postalCode: string;
175
+ address: string;
176
+ phone: string;
177
+ checked: boolean;
178
+ province: string;
179
+ beneficiaryType: number;
180
+ relatedUserId: null | string;
181
+ currency: string;
182
+ correspondent?: any;
183
+ location: any;
184
+ office: any;
185
+ officeValue: any;
186
+ paymentType: number;
187
+ paymentEntityBeneficiaryId: number;
188
+ paymentEntityAccountId: number;
189
+ verified: any;
190
+ paymentEntityInfo: any;
191
+ documentTypeId: any;
192
+ documentExpirationDate: Date;
193
+ createdAt: Date;
194
+ updatedAt: Date;
195
+ countryDestination: Country;
196
+ };
197
+
198
+ export type AccountDeposits = {
199
+ count: number;
200
+ rows: Deposit[];
201
+ };
@@ -1,23 +1,23 @@
1
-
2
- /**
3
- *
4
- */
5
- export interface mediationPaymentCardConfig {
6
- amount: number //5000,
7
- currency: "EUR" | "USD",
8
- concept: string //Celular,
9
- description: string,
10
- reference: string, //458424548,
11
- singleUse: boolean,
12
- lang: string// es,
13
- productUrl?: string,
14
- buyer: null | any //null,
15
- seller: {
16
- sellerId?: number,
17
- type?: number,
18
- email?: string
19
- },
20
- feePercent?: number,//in cents
21
- feeFixed?: number,
22
- sendMail: boolean
1
+
2
+ /**
3
+ *
4
+ */
5
+ export interface mediationPaymentCardConfig {
6
+ amount: number //5000,
7
+ currency: "EUR" | "USD",
8
+ concept: string //Celular,
9
+ description: string,
10
+ reference: string, //458424548,
11
+ singleUse: boolean,
12
+ lang: string// es,
13
+ productUrl?: string,
14
+ buyer: null | any //null,
15
+ seller: {
16
+ sellerId?: number,
17
+ type?: number,
18
+ email?: string
19
+ },
20
+ feePercent?: number,//in cents
21
+ feeFixed?: number,
22
+ sendMail: boolean
23
23
  }
@@ -1,36 +1,36 @@
1
- export interface PaymentLinkPayload {
2
- reference: string;
3
- concept: string;
4
- favorite: boolean;
5
- amount: number;
6
- currency: string;
7
- description: string;
8
- singleUse: boolean;
9
- reasonId: number;
10
- expirationDays: number;
11
- lang: string;
12
- urlSuccess: string;
13
- urlFailed: string;
14
- urlNotification: string;
15
- serviceDate: string;
16
- client: {
17
- name: string;
18
- lastName: string;
19
- address: string;
20
- phone: string;
21
- email: string;
22
- countryId: number;
23
- termsAndConditions: boolean;
24
- };
25
- directPayment: boolean;
26
- paymentMethods?: string[];
27
- }
28
- export interface PaymentLink extends PaymentLinkPayload {
29
- expirationDate: string;
30
- hasClient: boolean;
31
- updatedAt: string;
32
- createdAt: string;
33
- qrImage: string;
34
- shortUrl: string;
35
- paymentUrl: string;
36
- }
1
+ export interface PaymentLinkPayload {
2
+ reference: string;
3
+ concept: string;
4
+ favorite: boolean;
5
+ amount: number;
6
+ currency: string;
7
+ description: string;
8
+ singleUse: boolean;
9
+ reasonId: number;
10
+ expirationDays: number;
11
+ lang: string;
12
+ urlSuccess: string;
13
+ urlFailed: string;
14
+ urlNotification: string;
15
+ serviceDate: string;
16
+ client: {
17
+ name: string;
18
+ lastName: string;
19
+ address: string;
20
+ phone: string;
21
+ email: string;
22
+ countryId: number;
23
+ termsAndConditions: boolean;
24
+ };
25
+ directPayment: boolean;
26
+ paymentMethods?: string[];
27
+ }
28
+ export interface PaymentLink extends PaymentLinkPayload {
29
+ expirationDate: string;
30
+ hasClient: boolean;
31
+ updatedAt: string;
32
+ createdAt: string;
33
+ qrImage: string;
34
+ shortUrl: string;
35
+ paymentUrl: string;
36
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=index.js.map