summit-registration-lite 2.0.19 → 2.0.20

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.
Files changed (2) hide show
  1. package/dist/index.js +36 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -426,6 +426,7 @@ const getTaxesTypes = summitId => async (dispatch, getState, {
426
426
  }
427
427
  };
428
428
  const reserveTicket = ({
429
+ provider,
429
430
  personalInformation,
430
431
  ticket,
431
432
  ticketQuantity
@@ -495,7 +496,7 @@ const reserveTicket = ({
495
496
  payload.response.promo_code = promoCode || null;
496
497
 
497
498
  if (!payload.response.amount) {
498
- dispatch(payTicket(null, null, getAccessToken));
499
+ dispatch(payTicketWithProvider(provider));
499
500
  return payload;
500
501
  } else {
501
502
  dispatch(changeStep(2));
@@ -2385,6 +2386,34 @@ const TicketOwnedComponent = ({
2385
2386
  };
2386
2387
 
2387
2388
  /* harmony default export */ const ticket_owned = (TicketOwnedComponent);
2389
+ ;// CONCATENATED MODULE: ./src/utils/utils.js
2390
+ /**
2391
+ * Copyright 2022 OpenStack Foundation
2392
+ * Licensed under the Apache License, Version 2.0 (the "License");
2393
+ * you may not use this file except in compliance with the License.
2394
+ * You may obtain a copy of the License at
2395
+ * http://www.apache.org/licenses/LICENSE-2.0
2396
+ * Unless required by applicable law or agreed to in writing, software
2397
+ * distributed under the License is distributed on an "AS IS" BASIS,
2398
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2399
+ * See the License for the specific language governing permissions and
2400
+ * limitations under the License.
2401
+ **/
2402
+ const getCurrentProvider = summit => {
2403
+ for (let profile of summit.payment_profiles) {
2404
+ if (profile.application_type === 'Registration') {
2405
+ return {
2406
+ publicKey: profile.test_mode_enabled ? profile.test_publishable_key : profile.live_publishable_key,
2407
+ provider: profile.provider
2408
+ };
2409
+ }
2410
+ }
2411
+
2412
+ return {
2413
+ publicKey: null,
2414
+ provider: ''
2415
+ };
2416
+ };
2388
2417
  ;// CONCATENATED MODULE: ./src/components/registration-lite.js
2389
2418
  const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypes", "getTaxesTypes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToEvent", "goToRegistration", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions"];
2390
2419
 
@@ -2427,6 +2456,7 @@ function registration_lite_objectWithoutPropertiesLoose(source, excluded) { if (
2427
2456
 
2428
2457
 
2429
2458
 
2459
+
2430
2460
  const RegistrationLite = _ref => {
2431
2461
  var _formValues$ticketTyp, _formValues$ticketTyp2;
2432
2462
 
@@ -2496,17 +2526,10 @@ const RegistrationLite = _ref => {
2496
2526
  errors
2497
2527
  }));
2498
2528
 
2499
- let publicKey = null;
2500
- let provider = '';
2501
-
2502
- for (let profile of summitData.payment_profiles) {
2503
- if (profile.application_type === 'Registration') {
2504
- publicKey = profile.test_mode_enabled ? profile.test_publishable_key : profile.live_publishable_key;
2505
- provider = profile.provider;
2506
- break;
2507
- }
2508
- }
2509
-
2529
+ const {
2530
+ publicKey,
2531
+ provider
2532
+ } = getCurrentProvider(summitData);
2510
2533
  (0,external_react_namespaceObject.useEffect)(() => {
2511
2534
  loadSession(registration_lite_objectSpread(registration_lite_objectSpread({}, rest), {}, {
2512
2535
  summitData,
@@ -2525,6 +2548,7 @@ const RegistrationLite = _ref => {
2525
2548
  (0,external_react_namespaceObject.useEffect)(() => {
2526
2549
  if (step === 1 && formValues !== null && formValues !== void 0 && formValues.ticketType && formValues !== null && formValues !== void 0 && formValues.personalInformation) {
2527
2550
  reserveTicket({
2551
+ provider,
2528
2552
  personalInformation: formValues === null || formValues === void 0 ? void 0 : formValues.personalInformation,
2529
2553
  ticket: formValues === null || formValues === void 0 ? void 0 : formValues.ticketType,
2530
2554
  ticketQuantity: formValues === null || formValues === void 0 ? void 0 : formValues.ticketQuantity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "summit-registration-lite",
3
- "version": "2.0.19",
3
+ "version": "2.0.20",
4
4
  "description": "Summit Registration Lite",
5
5
  "main": "index.js",
6
6
  "scripts": {