@cloudcommerce/app-mercadopago 2.22.0 → 2.23.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
window.Mercadopago.getIdentificationTypes(),window._mpHash=function(t){return new Promise((o,e)=>{window._mpBrand(t.number).then(()=>{return c=t,new Promise((n,o)=>{var e,t,r,a=window.storefrontApp
|
|
1
|
+
window.Mercadopago.getIdentificationTypes(),window._mpHash=function(t){return new Promise((o,e)=>{window._mpBrand(t.number).then(()=>{return c=t,new Promise((n,o)=>{var e,t,r,a=window.storefrontApp.customer,i={},d=(i.cardNumber=c.number,i.cardholderName=c.name,i.cardExpirationMonth=c.month,i.cardExpirationYear=c.year,i.securityCode=c.cvc,i.docNumber=c.doc||a.doc_number,i.email=a.main_email,i.payment_method_id=window.mpPaymentMethodId,document.createElement("form"));for(e in i)i[e]&&(t=i[e],(r=document.createElement("input")).setAttribute("type","text"),r.setAttribute("id",e),r.setAttribute("data-checkout",e),r.setAttribute("value",t),d.appendChild(r));var m=document.createElement("select"),s=(m.setAttribute("data-checkout","docType"),document.createElement("option"));s.text="j"===a.registry_type?"CNPJ":"CPF",s.value="j"===a.registry_type?"CNPJ":"CPF",s.setAttribute("selected",!0),m.add(s),d.appendChild(m),window.Mercadopago.createToken(d,(e,t)=>{(200===e?n:o)(t)})});var c}).then(n=>{window.Mercadopago.getIssuers(window.mpPaymentMethodId,(e,t)=>{console.log(t);t=n.id+" // "+JSON.stringify({payment_method_id:window.mpPaymentMethodId,issuer:t,deviceId:window.MP_DEVICE_SESSION_ID||0});return o(t)})}).catch(e)})},window._mpInstallments=function(t){return new Promise((r,a)=>{window._mpBrand(t.number).then(e=>{e={payment_method_id:e,amount:t.amount};return window.Mercadopago.getInstallments(e,(e,t)=>{if(200===e){var n=[];for(let e=0;e<t[0].payer_costs.length;e++){var o=t[0].payer_costs[e];n.push({number:o.installments,tax:0<o.installment_rate,value:o.installment_amount})}r(n)}else console.log("installments method info error:",response),a(response)})}).catch(a)})},window._mpBrand=function(t){return new Promise((n,o)=>{let e=String(t);if(6<=(e=e.substring(0,6)).length)return window.Mercadopago.getPaymentMethod({bin:e},(e,t)=>{200===e?(window.mpPaymentMethodId=t[0].id,n(t[0].id)):(console.log("payment method info error:",t),o(t))});o(new Error("Failed trying installments with card number yet imcomplete"))})};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-mercadopago",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.23.0",
|
|
5
5
|
"description": "e-com.plus Cloud Commerce app to integrate Mercado Pago",
|
|
6
6
|
"main": "lib/mercadopago.js",
|
|
7
7
|
"exports": {
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/packages/apps/mercadopago#readme",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"axios": "^1.7.2",
|
|
31
|
-
"firebase-admin": "^12.
|
|
31
|
+
"firebase-admin": "^12.3.0",
|
|
32
32
|
"firebase-functions": "^5.0.1",
|
|
33
|
-
"@cloudcommerce/api": "2.
|
|
34
|
-
"@cloudcommerce/firebase": "2.
|
|
33
|
+
"@cloudcommerce/api": "2.23.0",
|
|
34
|
+
"@cloudcommerce/firebase": "2.23.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@firebase/app-types": "^0.9.2",
|
|
38
|
-
"@cloudcommerce/
|
|
39
|
-
"@cloudcommerce/
|
|
38
|
+
"@cloudcommerce/types": "2.23.0",
|
|
39
|
+
"@cloudcommerce/test-base": "2.23.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "bash scripts/build.sh",
|