washday-sdk 1.5.0 → 1.5.2
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/api/index.js
CHANGED
|
@@ -336,7 +336,8 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD') {
|
|
|
336
336
|
getMPUsersStores: integrationsEndpoints.getModule.getMPUsersStores,
|
|
337
337
|
importAllMPTerminals: integrationsEndpoints.postModule.importAllMPTerminals,
|
|
338
338
|
createMPAttempt: integrationsEndpoints.postModule.createMPAttempt,
|
|
339
|
-
cancelMPAttempt: integrationsEndpoints.postModule.cancelMPAttempt
|
|
339
|
+
cancelMPAttempt: integrationsEndpoints.postModule.cancelMPAttempt,
|
|
340
|
+
getMPAttemptStatus: integrationsEndpoints.getModule.getMPAttemptStatus,
|
|
340
341
|
});
|
|
341
342
|
};
|
|
342
343
|
export default WashdayClient;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
const BASE_ROUTER = 'api/integrations';
|
|
11
11
|
const BASE_ROUTER_MP = 'api/mercadopago';
|
|
12
|
+
const BASE_ROUTER_MP_ATTEMPTS = 'api/payments/mp/attempts';
|
|
12
13
|
export const getMPConnectionStatus = function () {
|
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
15
|
try {
|
|
@@ -61,3 +62,16 @@ export const getMPUsersStores = function (_a) {
|
|
|
61
62
|
}
|
|
62
63
|
});
|
|
63
64
|
};
|
|
65
|
+
export const getMPAttemptStatus = function (_a) {
|
|
66
|
+
return __awaiter(this, arguments, void 0, function* ({ attemptId }) {
|
|
67
|
+
try {
|
|
68
|
+
const config = {
|
|
69
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
70
|
+
};
|
|
71
|
+
return yield this.axiosInstance.get(`${BASE_ROUTER_MP_ATTEMPTS}/${attemptId}/status`, config);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
};
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
const BASE_ROUTER = 'api/integrations';
|
|
11
|
-
const BASE_ROUTER_MP_ATTEMPTS = 'api/
|
|
11
|
+
const BASE_ROUTER_MP_ATTEMPTS = 'api/payments/mp/attempts';
|
|
12
12
|
export const startMPOAuthFlow = function (data) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
try {
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -343,7 +343,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
343
343
|
getMPUsersStores: integrationsEndpoints.getModule.getMPUsersStores,
|
|
344
344
|
importAllMPTerminals: integrationsEndpoints.postModule.importAllMPTerminals,
|
|
345
345
|
createMPAttempt: integrationsEndpoints.postModule.createMPAttempt,
|
|
346
|
-
cancelMPAttempt: integrationsEndpoints.postModule.cancelMPAttempt
|
|
346
|
+
cancelMPAttempt: integrationsEndpoints.postModule.cancelMPAttempt,
|
|
347
|
+
getMPAttemptStatus: integrationsEndpoints.getModule.getMPAttemptStatus,
|
|
347
348
|
});
|
|
348
349
|
} as any;
|
|
349
350
|
|
|
@@ -2,6 +2,7 @@ import { WashdayClientInstance } from "../../interfaces/Api";
|
|
|
2
2
|
|
|
3
3
|
const BASE_ROUTER = 'api/integrations';
|
|
4
4
|
const BASE_ROUTER_MP = 'api/mercadopago';
|
|
5
|
+
const BASE_ROUTER_MP_ATTEMPTS = 'api/payments/mp/attempts';
|
|
5
6
|
|
|
6
7
|
export const getMPConnectionStatus = async function (this: WashdayClientInstance): Promise<any> {
|
|
7
8
|
try {
|
|
@@ -62,4 +63,20 @@ export const getMPUsersStores = async function (this: WashdayClientInstance, {
|
|
|
62
63
|
catch (error) {
|
|
63
64
|
throw error;
|
|
64
65
|
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const getMPAttemptStatus = async function (this: WashdayClientInstance, {
|
|
69
|
+
attemptId
|
|
70
|
+
}: {
|
|
71
|
+
attemptId: string;
|
|
72
|
+
}): Promise<any> {
|
|
73
|
+
try {
|
|
74
|
+
const config = {
|
|
75
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
76
|
+
};
|
|
77
|
+
return await this.axiosInstance.get(`${BASE_ROUTER_MP_ATTEMPTS}/${attemptId}/status`, config);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
65
82
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
|
|
3
3
|
const BASE_ROUTER = 'api/integrations';
|
|
4
|
-
const BASE_ROUTER_MP_ATTEMPTS = 'api/
|
|
4
|
+
const BASE_ROUTER_MP_ATTEMPTS = 'api/payments/mp/attempts';
|
|
5
5
|
|
|
6
6
|
export const startMPOAuthFlow = async function (this: WashdayClientInstance, data: {
|
|
7
7
|
redirectUri: string;
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -326,6 +326,7 @@ export interface WashdayClientInstance {
|
|
|
326
326
|
importAllMPTerminals: typeof integrationsEndpoints.postModule.importAllMPTerminals;
|
|
327
327
|
createMPAttempt: typeof integrationsEndpoints.postModule.createMPAttempt;
|
|
328
328
|
cancelMPAttempt: typeof integrationsEndpoints.postModule.cancelMPAttempt;
|
|
329
|
+
getMPAttemptStatus: typeof integrationsEndpoints.getModule.getMPAttemptStatus;
|
|
329
330
|
}
|
|
330
331
|
};
|
|
331
332
|
}
|