logix-payment-shift4 1.1.8 → 1.1.9

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/dist/index.cjs.js CHANGED
@@ -239,6 +239,7 @@ function PaymentForm(_ref) {
239
239
  if (!window.Shift4) return;
240
240
  shift4Ref.current = window.Shift4(publicKeys);
241
241
  componentsRef.current = shift4Ref.current.createComponentGroup().automount("#payment-form");
242
+ componentsRef.current = componentGroup;
242
243
  setIsReady(true);
243
244
  };
244
245
  script.onerror = function () {
@@ -287,7 +288,6 @@ function PaymentForm(_ref) {
287
288
  break;
288
289
  }
289
290
  errorPage("Payment form is not ready yet. Please try again.");
290
- if (componentsRef.current) componentsRef.current.clear();
291
291
  return _context2.a(2);
292
292
  case 3:
293
293
  setIsSubmitting(true);
@@ -298,7 +298,6 @@ function PaymentForm(_ref) {
298
298
  token = _context2.v;
299
299
  if (!(token !== null && token !== void 0 && token.id)) {
300
300
  errorPage("Card tokenization failed. Please check your details and try again.");
301
- if (componentsRef.current) componentsRef.current.clear();
302
301
  }
303
302
  request = {
304
303
  amount: amount,
@@ -312,7 +311,6 @@ function PaymentForm(_ref) {
312
311
  threeDSecureToken = _context2.v;
313
312
  if (!(threeDSecureToken !== null && threeDSecureToken !== void 0 && threeDSecureToken.id)) {
314
313
  errorPage("3D Secure verification failed. Please try again.");
315
- if (componentsRef.current) componentsRef.current.clear();
316
314
  }
317
315
  apiBase = baseUrl + "charge/" + userId;
318
316
  _context2.n = 7;
@@ -339,18 +337,15 @@ function PaymentForm(_ref) {
339
337
  break;
340
338
  }
341
339
  if (typeof errorPage === "function") errorPage(result);
342
- if (componentsRef.current) componentsRef.current.clear();
343
340
  return _context2.a(2);
344
341
  case 9:
345
342
  if (typeof successPage === "function") successPage(result.message);
346
- if (componentsRef.current) componentsRef.current.clear();
347
343
  _context2.n = 11;
348
344
  break;
349
345
  case 10:
350
346
  _context2.p = 10;
351
347
  _t2 = _context2.v;
352
348
  if (typeof errorPage === "function") errorPage(_t2.message);
353
- if (componentsRef.current) componentsRef.current.clear();
354
349
  case 11:
355
350
  _context2.p = 11;
356
351
  setIsSubmitting(false);
package/dist/index.esm.js CHANGED
@@ -237,6 +237,7 @@ function PaymentForm(_ref) {
237
237
  if (!window.Shift4) return;
238
238
  shift4Ref.current = window.Shift4(publicKeys);
239
239
  componentsRef.current = shift4Ref.current.createComponentGroup().automount("#payment-form");
240
+ componentsRef.current = componentGroup;
240
241
  setIsReady(true);
241
242
  };
242
243
  script.onerror = function () {
@@ -285,7 +286,6 @@ function PaymentForm(_ref) {
285
286
  break;
286
287
  }
287
288
  errorPage("Payment form is not ready yet. Please try again.");
288
- if (componentsRef.current) componentsRef.current.clear();
289
289
  return _context2.a(2);
290
290
  case 3:
291
291
  setIsSubmitting(true);
@@ -296,7 +296,6 @@ function PaymentForm(_ref) {
296
296
  token = _context2.v;
297
297
  if (!(token !== null && token !== void 0 && token.id)) {
298
298
  errorPage("Card tokenization failed. Please check your details and try again.");
299
- if (componentsRef.current) componentsRef.current.clear();
300
299
  }
301
300
  request = {
302
301
  amount: amount,
@@ -310,7 +309,6 @@ function PaymentForm(_ref) {
310
309
  threeDSecureToken = _context2.v;
311
310
  if (!(threeDSecureToken !== null && threeDSecureToken !== void 0 && threeDSecureToken.id)) {
312
311
  errorPage("3D Secure verification failed. Please try again.");
313
- if (componentsRef.current) componentsRef.current.clear();
314
312
  }
315
313
  apiBase = baseUrl + "charge/" + userId;
316
314
  _context2.n = 7;
@@ -337,18 +335,15 @@ function PaymentForm(_ref) {
337
335
  break;
338
336
  }
339
337
  if (typeof errorPage === "function") errorPage(result);
340
- if (componentsRef.current) componentsRef.current.clear();
341
338
  return _context2.a(2);
342
339
  case 9:
343
340
  if (typeof successPage === "function") successPage(result.message);
344
- if (componentsRef.current) componentsRef.current.clear();
345
341
  _context2.n = 11;
346
342
  break;
347
343
  case 10:
348
344
  _context2.p = 10;
349
345
  _t2 = _context2.v;
350
346
  if (typeof errorPage === "function") errorPage(_t2.message);
351
- if (componentsRef.current) componentsRef.current.clear();
352
347
  case 11:
353
348
  _context2.p = 11;
354
349
  setIsSubmitting(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "logix-payment-shift4",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "A React component library for integrating Shift4 payments with Logix applications.",
5
5
  "author": "Yusif Atababayev",
6
6
  "license": "ISC",