@cloudcommerce/app-pagarme-v5 2.12.0 → 2.12.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.
|
@@ -2,5 +2,5 @@ import '@cloudcommerce/firebase/lib/init';
|
|
|
2
2
|
import * as functions from 'firebase-functions/v1';
|
|
3
3
|
export declare const pagarmev5: {
|
|
4
4
|
onStoreEvent: functions.CloudFunction<functions.pubsub.Message>;
|
|
5
|
-
|
|
5
|
+
webhook: functions.HttpsFunction;
|
|
6
6
|
};
|
package/lib/pagarme-v5-events.js
CHANGED
|
@@ -4,11 +4,11 @@ import * as functions from 'firebase-functions/v1';
|
|
|
4
4
|
import config from '@cloudcommerce/firebase/lib/config';
|
|
5
5
|
import { createAppEventsFunction } from '@cloudcommerce/firebase/lib/helpers/pubsub';
|
|
6
6
|
import handleApiEvent from '../lib-mjs/events-to-pagarme5.mjs';
|
|
7
|
-
import handlePagarmeV5Webhook from '../lib-mjs/pagarme5-
|
|
7
|
+
import handlePagarmeV5Webhook from '../lib-mjs/pagarme5-webhook.mjs';
|
|
8
8
|
|
|
9
9
|
export const pagarmev5 = {
|
|
10
10
|
onStoreEvent: createAppEventsFunction('pagarMeV5', handleApiEvent),
|
|
11
|
-
|
|
11
|
+
webhook: functions
|
|
12
12
|
.region(config.get().httpsFunctionOptions.region)
|
|
13
13
|
.https.onRequest((req, res) => {
|
|
14
14
|
if (req.method !== 'POST') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagarme-v5-events.js","sourceRoot":"","sources":["../src/pagarme-v5-events.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,EACL,uBAAuB,GAExB,MAAM,4CAA4C,CAAC;AACpD,OAAO,cAAc,MAAM,mCAAmC,CAAC;AAC/D,OAAO,sBAAsB,MAAM,
|
|
1
|
+
{"version":3,"file":"pagarme-v5-events.js","sourceRoot":"","sources":["../src/pagarme-v5-events.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,EACL,uBAAuB,GAExB,MAAM,4CAA4C,CAAC;AACpD,OAAO,cAAc,MAAM,mCAAmC,CAAC;AAC/D,OAAO,sBAAsB,MAAM,iCAAiC,CAAC;AAErE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,YAAY,EAAE,uBAAuB,CACnC,WAAW,EACX,cAAiC,CAClC;IACD,OAAO,EAAE,SAAS;SACf,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,MAAM,CAAC;SAChD,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC5B,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC1B,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnC,CAAC;IACH,CAAC,CAAC;CACL,CAAC"}
|
|
@@ -51,7 +51,6 @@ const handleWehook = async (req, res) => {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
const pagarmeAxios = axios(process.env.PAGARMEV5_API_TOKEN);
|
|
54
|
-
logger.log(`>> webhook ${JSON.stringify(body)}, type:${type}`);
|
|
55
54
|
if (type === 'subscription.created' && body.data) {
|
|
56
55
|
const orderOriginalId = body.data?.code;
|
|
57
56
|
const subscriptionPagarmeId = body.data?.id;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-pagarme-v5",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.12.
|
|
4
|
+
"version": "2.12.2",
|
|
5
5
|
"description": "e-com.plus Cloud Commerce app to integrate Pagar.me API v5 with recurring payments",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"axios": "^1.6.8",
|
|
32
32
|
"firebase-admin": "^12.0.0",
|
|
33
33
|
"firebase-functions": "^4.8.2",
|
|
34
|
-
"@cloudcommerce/api": "2.12.
|
|
35
|
-
"@cloudcommerce/firebase": "2.12.
|
|
34
|
+
"@cloudcommerce/api": "2.12.2",
|
|
35
|
+
"@cloudcommerce/firebase": "2.12.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@cloudcommerce/test-base": "2.12.
|
|
39
|
-
"@cloudcommerce/types": "2.12.
|
|
38
|
+
"@cloudcommerce/test-base": "2.12.2",
|
|
39
|
+
"@cloudcommerce/types": "2.12.2"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "bash scripts/build.sh",
|