ng-easycommerce 0.0.409 → 0.0.412

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.
Files changed (40) hide show
  1. package/README.md +22 -2
  2. package/assets/decidirFormEc.html +56 -45
  3. package/assets/images/cards-occasional.png +0 -0
  4. package/assets/recaptcha/recaptcha-site-keys.json +4 -0
  5. package/assets/recaptcha/recaptcha-sites.json +51 -0
  6. package/bundles/ng-easycommerce.umd.js +234 -68
  7. package/bundles/ng-easycommerce.umd.js.map +1 -1
  8. package/bundles/ng-easycommerce.umd.min.js +1 -1
  9. package/bundles/ng-easycommerce.umd.min.js.map +1 -1
  10. package/esm2015/lib/ec-component/index.js +5 -2
  11. package/esm2015/lib/ec-component/related-products-ec/related-products-ec.component.js +17 -3
  12. package/esm2015/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.js +7 -4
  13. package/esm2015/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.js +1 -1
  14. package/esm2015/lib/ec-component/widgets-ec/re-captcha-ec/re-captcha-ec.component.js +50 -0
  15. package/esm2015/lib/ng-easycommerce.module.js +3 -1
  16. package/esm2015/lib/services/captcha.service.js +104 -0
  17. package/esm2015/ng-easycommerce.js +19 -18
  18. package/esm2015/public-api.js +2 -1
  19. package/esm5/lib/ec-component/index.js +5 -2
  20. package/esm5/lib/ec-component/related-products-ec/related-products-ec.component.js +17 -3
  21. package/esm5/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.js +7 -4
  22. package/esm5/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.js +1 -1
  23. package/esm5/lib/ec-component/widgets-ec/re-captcha-ec/re-captcha-ec.component.js +53 -0
  24. package/esm5/lib/ng-easycommerce.module.js +3 -1
  25. package/esm5/lib/services/captcha.service.js +106 -0
  26. package/esm5/ng-easycommerce.js +19 -18
  27. package/esm5/public-api.js +2 -1
  28. package/fesm2015/ng-easycommerce.js +211 -52
  29. package/fesm2015/ng-easycommerce.js.map +1 -1
  30. package/fesm5/ng-easycommerce.js +217 -53
  31. package/fesm5/ng-easycommerce.js.map +1 -1
  32. package/lib/ec-component/index.d.ts +1 -0
  33. package/lib/ec-component/related-products-ec/related-products-ec.component.d.ts +3 -1
  34. package/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.d.ts +3 -1
  35. package/lib/ec-component/widgets-ec/re-captcha-ec/re-captcha-ec.component.d.ts +24 -0
  36. package/lib/services/captcha.service.d.ts +62 -0
  37. package/ng-easycommerce.d.ts +18 -17
  38. package/ng-easycommerce.metadata.json +1 -1
  39. package/package.json +1 -1
  40. package/public-api.d.ts +1 -0
package/README.md CHANGED
@@ -1,12 +1,32 @@
1
1
  # Ultimas Modificaciones
2
2
 
3
+ ### version: 0.0.412
4
+
5
+ - Se creo el componente 're-captcha-ec' para poder ampliar el uso del re-captcha
6
+ --Ejemplo de uso:
7
+ <re-captcha-ec [form]="contact_form"></re-captcha-ec>
8
+ form: recibe el formulario que contiene el recaptcha
9
+ (opcional)siteKey: recibe la clave (string) que usa el recaptcha.
10
+
11
+ - Ajustes componentes medio de pago Decidir.
12
+
13
+ ### version: 0.0.411
14
+
15
+ - Ajustes componentes medio de pago Decidir.
16
+
17
+ - Productos relacionados y variantes color por product related reactivo.
18
+
19
+ ### version: 0.0.410
20
+
21
+ - Minor fix en component redirect.
22
+
3
23
  ### version: 0.0.409
4
24
 
5
25
  - Se agregan control en CartService para no agregar productos en carros de usuarios "no compradores".
6
26
 
7
27
  - Se agrega guarda para controlar acceso a usuarios con "compradores".
8
28
 
