@cloudcommerce/app-mercadopago 0.25.0 → 0.26.0
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/.turbo/turbo-build.log
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-mercadopago",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.26.0",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to integrate Mercado Pago",
|
|
6
6
|
"main": "lib/mercadopago.js",
|
|
7
7
|
"exports": {
|
|
@@ -20,17 +20,19 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/packages/apps/mercadopago#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"axios": "^1.
|
|
23
|
+
"axios": "^1.5.0",
|
|
24
24
|
"firebase-admin": "^11.10.1",
|
|
25
25
|
"firebase-functions": "^4.4.1",
|
|
26
|
-
"@cloudcommerce/api": "0.
|
|
27
|
-
"@cloudcommerce/firebase": "0.
|
|
26
|
+
"@cloudcommerce/api": "0.26.0",
|
|
27
|
+
"@cloudcommerce/firebase": "0.26.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@firebase/app-types": "^0.9.0",
|
|
31
|
-
"@cloudcommerce/
|
|
31
|
+
"@cloudcommerce/test-base": "0.26.0",
|
|
32
|
+
"@cloudcommerce/types": "0.26.0"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
|
-
"build": "bash scripts/build.sh"
|
|
35
|
+
"build": "bash scripts/build.sh",
|
|
36
|
+
"test:e2e": "node --test tests/"
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import test, { before, describe } from 'node:test';
|
|
4
|
+
import {
|
|
5
|
+
modulesUrl,
|
|
6
|
+
bodyListPayments,
|
|
7
|
+
} from '@cloudcommerce/test-base';
|
|
8
|
+
|
|
9
|
+
describe('Test payment list of MercadoPago App', async () => {
|
|
10
|
+
let req;
|
|
11
|
+
let data;
|
|
12
|
+
const appId = 111223;
|
|
13
|
+
|
|
14
|
+
before(async () => {
|
|
15
|
+
req = await fetch(`${modulesUrl}/list_payments?app_id=${appId}`, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: JSON.stringify(bodyListPayments),
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
data = (await req.json()).result;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('Check Status 200', async () => {
|
|
27
|
+
assert.strictEqual(req?.status, 200);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('Check validated is true', async () => {
|
|
31
|
+
assert.equal(data[0].validated, true);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('Have payment gateways', async () => {
|
|
35
|
+
assert.equal(data[0].response.payment_gateways.length > 0, true);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import test, { before, describe } from 'node:test';
|
|
4
|
+
import {
|
|
5
|
+
modulesUrl,
|
|
6
|
+
bodyCreateTransaction,
|
|
7
|
+
} from '@cloudcommerce/test-base';
|
|
8
|
+
|
|
9
|
+
describe('Test to create a transaction in the MercadoPago App with PIX', async () => {
|
|
10
|
+
let req;
|
|
11
|
+
let data;
|
|
12
|
+
const appId = 111223;
|
|
13
|
+
before(async () => {
|
|
14
|
+
const paymentMethod = {
|
|
15
|
+
code: 'account_deposit',
|
|
16
|
+
name: 'Pix - Mercado Pago',
|
|
17
|
+
};
|
|
18
|
+
bodyCreateTransaction.payment_method = paymentMethod;
|
|
19
|
+
|
|
20
|
+
req = await fetch(`${modulesUrl}/create_transaction?app_id=${appId}`, {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
body: JSON.stringify(bodyCreateTransaction),
|
|
23
|
+
headers: {
|
|
24
|
+
'Content-Type': 'application/json',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
data = (await req.json()).result;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('Check Status 200', async () => {
|
|
32
|
+
assert.strictEqual(req?.status, 200);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('Check validated is true', async () => {
|
|
36
|
+
assert.equal(data[0].validated, true);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('Have transaction', async () => {
|
|
40
|
+
assert.notEqual(data[0].response.transaction, undefined);
|
|
41
|
+
});
|
|
42
|
+
});
|