tf-checkout-react 1.7.17 → 1.7.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.
@@ -7523,7 +7523,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref6) {
7523
7523
  processPayment = _useStripePayment.processPayment;
7524
7524
  var updateCheckoutWithAddOns = React.useCallback( /*#__PURE__*/function () {
7525
7525
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(addOns) {
7526
- var mergedAddOns, _checkoutUpdateData, checkoutResponse, checkoutDataObj, errorMessage;
7526
+ var mergedAddOns, _checkoutUpdateData, checkoutResponse, checkoutDataObj, updatedAttributes, errorMessage;
7527
7527
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
7528
7528
  while (1) switch (_context8.prev = _context8.next) {
7529
7529
  case 0:
@@ -7563,6 +7563,10 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref6) {
7563
7563
  checkoutDataObj = _get(checkoutResponse, 'data.attributes.cart_price_breakdown', {});
7564
7564
  setCheckoutData(checkoutDataObj);
7565
7565
  setSingleCheckoutAddOns(mergedAddOns);
7566
+ updatedAttributes = _get(checkoutResponse, 'data.attributes', {});
7567
+ if (updatedAttributes.additional_payment_information) {
7568
+ setCheckoutUpdateData(updatedAttributes);
7569
+ }
7566
7570
  }
7567
7571
  _context8.next = 18;
7568
7572
  break;
@@ -7602,12 +7606,12 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref6) {
7602
7606
  return _ref14.apply(this, arguments);
7603
7607
  };
7604
7608
  }(), [updateCheckoutWithAddOns]);
7605
- var onAddOnSelect = React.useCallback(function (id, value, addon, fieldUpdates) {
7609
+ var onAddOnSelect = React.useCallback(function (id, value, _addon, fieldUpdates) {
7606
7610
  if (fieldUpdates === void 0) {
7607
7611
  fieldUpdates = {};
7608
7612
  }
7609
7613
  var quantity = parseInt(value) || 0;
7610
- var addonId = addon.id || id;
7614
+ var addonId = id;
7611
7615
  // Get current add-ons and their custom fields
7612
7616
  var currentAddOns = JSON.parse(localStorage.getItem('add_ons') || '{}');
7613
7617
  var currentDataCapture = JSON.parse(localStorage.getItem('add_on_data_capture') || '{}');