tonder-web-sdk 1.12.0-beta.18 → 1.12.0-beta.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tonder-web-sdk",
3
- "version": "1.12.0-beta.18",
3
+ "version": "1.12.0-beta.19",
4
4
  "description": "tonder sdk for integrations",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -190,7 +190,7 @@ export class LiteInlineCheckout extends BaseInlineCheckout {
190
190
  skyflowTokens = await getSkyflowTokens({
191
191
  vault_id: vault_id,
192
192
  vault_url: vault_url,
193
- data: card,
193
+ data: {...card, card_number: card.card_number.replace(/\s+/g, '')},
194
194
  baseUrl: this.baseUrl,
195
195
  apiKey: this.apiKeyTonder,
196
196
  });
package/src/index-dev.js CHANGED
@@ -157,6 +157,7 @@ function setupLiteInlineCheckout() {
157
157
  });
158
158
 
159
159
  const liteForm = document.getElementById("lite-payment-form");
160
+ const payButton = document.getElementById("pay-button");
160
161
  liteForm.addEventListener("submit", async function (event) {
161
162
  event.preventDefault();
162
163
 
@@ -169,6 +170,7 @@ function setupLiteInlineCheckout() {
169
170
  };
170
171
 
171
172
  try {
173
+ payButton.textContent = "Procesando..."
172
174
  const paymentData = {
173
175
  ...checkoutData,
174
176
  card: cardData,
@@ -179,6 +181,8 @@ function setupLiteInlineCheckout() {
179
181
  } catch (error) {
180
182
  console.error("Error en el pago:", error);
181
183
  alert("Error al realizar el pago");
184
+ }finally {
185
+ payButton.textContent = "Pagar Ahora";
182
186
  }
183
187
  });
184
188
  }
@@ -234,17 +238,7 @@ function loadMaskitoMask(){
234
238
  };
235
239
 
236
240
  const cvvOptions = {
237
- mask: [
238
- ...Array(4).fill(/\d/),
239
- " ",
240
- ...Array(4).fill(/\d/),
241
- " ",
242
- ...Array(4).fill(/\d/),
243
- " ",
244
- ...Array(4).fill(/\d/),
245
- " ",
246
- ...Array(3).fill(/\d/),
247
- ],
241
+ mask: [...Array(3).fill(/\d/)],
248
242
  };
249
243
 
250
244
  // Aplicar Maskito a cada campo
package/src/index.html CHANGED
@@ -149,7 +149,7 @@
149
149
  <input class="input-md" type="text" id="cvv" placeholder="123" required>
150
150
  </div>
151
151
  </div>
152
- <button type="submit" class="btn">Pagar Ahora</button>
152
+ <button type="submit" class="btn" id="pay-button">Pagar Ahora</button>
153
153
  </form>
154
154
  </div>
155
155
  <div id="inline-content" class="tab-content">