9
- - Se agrega guarda para controlar acceso segun rol de usuario (raw - espera string[])
29
+ - Se agrega guarda para controlar acceso segun rol de usuario (raw - espera string[]).
10
30
 
11
31
  - Actulizacion de los diccionarios ec-i18n.
12
32
 
@@ -112,7 +132,7 @@
112
132
  --Ejemplo de uso:
113
133
  <div app-magnizoom-ec
114
134
  zoomMode="COVER"
115
- [imageSrc]="consts.mediaUrl() + picture"
135
+ [ImageSrc]="consts.mediaUrl() + picture"
116
136
  [imageStyle]="{'width': '470px', 'height': '470px'}"
117
137
  [imageClass]="'prueba'">
118
138
  </div>
@@ -8,14 +8,11 @@
8
8
  integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
9
9
  <title>Decidir</title>
10
10
 
11
- <!-- <script src="https://live.decidir.com/static/v2.5/decidir.js"></script> -->
12
-
13
11
  <script defer>
14
12
 
15
13
  const dataDecidirHead = localStorage.getItem('dataDecidir')
16
14
  && JSON.parse(localStorage.getItem('dataDecidir'))
17
15
 
18
-
19
16
  console.log("dataDecidirHead", dataDecidirHead);
20
17
  console.log("dataDecidirHead.config", dataDecidirHead.config);
21
18
  console.log("dataDecidirHead.config.public_environment", dataDecidirHead.config.public_environment);
@@ -48,6 +45,11 @@
48
45
  <body>
49
46
 
50
47
  <style>
