tonder-web-sdk 1.16.1 → 1.16.6-beta.DEV-1433.1
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 +134 -40
- package/package.json +29 -6
- package/types/card.d.ts +17 -17
- package/types/checkout.d.ts +85 -87
- package/types/common.d.ts +8 -2
- package/types/customer.d.ts +10 -10
- package/types/index.d.ts +9 -11
- package/types/inlineCheckout.d.ts +81 -61
- package/types/liteInlineCheckout.d.ts +78 -83
- package/types/paymentMethod.d.ts +17 -17
- package/types/transaction.d.ts +94 -94
- package/v1/bundle.min.js +1 -18
- package/.env-example +0 -1
- package/cypress/e2e/1-getting-started/todo.cy.js +0 -143
- package/cypress/e2e/2-advanced-examples/actions.cy.js +0 -299
- package/cypress/e2e/2-advanced-examples/aliasing.cy.js +0 -39
- package/cypress/e2e/2-advanced-examples/assertions.cy.js +0 -176
- package/cypress/e2e/2-advanced-examples/connectors.cy.js +0 -98
- package/cypress/e2e/2-advanced-examples/cookies.cy.js +0 -118
- package/cypress/e2e/2-advanced-examples/cypress_api.cy.js +0 -185
- package/cypress/e2e/2-advanced-examples/files.cy.js +0 -85
- package/cypress/e2e/2-advanced-examples/location.cy.js +0 -32
- package/cypress/e2e/2-advanced-examples/misc.cy.js +0 -104
- package/cypress/e2e/2-advanced-examples/navigation.cy.js +0 -56
- package/cypress/e2e/2-advanced-examples/network_requests.cy.js +0 -163
- package/cypress/e2e/2-advanced-examples/querying.cy.js +0 -114
- package/cypress/e2e/2-advanced-examples/spies_stubs_clocks.cy.js +0 -201
- package/cypress/e2e/2-advanced-examples/storage.cy.js +0 -110
- package/cypress/e2e/2-advanced-examples/traversal.cy.js +0 -121
- package/cypress/e2e/2-advanced-examples/utilities.cy.js +0 -108
- package/cypress/e2e/2-advanced-examples/viewport.cy.js +0 -58
- package/cypress/e2e/2-advanced-examples/waiting.cy.js +0 -30
- package/cypress/e2e/2-advanced-examples/window.cy.js +0 -22
- package/cypress/fixtures/example.json +0 -5
- package/cypress/support/commands.js +0 -25
- package/cypress/support/e2e.js +0 -20
- package/cypress.config.js +0 -9
- package/index.js.example +0 -50
- package/samples/react/README.md +0 -70
- package/samples/react/build/asset-manifest.json +0 -16
- package/samples/react/build/favicon.ico +0 -0
- package/samples/react/build/index.html +0 -1
- package/samples/react/build/logo192.png +0 -0
- package/samples/react/build/logo512.png +0 -0
- package/samples/react/build/manifest.json +0 -25
- package/samples/react/build/robots.txt +0 -3
- package/samples/react/build/static/css/main.073c9b0a.css +0 -2
- package/samples/react/build/static/css/main.073c9b0a.css.map +0 -1
- package/samples/react/build/static/js/787.b83ed06f.chunk.js +0 -2
- package/samples/react/build/static/js/787.b83ed06f.chunk.js.map +0 -1
- package/samples/react/build/static/js/main.0a848807.js +0 -3
- package/samples/react/build/static/js/main.0a848807.js.LICENSE.txt +0 -39
- package/samples/react/build/static/js/main.0a848807.js.map +0 -1
- package/samples/react/build/static/media/sdk-icons.b491623214b2af4cccdb.png +0 -0
- package/samples/react/package-lock.json +0 -28973
- package/samples/react/package.json +0 -44
- package/samples/react/public/favicon.ico +0 -0
- package/samples/react/public/index.html +0 -43
- package/samples/react/public/logo192.png +0 -0
- package/samples/react/public/logo512.png +0 -0
- package/samples/react/public/manifest.json +0 -25
- package/samples/react/public/robots.txt +0 -3
- package/samples/react/src/App.css +0 -38
- package/samples/react/src/App.js +0 -22
- package/samples/react/src/App.test.js +0 -8
- package/samples/react/src/assets/img/sdk-icons.png +0 -0
- package/samples/react/src/components/Cart.js +0 -29
- package/samples/react/src/components/ProductCard.js +0 -27
- package/samples/react/src/context/CartContext.js +0 -116
- package/samples/react/src/index.css +0 -13
- package/samples/react/src/index.js +0 -17
- package/samples/react/src/logo.svg +0 -1
- package/samples/react/src/reportWebVitals.js +0 -13
- package/samples/react/src/screens/Checkout.js +0 -82
- package/samples/react/src/screens/Store.js +0 -21
- package/samples/react/src/setupTests.js +0 -5
- package/samples/react/src/storeProducts.js +0 -30
- package/src/classes/3dsHandler.js +0 -203
- package/src/classes/BaseInlineCheckout.js +0 -324
- package/src/classes/LiteInlineCheckout.js +0 -220
- package/src/classes/checkout.js +0 -125
- package/src/classes/globalLoader.js +0 -29
- package/src/classes/inlineCheckout.js +0 -515
- package/src/data/apmApi.js +0 -44
- package/src/data/businessApi.js +0 -19
- package/src/data/cardApi.js +0 -143
- package/src/data/checkoutApi.js +0 -92
- package/src/data/customerApi.js +0 -37
- package/src/data/index.js +0 -17
- package/src/data/openPayApi.js +0 -16
- package/src/data/skyflowApi.js +0 -18
- package/src/helpers/skyflow.js +0 -361
- package/src/helpers/styles.js +0 -61
- package/src/helpers/template-skeleton.js +0 -59
- package/src/helpers/template.js +0 -743
- package/src/helpers/utils.js +0 -163
- package/src/helpers/validations.js +0 -54
- package/src/index-dev.js +0 -307
- package/src/index.html +0 -172
- package/src/index.js +0 -15
- package/src/shared/catalog/paymentMethodsCatalog.js +0 -247
- package/src/shared/constants/messages.js +0 -10
- package/src/shared/constants/paymentMethodAPM.js +0 -63
- package/src/shared/constants/tonderUrl.js +0 -8
- package/webpack.config.js +0 -77
package/src/helpers/template.js
DELETED
|
@@ -1,743 +0,0 @@
|
|
|
1
|
-
import "accordion-js/dist/accordion.min.css";
|
|
2
|
-
import { getCardType } from "./utils";
|
|
3
|
-
import {getPaymentMethodDetails} from "../shared/catalog/paymentMethodsCatalog";
|
|
4
|
-
|
|
5
|
-
export const cardTemplate = (data) => `
|
|
6
|
-
<div class="container-tonder">
|
|
7
|
-
${ data.customization?.saveCards?.showSaved ?
|
|
8
|
-
`<div id="cardsListContainer" class="cards-list-container"></div>`
|
|
9
|
-
:``
|
|
10
|
-
}
|
|
11
|
-
<div class="pay-new-card">
|
|
12
|
-
<input checked id="new" class="card_selected" name="card_selected" type="radio"/>
|
|
13
|
-
<label class="card-item-label-new" for="new">
|
|
14
|
-
<img class="card-image" src="${getCardType("XXXX")}" />
|
|
15
|
-
<div class="card-number">Pagar con tarjeta</div>
|
|
16
|
-
</label>
|
|
17
|
-
</div>
|
|
18
|
-
<div id="global-loader" class="global-loader"></div>
|
|
19
|
-
<div class="container-form">
|
|
20
|
-
<div id="collectCardholderName" class="empty-div"></div>
|
|
21
|
-
<div id="collectCardNumber" class="empty-div"></div>
|
|
22
|
-
<div class="collect-row">
|
|
23
|
-
<div id="collectExpirationMonth" class="empty-div"></div>
|
|
24
|
-
<div id="collectExpirationYear" class="expiration-year"></div>
|
|
25
|
-
<div id="collectCvv" class="empty-div"></div>
|
|
26
|
-
</div>
|
|
27
|
-
${!!data.customization?.saveCards?.showSaveCardOption
|
|
28
|
-
? `
|
|
29
|
-
<div class="checkbox" id="save-card-container">
|
|
30
|
-
<input id="save-checkout-card" type="checkbox">
|
|
31
|
-
<label for="save-checkout-card">
|
|
32
|
-
Guardar tarjeta para futuros pagos
|
|
33
|
-
</label>
|
|
34
|
-
</div>
|
|
35
|
-
`
|
|
36
|
-
:``}
|
|
37
|
-
|
|
38
|
-
<div id="msgError"></div>
|
|
39
|
-
<div id="msgNotification"></div>
|
|
40
|
-
</div>
|
|
41
|
-
<div id="apmsListContainer" class="apms-list-container"></div>
|
|
42
|
-
<div class="container-pay-button">
|
|
43
|
-
<button id="tonderPayButton" class="pay-button hidden">Pagar</button>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<style>
|
|
48
|
-
|
|
49
|
-
.container-tonder {
|
|
50
|
-
background-color: #F9F9F9;
|
|
51
|
-
margin: 0 auto !important;
|
|
52
|
-
padding: 0px;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
transition: max-height 0.5s ease-out;
|
|
55
|
-
max-width: 600px;
|
|
56
|
-
border: solid 1px #e3e3e3;
|
|
57
|
-
position: relative;
|
|
58
|
-
font-family: ${getFontFamily(data)};
|
|
59
|
-
}
|
|
60
|
-
.container-pay-button{
|
|
61
|
-
padding: ${!!data['renderPaymentButton'] ? '30px 25px':''};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.container-form {
|
|
65
|
-
padding: 25px 25px 0px 25px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.collect-row {
|
|
69
|
-
display: flex !important;
|
|
70
|
-
justify-content: space-between !important;
|
|
71
|
-
width: 100% !important;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.collect-row > :first-child {
|
|
75
|
-
min-width: 120px; !important
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.expiration-year {
|
|
79
|
-
position: relative !important;
|
|
80
|
-
padding-top: 25px !important;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.empty-div {
|
|
84
|
-
position: relative;
|
|
85
|
-
height: 80px !important;
|
|
86
|
-
margin-top: 2px;
|
|
87
|
-
margin-bottom: 4px;
|
|
88
|
-
margin-left: 10px !important;
|
|
89
|
-
margin-right: 10px !important;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.error-container {
|
|
93
|
-
color: red !important;
|
|
94
|
-
background-color: #FFDBDB !important;
|
|
95
|
-
margin-bottom: 13px !important;
|
|
96
|
-
font-size: 80% !important;
|
|
97
|
-
padding: 8px 10px !important;
|
|
98
|
-
border-radius: 10px !important;
|
|
99
|
-
text-align: left !important;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.message-container{
|
|
103
|
-
color: #3bc635 !important;
|
|
104
|
-
background-color: #DAFCE4 !important;
|
|
105
|
-
margin-bottom: 13px !important;
|
|
106
|
-
font-size: 80% !important;
|
|
107
|
-
padding: 8px 10px !important;
|
|
108
|
-
border-radius: 10px !important;
|
|
109
|
-
text-align: left !important;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.pay-button {
|
|
113
|
-
font-size: 16px;
|
|
114
|
-
font-weight: bold;
|
|
115
|
-
min-height: 2.3rem;
|
|
116
|
-
border-radius: 0.5rem;
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
width: 100%;
|
|
119
|
-
padding: 1rem;
|
|
120
|
-
text-align: center;
|
|
121
|
-
border: none;
|
|
122
|
-
background-color: #000;
|
|
123
|
-
color: #fff;
|
|
124
|
-
margin-bottom: 0px;
|
|
125
|
-
}
|
|
126
|
-
.hidden{
|
|
127
|
-
display: none;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.lds-dual-ring {
|
|
131
|
-
display: inline-block;
|
|
132
|
-
width: 14px;
|
|
133
|
-
height: 14px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.lds-dual-ring:after {
|
|
137
|
-
content: " ";
|
|
138
|
-
display: block;
|
|
139
|
-
width: 14px;
|
|
140
|
-
height: 14px;
|
|
141
|
-
border-radius: 50%;
|
|
142
|
-
border: 6px solid #fff;
|
|
143
|
-
border-color: #fff transparent #fff transparent;
|
|
144
|
-
animation: lds-dual-ring 1.2s linear infinite;
|
|
145
|
-
}
|
|
146
|
-
@keyframes lds-dual-ring {
|
|
147
|
-
0% {
|
|
148
|
-
transform: rotate(0deg);
|
|
149
|
-
}
|
|
150
|
-
100% {
|
|
151
|
-
transform: rotate(360deg);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.global-loader {
|
|
156
|
-
position: absolute;
|
|
157
|
-
top: 0;
|
|
158
|
-
left: 0;
|
|
159
|
-
width: 100%;
|
|
160
|
-
height: 100%;
|
|
161
|
-
z-index: 1;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
@media screen and (max-width: 600px) {
|
|
165
|
-
.payment_method_zplit {
|
|
166
|
-
font-size: 16px !important;
|
|
167
|
-
width: 100% !important;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.payment_method_zplit label img {
|
|
171
|
-
display: none !important;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.checkbox label {
|
|
176
|
-
margin-left: 10px;
|
|
177
|
-
font-size: 12px;
|
|
178
|
-
font-weight: 500;
|
|
179
|
-
color: #1D1D1D;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.checkbox {
|
|
183
|
-
margin-top: 10px;
|
|
184
|
-
margin-bottom: 20px;
|
|
185
|
-
text-align: left;
|
|
186
|
-
padding: 0 8px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.cards-list-container {
|
|
190
|
-
display: flex;
|
|
191
|
-
flex-direction: column;
|
|
192
|
-
padding: 0px;
|
|
193
|
-
gap: 33% 20px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.apms-list-container {
|
|
197
|
-
display: flex;
|
|
198
|
-
flex-direction: column;
|
|
199
|
-
gap: 33% 20px;
|
|
200
|
-
max-height: 300px;
|
|
201
|
-
overflow-y: auto;
|
|
202
|
-
}
|
|
203
|
-
.pay-new-card {
|
|
204
|
-
display: flex;
|
|
205
|
-
justify-content: start;
|
|
206
|
-
align-items: center;
|
|
207
|
-
color: #1D1D1D;
|
|
208
|
-
gap: 33% 15px;
|
|
209
|
-
margin-top: 10px;
|
|
210
|
-
margin-bottom: 10px;
|
|
211
|
-
padding: 0px 30px;
|
|
212
|
-
width: 100%;
|
|
213
|
-
position: relative;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.pay-new-card .card-number {
|
|
217
|
-
font-size: 16px;
|
|
218
|
-
}
|
|
219
|
-
.card-image {
|
|
220
|
-
width: 39px;
|
|
221
|
-
height: 24px;
|
|
222
|
-
text-align: left;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.card-item-label-new {
|
|
226
|
-
display: flex;
|
|
227
|
-
justify-content: start;
|
|
228
|
-
align-items: center;
|
|
229
|
-
color: #1D1D1D;
|
|
230
|
-
gap: 33% 20px;
|
|
231
|
-
margin-top: 10px;
|
|
232
|
-
margin-bottom: 10px;
|
|
233
|
-
width: 100%;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.card_selected {
|
|
237
|
-
position: relative;
|
|
238
|
-
width: 16px;
|
|
239
|
-
height: 16px;
|
|
240
|
-
min-width: 16px;
|
|
241
|
-
appearance: none;
|
|
242
|
-
cursor: pointer;
|
|
243
|
-
border-radius: 100%;
|
|
244
|
-
border: 1px #bababa solid;
|
|
245
|
-
color: #3bc635;
|
|
246
|
-
transition-property: all;
|
|
247
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
248
|
-
transition-duration: 150ms;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.card_selected:before {
|
|
252
|
-
width: 8px;
|
|
253
|
-
height: 8px;
|
|
254
|
-
content: "";
|
|
255
|
-
position: absolute;
|
|
256
|
-
top: 50%;
|
|
257
|
-
left: 50%;
|
|
258
|
-
display: block;
|
|
259
|
-
transform: translate(-50%, -50%);
|
|
260
|
-
border-radius: 100%;
|
|
261
|
-
background-color: #3bc635;
|
|
262
|
-
opacity: 0;
|
|
263
|
-
transition-property: opacity;
|
|
264
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
265
|
-
transition-duration: 150ms;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.card_selected:checked {
|
|
269
|
-
border: 1px #3bc635 solid;
|
|
270
|
-
position: relative;
|
|
271
|
-
width: 16px;
|
|
272
|
-
height: 16px;
|
|
273
|
-
min-width: 16px;
|
|
274
|
-
appearance: none;
|
|
275
|
-
cursor: pointer;
|
|
276
|
-
border-radius: 100%;
|
|
277
|
-
color: #3bc635;
|
|
278
|
-
transition-property: all;
|
|
279
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
280
|
-
transition-duration: 150ms;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.card_selected:checked:before {
|
|
284
|
-
content: "";
|
|
285
|
-
border: 1px #3bc635 solid;
|
|
286
|
-
width: 8px;
|
|
287
|
-
height: 8px;
|
|
288
|
-
position: absolute;
|
|
289
|
-
top: 50%;
|
|
290
|
-
left: 50%;
|
|
291
|
-
display: block;
|
|
292
|
-
transform: translate(-50%, -50%);
|
|
293
|
-
border-radius: 100%;
|
|
294
|
-
background-color: #3bc635;
|
|
295
|
-
opacity: 50;
|
|
296
|
-
transition-property: opacity;
|
|
297
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
298
|
-
transition-duration: 150ms;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.card_selected:hover:before {
|
|
302
|
-
width: 8px;
|
|
303
|
-
height: 8px;
|
|
304
|
-
content: "";
|
|
305
|
-
position: absolute;
|
|
306
|
-
top: 50%;
|
|
307
|
-
left: 50%;
|
|
308
|
-
display: block;
|
|
309
|
-
transform: translate(-50%, -50%);
|
|
310
|
-
border-radius: 100%;
|
|
311
|
-
background-color: #3bc635;
|
|
312
|
-
transition-property: opacity;
|
|
313
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
314
|
-
transition-duration: 150ms;
|
|
315
|
-
opacity: 10;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
.error-custom-inputs-tonder {
|
|
320
|
-
background-color: white;
|
|
321
|
-
position: absolute;
|
|
322
|
-
left: 0px;
|
|
323
|
-
bottom: -4px;
|
|
324
|
-
width: 100%;
|
|
325
|
-
font-size: 12px;
|
|
326
|
-
color: red;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.expiration-year .error-custom-inputs-tonder {
|
|
330
|
-
background-color: white;
|
|
331
|
-
position: absolute;
|
|
332
|
-
left: 0px;
|
|
333
|
-
bottom: 3px;
|
|
334
|
-
width: 100%;
|
|
335
|
-
font-size: 12px;
|
|
336
|
-
color: red;
|
|
337
|
-
}
|
|
338
|
-
</style>
|
|
339
|
-
`
|
|
340
|
-
|
|
341
|
-
export const cardItemsTemplate = (cards, data) => {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const cardItemsHTML = cards.reduce((total, card) => {
|
|
345
|
-
return `${total}
|
|
346
|
-
<div class="ac" id="card_container-${card.skyflow_id}">
|
|
347
|
-
<div class="card-item" >
|
|
348
|
-
<input id="${card.skyflow_id}" class="card_selected" name="card_selected" type="radio"/>
|
|
349
|
-
<label class="card-item-label" for="${card.skyflow_id}">
|
|
350
|
-
<!-- <div class="ac-trigger">-->
|
|
351
|
-
<img class="card-image" src="${getCardType(card.card_scheme)}" />
|
|
352
|
-
<div class="card-number">${card.card_number}</div>
|
|
353
|
-
<div class="card-expiration">Exp. ${card.expiration_month}/${card.expiration_year}</div>
|
|
354
|
-
<!-- </div>-->
|
|
355
|
-
<div class="card-delete-icon">
|
|
356
|
-
<button id="delete_button_${card.skyflow_id}" class="card-delete-button">
|
|
357
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">
|
|
358
|
-
<path fill="currentColor" d="M292.309-140.001q-30.308 0-51.308-21t-21-51.308V-720h-40v-59.999H360v-35.384h240v35.384h179.999V-720h-40v507.691q0 30.308-21 51.308t-51.308 21H292.309ZM376.155-280h59.999v-360h-59.999v360Zm147.691 0h59.999v-360h-59.999v360Z"/>
|
|
359
|
-
</svg>
|
|
360
|
-
</button>
|
|
361
|
-
</div>
|
|
362
|
-
</label>
|
|
363
|
-
</div>
|
|
364
|
-
<div class="ac-panel">
|
|
365
|
-
<div class="ac-card-panel-container" id="acContainer${card.skyflow_id}">
|
|
366
|
-
<div class="cvvContainer" id="cvvContainer${card.skyflow_id}">
|
|
367
|
-
<div id="collectCvv${card.skyflow_id}" class="empty-div"></div>
|
|
368
|
-
<svg class="cvvIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="24" viewBox="0 0 270 178">
|
|
369
|
-
<defs>
|
|
370
|
-
<linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
|
|
371
|
-
<stop offset="0" stop-color="#386bbf"/>
|
|
372
|
-
<stop offset="1" stop-color="#032ea3"/>
|
|
373
|
-
</linearGradient>
|
|
374
|
-
<linearGradient id="linear-gradient-2" x1="0.5" y1="0.115" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
|
|
375
|
-
<stop offset="0" stop-color="#1c1c1c"/>
|
|
376
|
-
<stop offset="1" stop-color="#151515"/>
|
|
377
|
-
</linearGradient>
|
|
378
|
-
</defs>
|
|
379
|
-
<g id="Grupo_3" data-name="Grupo 3" transform="translate(-69 -312)">
|
|
380
|
-
<g id="Grupo_2" data-name="Grupo 2">
|
|
381
|
-
<rect id="Rectángulo_58" data-name="Rectángulo 58" width="253" height="165" rx="25" transform="translate(69 312)" fill="url(#linear-gradient)"/>
|
|
382
|
-
<rect id="Rectángulo_61" data-name="Rectángulo 61" width="68" height="8" rx="4" transform="translate(86 437)" fill="#fff" opacity="0.877"/>
|
|
383
|
-
<rect id="Rectángulo_66" data-name="Rectángulo 66" width="253" height="24" transform="translate(69 347)" fill="url(#linear-gradient-2)"/>
|
|
384
|
-
<g id="Elipse_4" data-name="Elipse 4" transform="translate(221 374)" fill="#fff" stroke="#191919" stroke-width="1">
|
|
385
|
-
<ellipse cx="59" cy="58" rx="59" ry="58" stroke="none"/>
|
|
386
|
-
<ellipse cx="59" cy="58" rx="58.5" ry="57.5" fill="none"/>
|
|
387
|
-
</g>
|
|
388
|
-
</g>
|
|
389
|
-
<text id="_123" data-name="123" transform="translate(240 448)" font-size="45" font-family="Menlo-Regular, Menlo"><tspan x="0" y="0">123</tspan></text>
|
|
390
|
-
</g>
|
|
391
|
-
</svg>
|
|
392
|
-
</div>
|
|
393
|
-
${ data?.renderPaymentButton ?
|
|
394
|
-
`<div class="container-card-pay-button">
|
|
395
|
-
<button id="tonderPayButton${card.skyflow_id}" class="card-pay-button pay-button">Pagar</button>
|
|
396
|
-
</div> `
|
|
397
|
-
:``
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
</div>
|
|
401
|
-
</div>
|
|
402
|
-
</div>`
|
|
403
|
-
|
|
404
|
-
}, "");
|
|
405
|
-
const cardItemStyle = `
|
|
406
|
-
<style>
|
|
407
|
-
.ac {
|
|
408
|
-
background-color: transparent !important;
|
|
409
|
-
margin-bottom: 0 !important;
|
|
410
|
-
border-bottom: 1px solid #e2e8f0;
|
|
411
|
-
}
|
|
412
|
-
.ac-card-panel-container{
|
|
413
|
-
padding: ${data?.renderPaymentButton ? '20px 32px 0px 32px':'20px 32px 20px 32px'};
|
|
414
|
-
}
|
|
415
|
-
.cvvContainer{
|
|
416
|
-
max-width: 45%;
|
|
417
|
-
position: relative;
|
|
418
|
-
padding: 0px 28px 0px 28px;
|
|
419
|
-
}
|
|
420
|
-
.cvvIcon {
|
|
421
|
-
position: absolute;
|
|
422
|
-
right: 16%;
|
|
423
|
-
top: 43%;
|
|
424
|
-
opacity: 0;
|
|
425
|
-
transform: translateY(10px);
|
|
426
|
-
transition: opacity 0.3s ease, transform 0.3s ease;
|
|
427
|
-
}
|
|
428
|
-
.cvvContainer.show .cvvIcon,
|
|
429
|
-
.ac-card-panel-container.show .card-pay-button {
|
|
430
|
-
opacity: 1;
|
|
431
|
-
transform: translateY(0);
|
|
432
|
-
transition-delay: 0.3s;
|
|
433
|
-
}
|
|
434
|
-
.container-card-pay-button{
|
|
435
|
-
margin: 20px 0px;
|
|
436
|
-
}
|
|
437
|
-
.card-pay-button{
|
|
438
|
-
display: block;
|
|
439
|
-
opacity: 0;
|
|
440
|
-
transform: translateY(10px);
|
|
441
|
-
transition: opacity 0.3s ease, transform 0.3s ease;
|
|
442
|
-
}
|
|
443
|
-
.card-item-label {
|
|
444
|
-
display: flex;
|
|
445
|
-
justify-content: space-between;
|
|
446
|
-
align-items: center;
|
|
447
|
-
color: #1D1D1D;
|
|
448
|
-
gap: 33% 20px;
|
|
449
|
-
margin-top: 15px;
|
|
450
|
-
margin-bottom: 15px;
|
|
451
|
-
width: 100%;
|
|
452
|
-
}
|
|
453
|
-
.card-item {
|
|
454
|
-
position: relative;
|
|
455
|
-
display: flex;
|
|
456
|
-
justify-content: start;
|
|
457
|
-
align-items: center;
|
|
458
|
-
gap: 33% 15px;
|
|
459
|
-
padding: 0px 30px;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
.card-item .card-number {
|
|
463
|
-
font-size: 16px;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.card-item .card-expiration {
|
|
467
|
-
font-size: 16px;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.card-image {
|
|
471
|
-
width: 39px;
|
|
472
|
-
height: 24px;
|
|
473
|
-
text-align: left;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.card-delete-button {
|
|
477
|
-
background-color: transparent !important;
|
|
478
|
-
color: #000000 !important;
|
|
479
|
-
border: none;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
.card-delete-button:hover {
|
|
483
|
-
background-color: transparent !important;
|
|
484
|
-
color: #D91C1C !important;
|
|
485
|
-
}
|
|
486
|
-
.card_selected {
|
|
487
|
-
position: relative;
|
|
488
|
-
width: 16px;
|
|
489
|
-
min-width: 16px;
|
|
490
|
-
height: 16px;
|
|
491
|
-
appearance: none;
|
|
492
|
-
cursor: pointer;
|
|
493
|
-
border-radius: 100%;
|
|
494
|
-
border: 1px #bababa solid;
|
|
495
|
-
color: #3bc635;
|
|
496
|
-
transition-property: all;
|
|
497
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
498
|
-
transition-duration: 150ms;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
.card_selected:before {
|
|
502
|
-
width: 8px;
|
|
503
|
-
height: 8px;
|
|
504
|
-
content: "";
|
|
505
|
-
position: absolute;
|
|
506
|
-
top: 50%;
|
|
507
|
-
left: 50%;
|
|
508
|
-
display: block;
|
|
509
|
-
transform: translate(-50%, -50%);
|
|
510
|
-
border-radius: 100%;
|
|
511
|
-
background-color: #3bc635;
|
|
512
|
-
opacity: 0;
|
|
513
|
-
transition-property: opacity;
|
|
514
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
515
|
-
transition-duration: 150ms;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
.card_selected:checked {
|
|
519
|
-
border: 1px #3bc635 solid;
|
|
520
|
-
position: relative;
|
|
521
|
-
width: 16px;
|
|
522
|
-
height: 16px;
|
|
523
|
-
min-width: 16px;
|
|
524
|
-
appearance: none;
|
|
525
|
-
cursor: pointer;
|
|
526
|
-
border-radius: 100%;
|
|
527
|
-
color: #3bc635;
|
|
528
|
-
transition-property: all;
|
|
529
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
530
|
-
transition-duration: 150ms;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
.card_selected:checked:before {
|
|
534
|
-
content: "";
|
|
535
|
-
border: 1px #3bc635 solid;
|
|
536
|
-
width: 8px;
|
|
537
|
-
height: 8px;
|
|
538
|
-
position: absolute;
|
|
539
|
-
top: 50%;
|
|
540
|
-
left: 50%;
|
|
541
|
-
display: block;
|
|
542
|
-
transform: translate(-50%, -50%);
|
|
543
|
-
border-radius: 100%;
|
|
544
|
-
background-color: #3bc635;
|
|
545
|
-
opacity: 50;
|
|
546
|
-
transition-property: opacity;
|
|
547
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
548
|
-
transition-duration: 150ms;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
.card_selected:hover:before {
|
|
552
|
-
width: 8px;
|
|
553
|
-
height: 8px;
|
|
554
|
-
content: "";
|
|
555
|
-
position: absolute;
|
|
556
|
-
top: 50%;
|
|
557
|
-
left: 50%;
|
|
558
|
-
display: block;
|
|
559
|
-
transform: translate(-50%, -50%);
|
|
560
|
-
border-radius: 100%;
|
|
561
|
-
background-color: #3bc635;
|
|
562
|
-
transition-property: opacity;
|
|
563
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
564
|
-
transition-duration: 150ms;
|
|
565
|
-
opacity: 10;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
</style>
|
|
569
|
-
`
|
|
570
|
-
const cardItem = `
|
|
571
|
-
<div class="accordion-container">
|
|
572
|
-
${cardItemsHTML}
|
|
573
|
-
</div>
|
|
574
|
-
${cardItemStyle}
|
|
575
|
-
`
|
|
576
|
-
return cardItem;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
export const apmItemsTemplate = (apms) => {
|
|
580
|
-
|
|
581
|
-
const apmItemsHTML = apms.reduce((total, apm) => {
|
|
582
|
-
const apm_data = getPaymentMethodDetails(apm.payment_method);
|
|
583
|
-
return `${total}
|
|
584
|
-
<div class="apm-item" id="card_container-${apm.pk}">
|
|
585
|
-
<input id="${apm.pk}" class="card_selected" name="card_selected" type="radio"/>
|
|
586
|
-
<label class="apm-item-label" for="${apm.pk}">
|
|
587
|
-
|
|
588
|
-
<div class="apm-image">
|
|
589
|
-
<div class="apm-image-border"></div>
|
|
590
|
-
<img src="${apm_data.icon}" />
|
|
591
|
-
</div>
|
|
592
|
-
<div class="apm-name">${apm_data.label}</div>
|
|
593
|
-
</label>
|
|
594
|
-
</div>`
|
|
595
|
-
}, ``);
|
|
596
|
-
|
|
597
|
-
const apmItemStyle = `
|
|
598
|
-
<style>
|
|
599
|
-
.apm-item-label {
|
|
600
|
-
display: flex;
|
|
601
|
-
justify-content: flex-start;
|
|
602
|
-
align-items: center;
|
|
603
|
-
color: #1D1D1D;
|
|
604
|
-
gap: 33% 10px;
|
|
605
|
-
margin-top: 15px;
|
|
606
|
-
margin-bottom: 15px;
|
|
607
|
-
width: 100%;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
.apm-item {
|
|
611
|
-
position: relative;
|
|
612
|
-
display: flex;
|
|
613
|
-
justify-content: start;
|
|
614
|
-
align-items: center;
|
|
615
|
-
gap: 33% 15px;
|
|
616
|
-
border-bottom: 1px solid #e2e8f0;
|
|
617
|
-
padding: 0px 30px;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
.apm-item:first-child {
|
|
621
|
-
border-top: 1px solid #e2e8f0;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.apm-item .apm-name {
|
|
625
|
-
font-size: 16px;
|
|
626
|
-
}
|
|
627
|
-
.apm-image {
|
|
628
|
-
width: 30px;
|
|
629
|
-
height: 30px;
|
|
630
|
-
position: relative;
|
|
631
|
-
display: flex;
|
|
632
|
-
justify-content: center;
|
|
633
|
-
align-items: center;
|
|
634
|
-
}
|
|
635
|
-
.apm-image img {
|
|
636
|
-
width: auto;
|
|
637
|
-
height: 30px;
|
|
638
|
-
}
|
|
639
|
-
.apm-image-border{
|
|
640
|
-
position: absolute;
|
|
641
|
-
border: 1px solid #bababa36;
|
|
642
|
-
border-radius: 4px;
|
|
643
|
-
pointer-events: none;
|
|
644
|
-
box-sizing: border-box;
|
|
645
|
-
width: 100%;
|
|
646
|
-
height: 97%;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.card_selected {
|
|
650
|
-
position: relative;
|
|
651
|
-
width: 16px;
|
|
652
|
-
min-width: 16px;
|
|
653
|
-
height: 16px;
|
|
654
|
-
appearance: none;
|
|
655
|
-
cursor: pointer;
|
|
656
|
-
border-radius: 100%;
|
|
657
|
-
border: 1px #bababa solid;
|
|
658
|
-
color: #3bc635;
|
|
659
|
-
transition-property: all;
|
|
660
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
661
|
-
transition-duration: 150ms;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
.card_selected:before {
|
|
665
|
-
width: 8px;
|
|
666
|
-
height: 8px;
|
|
667
|
-
content: "";
|
|
668
|
-
position: absolute;
|
|
669
|
-
top: 50%;
|
|
670
|
-
left: 50%;
|
|
671
|
-
display: block;
|
|
672
|
-
transform: translate(-50%, -50%);
|
|
673
|
-
border-radius: 100%;
|
|
674
|
-
background-color: #3bc635;
|
|
675
|
-
opacity: 0;
|
|
676
|
-
transition-property: opacity;
|
|
677
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
678
|
-
transition-duration: 150ms;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
.card_selected:checked {
|
|
682
|
-
border: 1px #3bc635 solid;
|
|
683
|
-
position: relative;
|
|
684
|
-
width: 16px;
|
|
685
|
-
height: 16px;
|
|
686
|
-
min-width: 16px;
|
|
687
|
-
appearance: none;
|
|
688
|
-
cursor: pointer;
|
|
689
|
-
border-radius: 100%;
|
|
690
|
-
color: #3bc635;
|
|
691
|
-
transition-property: all;
|
|
692
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
693
|
-
transition-duration: 150ms;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
.card_selected:checked:before {
|
|
697
|
-
content: "";
|
|
698
|
-
border: 1px #3bc635 solid;
|
|
699
|
-
width: 8px;
|
|
700
|
-
height: 8px;
|
|
701
|
-
position: absolute;
|
|
702
|
-
top: 50%;
|
|
703
|
-
left: 50%;
|
|
704
|
-
display: block;
|
|
705
|
-
transform: translate(-50%, -50%);
|
|
706
|
-
border-radius: 100%;
|
|
707
|
-
background-color: #3bc635;
|
|
708
|
-
opacity: 50;
|
|
709
|
-
transition-property: opacity;
|
|
710
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
711
|
-
transition-duration: 150ms;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
.card_selected:hover:before {
|
|
715
|
-
width: 8px;
|
|
716
|
-
height: 8px;
|
|
717
|
-
content: "";
|
|
718
|
-
position: absolute;
|
|
719
|
-
top: 50%;
|
|
720
|
-
left: 50%;
|
|
721
|
-
display: block;
|
|
722
|
-
transform: translate(-50%, -50%);
|
|
723
|
-
border-radius: 100%;
|
|
724
|
-
background-color: #3bc635;
|
|
725
|
-
transition-property: opacity;
|
|
726
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
727
|
-
transition-duration: 150ms;
|
|
728
|
-
opacity: 10;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
</style>
|
|
732
|
-
`
|
|
733
|
-
const apmItem = `
|
|
734
|
-
${apmItemsHTML}
|
|
735
|
-
${apmItemStyle}
|
|
736
|
-
`
|
|
737
|
-
return apmItem;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
const getFontFamily = (data) => {
|
|
741
|
-
const base = data?.customStyles?.labelStyles?.base;
|
|
742
|
-
return base?.fontFamily || '"Inter", sans-serif';
|
|
743
|
-
};
|