ng-easycommerce 0.0.400 → 0.0.403
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/README.md +14 -0
- package/assets/decidirFormEc.html +238 -0
- package/assets/images/decidir-logo.png +0 -0
- package/bundles/ng-easycommerce.umd.js +211 -38
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/ec-component/checkout-ec/payment-ec/payment-ec.component.js +3 -2
- package/esm2015/lib/ec-component/index.js +4 -1
- package/esm2015/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.js +12 -3
- package/esm2015/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.js +153 -0
- package/esm2015/public-api.js +2 -1
- package/esm5/lib/ec-component/checkout-ec/payment-ec/payment-ec.component.js +3 -2
- package/esm5/lib/ec-component/index.js +4 -1
- package/esm5/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.js +14 -3
- package/esm5/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.js +169 -0
- package/esm5/public-api.js +2 -1
- package/fesm2015/ng-easycommerce.js +193 -39
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +211 -39
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/checkout-ec/payment-ec/payment-ec.component.d.ts +1 -0
- package/lib/ec-component/index.d.ts +1 -0
- package/lib/ec-component/seller-dashboard-container-ec/seller-dashboard-container-ec.component.d.ts +3 -0
- package/lib/ec-component/widgets-ec/decidir-ec/decidir-ec.component.d.ts +47 -0
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
package/README.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Ultimas Modificaciones
|
|
2
2
|
|
|
3
|
+
### version: 0.0.403
|
|
4
|
+
|
|
5
|
+
- Ajustes en parametros y navegacion componente Decidir
|
|
6
|
+
|
|
7
|
+
### version: 0.0.402
|
|
8
|
+
|
|
9
|
+
- Cambios en la parametrización de la UI del componente SellerDashboardContainer
|
|
10
|
+
|
|
11
|
+
- Se agregaron mejoras en componente de método de pago Decidir, se agregaron parámetros para ambiente de producción
|
|
12
|
+
|
|
13
|
+
### version: 0.0.401
|
|
14
|
+
|
|
15
|
+
- Se creo componente para nuevo metodo de pago decidir (WIP)
|
|
16
|
+
|
|
3
17
|
### version: 0.0.400
|
|
4
18
|
|
|
5
19
|
- Se agrego manejo de script doppler como analytics. El parametro debe poseer el siguente formato doppler_[channel]_id -> ejemplo: doppler_minorista_id
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="es">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
8
|
+
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
|
9
|
+
<title>Decidir</title>
|
|
10
|
+
<script src="https://live.decidir.com/static/v2.5/decidir.js"></script>
|
|
11
|
+
</head>
|
|
12
|
+
|
|
13
|
+
<body>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
.loader {
|
|
17
|
+
border: 16px solid #f3f3f3;
|
|
18
|
+
border-top: 16px solid #dc3545;
|
|
19
|
+
border-radius: 50%;
|
|
20
|
+
width: 50px;
|
|
21
|
+
height: 50px;
|
|
22
|
+
animation: spin 2s linear infinite;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes spin {
|
|
26
|
+
0% {
|
|
27
|
+
transform: rotate(0deg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
100% {
|
|
31
|
+
transform: rotate(360deg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.flex-container {
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: center;
|
|
39
|
+
height: 80vh;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.flex-container>div {
|
|
43
|
+
width: 100px;
|
|
44
|
+
height: 100px;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
47
|
+
|
|
48
|
+
<div class="container-fluid">
|
|
49
|
+
<div class="row mt-3">
|
|
50
|
+
<div class="col-12">
|
|
51
|
+
<div class="card" >
|
|
52
|
+
<div class="w-100 text-center">
|
|
53
|
+
<img src="../assets/images/decidir-logo.png" class="card-img-top w-50" alt="...">
|
|
54
|
+
</div>
|
|
55
|
+
<div class="card-body">
|
|
56
|
+
<!-- <h5 class="card-title">Decidir</h5> -->
|
|
57
|
+
<!-- <p class="card-text">Ingrese sus datos para continuar con el pago.</p> -->
|
|
58
|
+
<form action="" method="post" id="formulario">
|
|
59
|
+
<fieldset>
|
|
60
|
+
|
|
61
|
+
<div class="row">
|
|
62
|
+
<div class="col-md-8 col-12">
|
|
63
|
+
|
|
64
|
+
<div class="form-floating mb-3">
|
|
65
|
+
<input class="form-control" type="text" data-decidir="card_number"
|
|
66
|
+
placeholder="XXXXXXXXXXXXXXXX" maxlength="16" value="">
|
|
67
|
+
<label for="card_number">Numero de tarjeta:</label>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
</div>
|
|
71
|
+
<div class="col-md-4 col-12">
|
|
72
|
+
|
|
73
|
+
<div class="form-floating mb-3">
|
|
74
|
+
<input class="form-control" type="text" data-decidir="security_code"
|
|
75
|
+
placeholder="XXX" maxlength="3" value="" />
|
|
76
|
+
<label for="security_code">Codigo de seguridad:</label>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="row">
|
|
82
|
+
|
|
83
|
+
<div class="col-md-6 col-12">
|
|
84
|
+
<div class="form-floating mb-3">
|
|
85
|
+
<input class="form-control" type="text" data-decidir="card_expiration_month"
|
|
86
|
+
placeholder="MM" maxlength="2" value="" />
|
|
87
|
+
<label for="card_expiration_month">Mes de vencimiento:</label>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="col-md-6 col-12">
|
|
92
|
+
<div class="form-floating mb-3">
|
|
93
|
+
<input class="form-control" type="text" data-decidir="card_expiration_year"
|
|
94
|
+
placeholder="AA" maxlength="2" value="" />
|
|
95
|
+
<label for="card_expiration_year">Año de vencimiento:</label>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="form-floating mb-3">
|
|
100
|
+
<input class="form-control" type="text" data-decidir="card_holder_name"
|
|
101
|
+
placeholder="TITULAR" value="" />
|
|
102
|
+
<label for="card_holder_name">Nombre del titular:</label>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="row">
|
|
105
|
+
<div class="col-md-6 col-12">
|
|
106
|
+
<div class="form-floating mb-3">
|
|
107
|
+
<select class="form-select" data-decidir="card_holder_doc_type">
|
|
108
|
+
<option value="dni">DNI</option>
|
|
109
|
+
</select>
|
|
110
|
+
<label for="card_holder_doc_type">Tipo de documento:</label>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="col-md-6 col-12">
|
|
114
|
+
<div class="form-floating mb-3">
|
|
115
|
+
<input class="form-control" data-decidir="card_holder_doc_number"
|
|
116
|
+
placeholder="XXXXXXXXXX" maxlength="9" value="">
|
|
117
|
+
<label for="card_holder_doc_type">Numero de documento:</label>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<div class="w-100 text-center">
|
|
123
|
+
<div id="loadTokenBtn">
|
|
124
|
+
<input type="submit" value="Generar Token" class="btn btn-outline-success mt-3" />
|
|
125
|
+
</div>
|
|
126
|
+
<div id="loadToken" class="text-center mt-4">
|
|
127
|
+
<div class="spinner-border" role="status">
|
|
128
|
+
<span class="visually-hidden">Cargando...</span>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</fieldset>
|
|
133
|
+
</form>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
142
|
+
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<script>
|
|
146
|
+
let loadToken = document.querySelector('#loadToken');
|
|
147
|
+
let loadTokenBtn = document.querySelector('#loadTokenBtn');
|
|
148
|
+
|
|
149
|
+
const isLoad = (state) => {
|
|
150
|
+
loadToken.style.display = !state && 'none' || 'block';
|
|
151
|
+
loadTokenBtn.style.display = state && 'none' || 'block';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
isLoad(false)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
const urlSandbox = "https://developers.decidir.com/api/v2";
|
|
158
|
+
const urlProduccion = "https://live.decidir.com/api/v2";
|
|
159
|
+
const dataRedirect = localStorage.getItem('dataRedirect')
|
|
160
|
+
const dataDecidir = localStorage.getItem('dataDecidir')
|
|
161
|
+
&& JSON.parse(localStorage.getItem('dataDecidir'))
|
|
162
|
+
|
|
163
|
+
const publicApiKey = dataDecidir?.config?.public_key
|
|
164
|
+
const cybersource = dataDecidir?.config?.public_cybersource || true
|
|
165
|
+
let modo = dataDecidir?.config?.public_enviroment || null
|
|
166
|
+
|
|
167
|
+
modo && (modo == 'prod' && (modo = false) || modo == 'test' && (modo = true))
|
|
168
|
+
!modo && (modo = window.location.host.includes('easycommercetech'))
|
|
169
|
+
|
|
170
|
+
console.log(modo);
|
|
171
|
+
|
|
172
|
+
const decidir = new Decidir( modo && urlSandbox || urlProduccion, cybersource);
|
|
173
|
+
decidir.setPublishableKey(publicApiKey);
|
|
174
|
+
decidir.setTimeout(5000);
|
|
175
|
+
|
|
176
|
+
let form = document.querySelector('#formulario');
|
|
177
|
+
|
|
178
|
+
const sendToken = (data) => {
|
|
179
|
+
fetch(dataRedirect, {
|
|
180
|
+
method: 'POST',
|
|
181
|
+
body: JSON.stringify(data),
|
|
182
|
+
headers: {
|
|
183
|
+
'Content-Type': 'application/json'
|
|
184
|
+
}
|
|
185
|
+
}).then(res => res.json())
|
|
186
|
+
.catch(error => {
|
|
187
|
+
console.error('Error:', error)
|
|
188
|
+
processError(response)
|
|
189
|
+
})
|
|
190
|
+
.then(response => {
|
|
191
|
+
console.log('Success:', response)
|
|
192
|
+
if (response.hasOwnProperty('status')) {
|
|
193
|
+
if (response.status == 'success') {
|
|
194
|
+
processResponse(response)
|
|
195
|
+
} else {
|
|
196
|
+
processError(response)
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
processResponse(response)
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
localStorage.removeItem('dataRedirect')
|
|
203
|
+
localStorage.removeItem('dataDecidir')
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const sdkResponseHandler = (status, response) => {
|
|
207
|
+
if (status != 200 && status != 201) {
|
|
208
|
+
//Manejo de error: Ver Respuesta de Error
|
|
209
|
+
processError(response)
|
|
210
|
+
} else {
|
|
211
|
+
//Manejo de respuesta donde response = {token: "99ab0740-4ef9-4b38-bdf9-c4c963459b22"}
|
|
212
|
+
sendToken(response)
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const sendForm = (event) => {
|
|
216
|
+
isLoad(true)
|
|
217
|
+
event.preventDefault();
|
|
218
|
+
decidir.createToken(form, sdkResponseHandler);
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const processError = (error) => {
|
|
223
|
+
console.log("ERROR ENVIO BACK ", error);
|
|
224
|
+
isLoad(false)
|
|
225
|
+
localStorage.setItem('state', 'failure')
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const processResponse = (response) => {
|
|
229
|
+
console.log("ENVIO BACK ", response);
|
|
230
|
+
isLoad(false)
|
|
231
|
+
localStorage.setItem('state', 'success')
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
form.addEventListener('submit', sendForm);
|
|
235
|
+
</script>
|
|
236
|
+
</body>
|
|
237
|
+
|
|
238
|
+
</html>
|
|
Binary file
|