48
+ .logo-pago-seguro-img {
49
+ /* width: 150px;
50
+ height: 48px; */
51
+ }
52
+
51
53
  .loader {
52
54
  border: 16px solid #f3f3f3;
53
55
  border-top: 16px solid #dc3545;
@@ -84,12 +86,18 @@
84
86
  <div class="row mt-3">
85
87
  <div class="col-12">
86
88
  <div class="card">
87
- <div class="w-100 text-center">
88
- <img src="../assets/images/decidir-logo.png" class="card-img-top w-50" alt="...">
89
+
90
+ <div class="container-fluid mt-3">
91
+ <div class="row">
92
+ <div class="col-md-6 col-12">
93
+ <!-- <h5><b>Decidir</b></h5> -->
94
+ </div>
95
+ <div class="col-md-6 col-12">
96
+ <img src="../assets/images/cards-occasional.png" class="card-img-top" alt="...">
97
+ </div>
98
+ </div>
89
99
  </div>
90
100
  <div class="card-body">
91
- <!-- <h5 class="card-title">Decidir</h5> -->
92
- <!-- <p class="card-text">Ingrese sus datos para continuar con el pago.</p> -->
93
101
  <form action="" method="post" id="formulario">
94
102
  <fieldset>
95
103
 
@@ -98,7 +106,7 @@
98
106
 
99
107
  <div class="form-floating mb-3">
100
108
  <input class="form-control" type="text" data-decidir="card_number"
101
- placeholder="XXXXXXXXXXXXXXXX" maxlength="16" value=""
109
+ placeholder="XXXXXXXXXXXXXXXX" maxlength="18" value=""
102
110
  oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');">
103
111
  <label for="card_number">Numero de tarjeta:</label>
104
112
  </div>
@@ -108,7 +116,7 @@
108
116
 
109
117
  <div class="form-floating mb-3">
110
118
  <input class="form-control" type="text" data-decidir="security_code"
111
- placeholder="XXX" maxlength="3" value=""
119
+ placeholder="XXX" maxlength="4" value=""
112
120
  oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" />
113
121
  <label for="security_code">Codigo de seguridad:</label>
114
122
  </div>
@@ -161,8 +169,9 @@
161
169
 
162
170
  <div class="w-100 text-center">
163
171
  <div id="loadTokenBtn">
164
- <input type="submit" value="Generar Token"
165
- class="btn btn-outline-success mt-3" />
172
+ <div class="d-grid gap-2">
173
+ <input type="submit" value="Pagar" class="btn btn-outline-success mt-3" />
174
+ </div>
166
175
  </div>
167
176
  <div id="loadToken" class="text-center mt-4">
168
177
  <div class="spinner-border" role="status">
@@ -173,6 +182,12 @@
173
182
  </fieldset>
174
183
  </form>
175
184
  </div>
185
+ <div class="w-100 d-flex justify-content-end">
186
+ <div class="w-50 d-flex justify-content-end">
187
+ <img src="../assets/images/decidir-logo.png"
188
+ class="card-img-top w-50 logo-pago-seguro-img " alt="...">
189
+ </div>
190
+ </div>
176
191
  </div>
177
192
 
178
193
  </div>
@@ -209,62 +224,58 @@
209
224
  && JSON.parse(localStorage.getItem('dataDecidir'))
210
225
 
211
226
  const publicApiKey = dataDecidir?.config?.public_key
212
- const cybersource = dataDecidir?.config?.public_cybersource || true
227
+ let cybersource = dataDecidir?.config?.public_cybersource && dataDecidir?.config?.public_cybersource == 'deshabilitado'
213
228
  let modo = dataDecidir?.config?.public_environment || null
214
229
 
215
230
  modo && (modo == 'prod' && (modo = false) || modo == 'test' && (modo = true))
216
231
  !modo && (modo = window.location.host.includes('easycommerce'))
217
232
 
218
- console.log(modo);
233
+ !cybersource && (cybersource = true)
219
234
 
220
235
  const decidir = new Decidir(modo && urlSandbox || urlProduccion, cybersource);
221
236
  decidir.setPublishableKey(publicApiKey);
222
237
  decidir.setTimeout(5000);
223
238
 
224
- console.log("decidir", decidir);
225
-
226
239
  let form = document.querySelector('#formulario');
227
240
 
228
241
  const sendToken = (data) => {
229
-
230
- fetch(dataRedirect, {
231
- method: 'POST',
232
- body: JSON.stringify(data),
233
- headers: {
234
- 'Content-Type': 'application/json'
235
- }
236
- }).then(res => res.json())
237
- .catch(error => {
238
- console.error('Error:', error)
239
- processError(response)
240
- })
241
- .then(response => {
242
- console.log('Success:', response)
243
- if (response.hasOwnProperty('status')) {
244
- if (response.status == 'success') {
245
- processResponse(response)
242
+ try {
243
+ fetch(dataRedirect, {
244
+ method: 'POST',
245
+ body: JSON.stringify(data),
246
+ headers: {
247
+ 'Content-Type': 'application/json'
248
+ }
249
+ }).then(res => res.json())
250
+ .catch(error => {
251
+ console.error('Error:', error)
252
+ processError(response)
253
+ })
254
+ .then(response => {
255
+ console.log('Success:', response)
256
+ if (response.hasOwnProperty('status')) {
257
+ if (response.status == 'approved') {
258
+ processResponse(response)
259
+ } else {
260
+ processError(response)
261
+ }
246
262
  } else {
247
- processError(response)
263
+ processResponse(response)
248
264
  }
249
- } else {
250
- processResponse(response)
251
- }
252
- });
265
+ });
266
+ } catch (error) {
267
+ processError(response)
268
+ }
253
269
  localStorage.removeItem('dataRedirect')
254
270
  localStorage.removeItem('dataDecidir')
255
271
  }
256
272
 
257
273
  const getAsBin = (data) => {
258
- // console.log('validateCreditCardNumber',decidir.validateCreditCardNumber(decidir.collectFormData(form).card_number));
259
- // console.log('cardType',decidir.cardType(decidir.collectFormData(form).card_number));
260
- // console.log('collectFormData', decidir.collectFormData(form));
261
- // console.log('getBin',JSON.stringify(decidir.getBin(decidir.collectFormData(form))));
262
- // console.log('getHttp',decidir.getHttp(form));
263
274
  mp.getPaymentMethods({ bin: data.bin }).then(
264
- t => {
275
+ t => {
265
276
  let resultmp = t.results[0]
266
- let asBin = { tipo_tarjeta_decidir: decidir.cardType(decidir.collectFormData(form).card_number) ,as_bin: resultmp.id , issuer: resultmp.issuer.name , name:resultmp.name , payment_type: resultmp.payment_type_id ,resultmp }
267
- sendToken({ ...data , ...asBin})
277
+ let asBin = { tipo_tarjeta_decidir: decidir.cardType(decidir.collectFormData(form).card_number), as_bin: resultmp.id, issuer: resultmp.issuer.name, name: resultmp.name, payment_type: resultmp.payment_type_id, resultmp }
278
+ sendToken({ ...data, ...asBin })
268
279
  }
269
280
  )
270
281
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "tanda_1": "6LcPPbUZAAAAAB8tKJ-UozPs1PztvGTEXnC26aY3",
3
+ "tanda_2": "6Lc158seAAAAAEMe3SmWstPaZ4GudBjxCc1BIgGX"
4
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "eq.easycommercetech.com": "tanda_1",
3
+ "myc.easycommercetech.tienda": "tanda_1",
4
+ "chispa.easycommercetech.com": "tanda_1",
5
+ "tekcenter.easycommercetech.com": "tanda_1",
6
+ "doshermanos.easycommercetech.com": "tanda_1",
7
+ "adctecnologia.easycommercetech.com": "tanda_1",
8
+ "pbg.easycommercetech.com": "tanda_1",
9
+ "elden.easycommercetech.com": "tanda_1",
10
+ "elden.com": "tanda_1",
11
+ "ags.easycommercetech.tienda": "tanda_1",
12
+ "smeg.easycommercetech.com": "tanda_1",
13
+ "smeg.com.ar": "tanda_1",
14
+ "promesse.easycommercetech.com": "tanda_1",
15
+ "andresgourmetseleccion.es": "tanda_1",
16
+ "d2dcor.easycommercetech.tienda": "tanda_1",
17
+ "vinals.easycommercetech.tienda": "tanda_1",
18
+ "d2dcor.com": "tanda_1",
19
+ "promesse.com.ar": "tanda_1",
20
+ "scorpiostore.easycommercetech.com": "tanda_1",
21
+ "almacendelmolino.easycommercetech.com": "tanda_1",
22
+ "maxifarma.easycommercetech.com": "tanda_1",
23
+ "guolis.easycommercetech.com": "tanda_1",
24
+ "lapequeteria.easycommercetech.com": "tanda_1",
25
+ "farmasun.easycommercetech.com": "tanda_1",
26
+ "almacendelmolino.com.ar": "tanda_1",
27
+ "womanbypromesse.com.ar": "tanda_1",
28
+ "womanbypromesse.easycommercetech.com": "tanda_1",
29
+ "promessemayorista.com.ar": "tanda_1",
30
+ "promessemayorista.easycommercetech.com": "tanda_1",
31
+ "outmall.easycommercetech.com": "tanda_1",
32
+ "opositoresinvencibles.easycommercetech.tienda": "tanda_1",
33
+ "outmall.com.ar": "tanda_1",
34
+ "profesionales.myc-homelinens.com": "tanda_1",
35
+ "opositoresinvencibles.com": "tanda_1",
36
+ "seler.easycommercetech.tienda": "tanda_1",
37
+ "myc-homelinens.com": "tanda_1",
38
+ "converse.easycommercetech.com": "tanda_1",
39
+ "vinals.es": "tanda_1",
40
+ "id.easycommercetech.com": "tanda_1",
41
+ "guolis.com.ar": "tanda_1",
42
+ "b2b.vidal-vidal.com": "tanda_1",
43
+ "lasoreiro.easycommercetech.com": "tanda_1",
44
+ "lapequeteria.com": "tanda_1",
45
+ "eldenv2.easycommercetech.com": "tanda_1",
46
+ "vidalvidal.easycommercetech.tienda": "tanda_1",
47
+ "estacioncentral.easycommercetech.com": "tanda_1",
48
+ "www.estacioncentral.com.ar": "tanda_1",
49
+ "cuidex.easycommercetech.com": "tanda_1",
50
+ "sherman.easycommercetech.com": "tanda_1"
51
+ }