@yosle/tropipayjs 0.1.8 → 0.1.10
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/.nvmrc +1 -0
- package/LICENSE +9 -9
- package/README.md +154 -131
- package/api/TropipayAPI.d.ts +93 -0
- package/config/TropipayConfig.d.ts +2 -0
- package/constants/TropipayConstants.d.ts +1 -0
- package/docs/index.MD +18 -18
- package/globals.d.ts +75 -74
- package/hooks/TropipayHooks.d.ts +17 -0
- package/index.d.ts +158 -17
- package/index.js +166 -43
- package/interfaces/index.d.ts +159 -2
- package/package.json +43 -43
- package/rollup.config.js +24 -23
- package/src/api/TropipayAPI.ts +319 -0
- package/src/config/TropipayConfig.ts +2 -0
- package/src/constants/TropipayConstants.ts +1 -0
- package/src/hooks/TropipayHooks.ts +52 -0
- package/src/index.ts +13 -272
- package/src/interfaces/index.js +1 -1
- package/src/interfaces/index.ts +172 -4
- package/src/interfaces/mediation/index.ts +22 -22
- package/src/interfaces/paymentlink/index.d.ts +36 -36
- package/src/interfaces/paymentlink/index.js +2 -2
- package/src/interfaces/paymentlink/index.ts +39 -39
- package/src/utils/TropipayUtils.ts +42 -0
- package/tsconfig.json +95 -95
- package/utils/TropipayUtils.d.ts +17 -0
- package/src/globals.d.ts +0 -74
- package/src/interfaces/countries/index.d.ts +0 -0
- package/src/interfaces/countries/index.js +0 -2
- package/src/interfaces/countries/index.ts +0 -3
- package/src/interfaces/index.d.ts +0 -0
- package/src/interfaces/paymentlink.js +0 -1
package/src/index.ts
CHANGED
|
@@ -1,272 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tropipayjs is a Typescript/Javascript library for the Tropipay API.
|
|
3
|
-
*
|
|
4
|
-
* @author Yosleivy Baez Acosta
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
interface TropipayConfig {
|
|
15
|
-
clientId: string;
|
|
16
|
-
clientSecret: string;
|
|
17
|
-
serverMode?: ServerMode;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class Tropipay {
|
|
21
|
-
protected clientId: string;
|
|
22
|
-
protected clientSecret: string;
|
|
23
|
-
protected request: Axios;
|
|
24
|
-
protected static accessToken: string | undefined;
|
|
25
|
-
protected static refreshToken: string | undefined;
|
|
26
|
-
protected serverMode: ServerMode;
|
|
27
|
-
|
|
28
|
-
constructor(config: TropipayConfig) {
|
|
29
|
-
this.clientId = config.clientId;
|
|
30
|
-
this.clientSecret = config.clientSecret;
|
|
31
|
-
this.serverMode = config.serverMode || 'Development';
|
|
32
|
-
this.request = axios.create({
|
|
33
|
-
baseURL: this.serverMode === 'Production'
|
|
34
|
-
? 'https://www.tropipay.com'
|
|
35
|
-
: 'https://tropipay-dev.herokuapp.com',
|
|
36
|
-
headers: {
|
|
37
|
-
'Content-Type': 'application/json',
|
|
38
|
-
Accept: 'application/json',
|
|
39
|
-
Authorization: `Bearer ${Tropipay.accessToken}`,
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
async login() {
|
|
46
|
-
try {
|
|
47
|
-
const { data } = await this.request.post<LoginResponse>('/api/v2/access/token', {
|
|
48
|
-
client_id: this.clientId,
|
|
49
|
-
client_secret: this.clientSecret,
|
|
50
|
-
grant_type: "client_credentials",
|
|
51
|
-
scope: "ALLOW_GET_PROFILE_DATA ALLOW_PAYMENT_IN ALLOW_EXTERNAL_CHARGE KYC3_FULL_ALLOW ALLOW_PAYMENT_OUT ALLOW_MARKET_PURCHASES ALLOW_GET_BALANCE ALLOW_GET_MOVEMENT_LIST ALLOW_GET_CREDENTIAL"
|
|
52
|
-
}, {
|
|
53
|
-
headers: {
|
|
54
|
-
'Content-Type': 'application/json',
|
|
55
|
-
Accept: 'application/json',
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
Tropipay.accessToken = data.access_token
|
|
60
|
-
Tropipay.refreshToken = data.refresh_token
|
|
61
|
-
return data
|
|
62
|
-
} catch (error) {
|
|
63
|
-
if (axios.isAxiosError(error)) {
|
|
64
|
-
throw new Error(`Could not obtain the access token from credentials ${error}`);
|
|
65
|
-
}
|
|
66
|
-
throw new Error(`Could not obtain the access token from credentials ${error}`);
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Create a paymentLink with the specified options.
|
|
73
|
-
* @param payload PaymentLinkPayload Object.
|
|
74
|
-
* @returns Promise<PaymentLink> or throws an Exception.
|
|
75
|
-
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/b3A6ODgyNTM3OQ-create-a-new-pay-link-charge
|
|
76
|
-
*/
|
|
77
|
-
async createPaymentCard(payload: PaymentLinkPayload): Promise<PaymentLink> {
|
|
78
|
-
if (!Tropipay.accessToken) {
|
|
79
|
-
await this.login()
|
|
80
|
-
}
|
|
81
|
-
try {
|
|
82
|
-
const paylink = await this.request.post('/api/v2/paymentcards', payload, {
|
|
83
|
-
headers: {
|
|
84
|
-
'Content-Type': 'application/json',
|
|
85
|
-
Authorization: `Bearer ${Tropipay.accessToken}`,
|
|
86
|
-
Accept: 'application/json'
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
return paylink.data as PaymentLink
|
|
90
|
-
} catch (error) {
|
|
91
|
-
throw new Error(`Could not obtain the access token with the given credentials.`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get all deposits in this account.
|
|
97
|
-
* @returns A Promise of an Array of AccountDeposits or throws an Exception
|
|
98
|
-
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/b3A6OTgyOTQ1Mg-get-deposit-accounts-list
|
|
99
|
-
*/
|
|
100
|
-
async getDepositAccounts(): Promise<AccountDeposits[] | Error> {
|
|
101
|
-
if (!Tropipay.accessToken) {
|
|
102
|
-
await this.login()
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
const deposits = await this.request.get('/api/v2/deposit_accounts', {
|
|
106
|
-
headers: {
|
|
107
|
-
'Content-Type': 'application/json',
|
|
108
|
-
Authorization: `Bearer ${Tropipay.accessToken}`,
|
|
109
|
-
Accept: 'application/json'
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
return deposits.data
|
|
113
|
-
} catch (error) {
|
|
114
|
-
throw new Error(`Could not retrieve the account deposits ${error}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Get the list of all supported countries by Tropipay.
|
|
120
|
-
* @returns Array of Countries Data
|
|
121
|
-
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/bfac21259e2ff-getting-users-countries-list
|
|
122
|
-
*/
|
|
123
|
-
async countries(): Promise<Country[]> {
|
|
124
|
-
try {
|
|
125
|
-
const countries = await this.request.get('/api/v2/countries')
|
|
126
|
-
return countries.data
|
|
127
|
-
} catch (error) {
|
|
128
|
-
throw new Error(`TropipayJS Error - Could not retrieve the countries list`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Get the list of all detination countries supported by Tropipay.
|
|
134
|
-
* Obtaining the list of valid countries to send funds to. Useful
|
|
135
|
-
* when adding new beneficiaries to some user.
|
|
136
|
-
*
|
|
137
|
-
* @returns Array of Country Objects
|
|
138
|
-
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/3cfe5504f0524-getting-list-of-beneficiary-countries
|
|
139
|
-
*/
|
|
140
|
-
async destinations(): Promise<Country[]> {
|
|
141
|
-
try {
|
|
142
|
-
const countries = await this.request.get('/api/v2/countries/destinations')
|
|
143
|
-
return countries.data
|
|
144
|
-
} catch (error) {
|
|
145
|
-
throw new Error(`Could not retrieve the destination countries list`);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Get list of all the favorites payment links.
|
|
151
|
-
* @returns Array of account Object or throws an error
|
|
152
|
-
*/
|
|
153
|
-
async favorites() {
|
|
154
|
-
if (!Tropipay.accessToken) {
|
|
155
|
-
await this.login()
|
|
156
|
-
}
|
|
157
|
-
try {
|
|
158
|
-
const favoritesList = await this.request.get('/api/v2/paymentcards/favorites', {
|
|
159
|
-
headers: {
|
|
160
|
-
'Content-Type': 'application/json',
|
|
161
|
-
Authorization: `Bearer ${Tropipay.accessToken}`,
|
|
162
|
-
Accept: 'application/json'
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
return favoritesList?.data?.rows
|
|
166
|
-
} catch (error) {
|
|
167
|
-
throw new Error(`Could not retrieve favorites list ${error}`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* List all account movements. You can optionaly specify
|
|
173
|
-
* offset and limit params for pagination.
|
|
174
|
-
* @returns
|
|
175
|
-
*/
|
|
176
|
-
async movements(offset = 0, limit = 10) {
|
|
177
|
-
if (!Tropipay.accessToken) await this.login()
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
const movements = await this.request.get('/api/v2/movements',
|
|
181
|
-
{
|
|
182
|
-
params: { limit: limit, offset: offset },
|
|
183
|
-
headers: {
|
|
184
|
-
'Content-Type': 'application/json',
|
|
185
|
-
Accept: 'application/json',
|
|
186
|
-
Authorization: `Bearer ${Tropipay.accessToken}`
|
|
187
|
-
}
|
|
188
|
-
})
|
|
189
|
-
return movements.data
|
|
190
|
-
} catch (error) {
|
|
191
|
-
throw new Error(`Could not retrieve movements list ${error}`);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Return profile data for this account.
|
|
197
|
-
* @returns
|
|
198
|
-
*/
|
|
199
|
-
async profile() {
|
|
200
|
-
if (!Tropipay.accessToken) await this.login();
|
|
201
|
-
try {
|
|
202
|
-
const profile = await this.request.get('/api/users/profile')
|
|
203
|
-
return profile.data
|
|
204
|
-
} catch (error) {
|
|
205
|
-
throw new Error(`Could not retrieve movements list ${error}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Obtain current Tropipay conversion rate. For example USD to EUR
|
|
211
|
-
* targetCurrency must be 'EUR'
|
|
212
|
-
* @param originCurrency Target currency code supported by Tropipay.
|
|
213
|
-
* @param targetCurrency Must be 'EUR'? (not documented by Tropipay)
|
|
214
|
-
* @returns Conversion rate (number)
|
|
215
|
-
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/85163f6f28b23-get-rate
|
|
216
|
-
*/
|
|
217
|
-
async rates(originCurrency: string, targetCurrency: string = 'EUR'): Promise<number | Error> {
|
|
218
|
-
if (!Tropipay.accessToken) {
|
|
219
|
-
await this.login()
|
|
220
|
-
}
|
|
221
|
-
try {
|
|
222
|
-
const rates = await this.request.post('/api/v2/movements/get_rate',
|
|
223
|
-
{
|
|
224
|
-
currencyFrom: originCurrency,
|
|
225
|
-
currencyTo: targetCurrency
|
|
226
|
-
}, {
|
|
227
|
-
headers: {
|
|
228
|
-
'Content-Type': 'application/json',
|
|
229
|
-
Accept: 'application/json',
|
|
230
|
-
Authorization: `Bearer ${Tropipay.accessToken}`,
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
})
|
|
234
|
-
return rates.data.rate
|
|
235
|
-
} catch (error) {
|
|
236
|
-
throw new Error(`Could not retrieve rates ${error}`);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* (ONLY in Bussiness Accounts)
|
|
243
|
-
* An escrow payment link. This allows a payment to be made to persons
|
|
244
|
-
* belonging or not to the TropiPay platform with the particularity
|
|
245
|
-
* that the payment will be held in custody or retained until it is
|
|
246
|
-
* released with the approval of the payer.
|
|
247
|
-
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/12a128ff971e4-creating-a-mediation-payment-card
|
|
248
|
-
* @param config Payload with the payment details
|
|
249
|
-
*/
|
|
250
|
-
async createMediationPaymentCard(config: mediationPaymentCardConfig): Promise<PaymentLink> {
|
|
251
|
-
if (!Tropipay.accessToken) await this.login();
|
|
252
|
-
try {
|
|
253
|
-
const mediation = await this.request.post('/api/v2/paymentcards/mediation', config, {
|
|
254
|
-
headers: {
|
|
255
|
-
'Content-Type': 'application/json',
|
|
256
|
-
Authorization: `Bearer ${Tropipay.accessToken}`,
|
|
257
|
-
Accept: 'application/json'
|
|
258
|
-
}
|
|
259
|
-
})
|
|
260
|
-
return mediation.data as PaymentLink;
|
|
261
|
-
} catch (error) {
|
|
262
|
-
throw new Error(`Could not generate mediation paymentCard ${error}`);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tropipayjs is a Typescript/Javascript library for the Tropipay API.
|
|
3
|
+
*
|
|
4
|
+
* @author Yosleivy Baez Acosta
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export { Tropipay } from "./api/TropipayAPI";
|
|
8
|
+
export { ClientSideUtils } from "./api/TropipayAPI";
|
|
9
|
+
export { ServerSideUtils } from "./utils/TropipayUtils";
|
|
10
|
+
export { TropipayHooks } from "./hooks/TropipayHooks";
|
|
11
|
+
export * from "./interfaces/index";
|
|
12
|
+
export { SERVER_MODE } from "./config/TropipayConfig";
|
|
13
|
+
export * from "./constants/TropipayConstants";
|
package/src/interfaces/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/src/interfaces/index.ts
CHANGED
|
@@ -1,4 +1,172 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
serverMode?: ServerMode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type TropipayCredentials = { clientId: string; clientSecret: string };
|
|
16
|
+
export type HookEventType =
|
|
17
|
+
| "transaction_completed"
|
|
18
|
+
| "transaction_charged"
|
|
19
|
+
| "transaction_guarded";
|
|
20
|
+
|
|
21
|
+
export type HookTargetType = "web" | "email";
|
|
22
|
+
export interface UserHook {
|
|
23
|
+
event: HookEventType;
|
|
24
|
+
target: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}
|
|
27
|
+
export interface UserHookSubscribed extends UserHook {
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface UserHook {
|
|
33
|
+
event: HookEventType;
|
|
34
|
+
target: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
export interface UserHookSubscribed extends UserHook {
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PaymentLinkPayload {
|
|
43
|
+
reference: string;
|
|
44
|
+
concept: string;
|
|
45
|
+
favorite: boolean;
|
|
46
|
+
amount: number;
|
|
47
|
+
currency: string;
|
|
48
|
+
description: string;
|
|
49
|
+
singleUse: boolean;
|
|
50
|
+
reasonId: number;
|
|
51
|
+
expirationDays: number;
|
|
52
|
+
lang: string;
|
|
53
|
+
urlSuccess: string;
|
|
54
|
+
urlFailed: string;
|
|
55
|
+
urlNotification: string;
|
|
56
|
+
serviceDate: string;
|
|
57
|
+
client: {
|
|
58
|
+
name: string;
|
|
59
|
+
lastName: string;
|
|
60
|
+
address: string;
|
|
61
|
+
phone: string;
|
|
62
|
+
email: string;
|
|
63
|
+
countryId: number;
|
|
64
|
+
termsAndConditions: boolean;
|
|
65
|
+
};
|
|
66
|
+
directPayment: boolean;
|
|
67
|
+
paymentMethods?: string[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface PaymentLink extends PaymentLinkPayload {
|
|
71
|
+
expirationDate: string;
|
|
72
|
+
hasClient: boolean;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
qrImage: string;
|
|
76
|
+
shortUrl: string;
|
|
77
|
+
paymentUrl: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface mediationPaymentCardConfig {
|
|
81
|
+
amount: number;
|
|
82
|
+
currency: "EUR" | "USD";
|
|
83
|
+
concept: string;
|
|
84
|
+
description: string;
|
|
85
|
+
reference: string;
|
|
86
|
+
singleUse: boolean;
|
|
87
|
+
lang: string;
|
|
88
|
+
productUrl?: string;
|
|
89
|
+
buyer: null | any;
|
|
90
|
+
seller: {
|
|
91
|
+
sellerId?: number;
|
|
92
|
+
type?: number;
|
|
93
|
+
email?: string;
|
|
94
|
+
};
|
|
95
|
+
feePercent?: number;
|
|
96
|
+
feeFixed?: number;
|
|
97
|
+
sendMail: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type LoginResponse = {
|
|
101
|
+
access_token: string;
|
|
102
|
+
refresh_token: string;
|
|
103
|
+
token_type: "Bearer";
|
|
104
|
+
expires_in: number;
|
|
105
|
+
scope: string;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type LoginError = {
|
|
109
|
+
error: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type Country = {
|
|
113
|
+
id: number;
|
|
114
|
+
name: string;
|
|
115
|
+
sepaZone: boolean;
|
|
116
|
+
state: number;
|
|
117
|
+
slug: string;
|
|
118
|
+
slugn: number;
|
|
119
|
+
callingCode: number;
|
|
120
|
+
isDestination: boolean;
|
|
121
|
+
isRisky: boolean;
|
|
122
|
+
currentCurrency: string | null;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
isFavorite: boolean;
|
|
126
|
+
position: any;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type Deposit = {
|
|
130
|
+
id: number;
|
|
131
|
+
accountNumber: string;
|
|
132
|
+
alias: string;
|
|
133
|
+
swift: string;
|
|
134
|
+
type: number;
|
|
135
|
+
country: number | null;
|
|
136
|
+
firstName: string;
|
|
137
|
+
default: null;
|
|
138
|
+
state: number;
|
|
139
|
+
userId: string;
|
|
140
|
+
countryDestinationId: number;
|
|
141
|
+
lastName: string;
|
|
142
|
+
documentNumber: number;
|
|
143
|
+
userRelationTypeId: number;
|
|
144
|
+
city: string;
|
|
145
|
+
postalCode: string;
|
|
146
|
+
address: string;
|
|
147
|
+
phone: string;
|
|
148
|
+
checked: boolean;
|
|
149
|
+
province: string;
|
|
150
|
+
beneficiaryType: number;
|
|
151
|
+
relatedUserId: null | string;
|
|
152
|
+
currency: string;
|
|
153
|
+
correspondent?: any;
|
|
154
|
+
location: any;
|
|
155
|
+
office: any;
|
|
156
|
+
officeValue: any;
|
|
157
|
+
paymentType: number;
|
|
158
|
+
paymentEntityBeneficiaryId: number;
|
|
159
|
+
paymentEntityAccountId: number;
|
|
160
|
+
verified: any;
|
|
161
|
+
paymentEntityInfo: any;
|
|
162
|
+
documentTypeId: any;
|
|
163
|
+
documentExpirationDate: Date;
|
|
164
|
+
createdAt: Date;
|
|
165
|
+
updatedAt: Date;
|
|
166
|
+
countryDestination: Country;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export type AccountDeposits = {
|
|
170
|
+
count: number;
|
|
171
|
+
rows: Deposit[];
|
|
172
|
+
};
|
|
@@ -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
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
export interface PaymentLinkPayload {
|
|
3
|
-
reference: string,
|
|
4
|
-
concept: string,
|
|
5
|
-
favorite: boolean,
|
|
6
|
-
amount: number,
|
|
7
|
-
currency: string,
|
|
8
|
-
description : string,
|
|
9
|
-
singleUse: boolean,
|
|
10
|
-
reasonId: number,
|
|
11
|
-
expirationDays: number,
|
|
12
|
-
lang:string,
|
|
13
|
-
urlSuccess: string,
|
|
14
|
-
urlFailed: string,
|
|
15
|
-
urlNotification: string,
|
|
16
|
-
serviceDate: string,
|
|
17
|
-
client: {
|
|
18
|
-
name: string,
|
|
19
|
-
lastName: string,
|
|
20
|
-
address: string,
|
|
21
|
-
phone: string,
|
|
22
|
-
email:string,
|
|
23
|
-
countryId: number,
|
|
24
|
-
termsAndConditions: boolean
|
|
25
|
-
},
|
|
26
|
-
directPayment: boolean
|
|
27
|
-
paymentMethods?:string[]
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface PaymentLink extends PaymentLinkPayload {
|
|
32
|
-
expirationDate: string,
|
|
33
|
-
hasClient:boolean,
|
|
34
|
-
updatedAt:string,
|
|
35
|
-
createdAt: string,
|
|
36
|
-
qrImage: string,
|
|
37
|
-
shortUrl: string,
|
|
38
|
-
paymentUrl: string
|
|
39
|
-
|
|
1
|
+
|
|
2
|
+
export interface PaymentLinkPayload {
|
|
3
|
+
reference: string,
|
|
4
|
+
concept: string,
|
|
5
|
+
favorite: boolean,
|
|
6
|
+
amount: number,
|
|
7
|
+
currency: string,
|
|
8
|
+
description : string,
|
|
9
|
+
singleUse: boolean,
|
|
10
|
+
reasonId: number,
|
|
11
|
+
expirationDays: number,
|
|
12
|
+
lang:string,
|
|
13
|
+
urlSuccess: string,
|
|
14
|
+
urlFailed: string,
|
|
15
|
+
urlNotification: string,
|
|
16
|
+
serviceDate: string,
|
|
17
|
+
client: {
|
|
18
|
+
name: string,
|
|
19
|
+
lastName: string,
|
|
20
|
+
address: string,
|
|
21
|
+
phone: string,
|
|
22
|
+
email:string,
|
|
23
|
+
countryId: number,
|
|
24
|
+
termsAndConditions: boolean
|
|
25
|
+
},
|
|
26
|
+
directPayment: boolean
|
|
27
|
+
paymentMethods?:string[]
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface PaymentLink extends PaymentLinkPayload {
|
|
32
|
+
expirationDate: string,
|
|
33
|
+
hasClient:boolean,
|
|
34
|
+
updatedAt:string,
|
|
35
|
+
createdAt: string,
|
|
36
|
+
qrImage: string,
|
|
37
|
+
shortUrl: string,
|
|
38
|
+
paymentUrl: string
|
|
39
|
+
|
|
40
40
|
}
|