summit-registration-lite 2.0.15 → 2.0.18

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 +51 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -98,7 +98,7 @@ class LawPayProvider {
98
98
  userProfile,
99
99
  access_token,
100
100
  apiBaseUrl,
101
- dispatch
101
+ dispatch: _dispatch
102
102
  }) {
103
103
  _defineProperty(this, "payTicket", ({
104
104
  token
@@ -107,19 +107,27 @@ class LawPayProvider {
107
107
 
108
108
  // Pay using affinity lawpay
109
109
  const errorHandler = (err, res) => (dispatch, state) => {
110
- if (res && res.statusCode === 404) {
111
- const msg = res.body.message;
112
- external_sweetalert2_default().fire("Validation Error", msg, "warning");
113
- return;
114
- }
110
+ let code = err.status;
115
111
 
116
- if (res && res.statusCode === 500) {
117
- const msg = res.body.message;
118
- external_sweetalert2_default().fire("Server Error", msg, "error");
119
- return;
120
- }
112
+ switch (code) {
113
+ case 404:
114
+ {
115
+ let msg = res.body.message;
116
+ external_sweetalert2_default().fire("Validation Error", msg, "warning");
117
+ }
118
+ break;
121
119
 
122
- return (0,actions_namespaceObject.authErrorHandler)(err, res);
120
+ case 500:
121
+ {
122
+ let msg = res.body.message;
123
+ external_sweetalert2_default().fire("Validation Error", msg, "warning");
124
+ }
125
+ break;
126
+
127
+ default:
128
+ (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
129
+ break;
130
+ }
123
131
  };
124
132
 
125
133
  let params = {
@@ -172,7 +180,7 @@ class LawPayProvider {
172
180
  this.userProfile = userProfile;
173
181
  this.access_token = access_token;
174
182
  this.apiBaseUrl = apiBaseUrl;
175
- this.dispatch = dispatch;
183
+ this.dispatch = _dispatch;
176
184
  }
177
185
 
178
186
  }
@@ -200,19 +208,27 @@ class StripeProvider {
200
208
  var _this$userProfile, _this$userProfile2, _this$userProfile3, _this$userProfile4, _this$userProfile5;
201
209
 
202
210
  const errorHandler = (err, res) => (dispatch, state) => {
203
- if (res && res.statusCode === 404) {
204
- const msg = res.body.message;
205
- external_sweetalert2_default().fire("Validation Error", msg, "warning");
206
- return;
207
- }
211
+ let code = err.status;
208
212
 
209
- if (res && res.statusCode === 500) {
210
- const msg = res.body.message;
211
- external_sweetalert2_default().fire("Server Error", msg, "error");
212
- return;
213
- }
213
+ switch (code) {
214
+ case 404:
215
+ {
216
+ let msg = res.body.message;
217
+ external_sweetalert2_default().fire("Validation Error", msg, "warning");
218
+ }
219
+ break;
220
+
221
+ case 500:
222
+ {
223
+ let msg = res.body.message;
224
+ external_sweetalert2_default().fire("Validation Error", msg, "warning");
225
+ }
226
+ break;
214
227
 
215
- return (0,actions_namespaceObject.authErrorHandler)(err, res);
228
+ default:
229
+ (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
230
+ break;
231
+ }
216
232
  };
217
233
 
218
234
  let params = {
@@ -470,7 +486,7 @@ const reserveTicket = ({
470
486
  return;
471
487
  }
472
488
 
473
- return (0,actions_namespaceObject.authErrorHandler)(err, res);
489
+ return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
474
490
  };
475
491
 
476
492
  return (0,actions_namespaceObject.postRequest)((0,actions_namespaceObject.createAction)(CREATE_RESERVATION), (0,actions_namespaceObject.createAction)(CREATE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/reserve`, normalizedEntity, errorHandler // entity
@@ -985,7 +1001,7 @@ function lawpay_form_objectSpread(target) { for (var i = 1; i < arguments.length
985
1001
  function lawpay_form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
986
1002
 
987
1003
  /**
988
- * Copyright 2020 OpenStack Foundation
1004
+ * Copyright 2022 OpenStack Foundation
989
1005
  * Licensed under the Apache License, Version 2.0 (the "License");
990
1006
  * you may not use this file except in compliance with the License.
991
1007
  * You may obtain a copy of the License at
@@ -1017,7 +1033,9 @@ const LawPayForm = ({
1017
1033
  exp_month: '',
1018
1034
  exp_year: '',
1019
1035
  postal_code: userProfile.postal_code || '',
1020
- address1: userProfile.address1 || ''
1036
+ address1: userProfile.address1 || '',
1037
+ email: userProfile.email,
1038
+ name: `${userProfile.given_name} ${userProfile.family_name}`
1021
1039
  });
1022
1040
  const [lawPayErrors, setLawPayErrors] = (0,external_react_namespaceObject.useState)({
1023
1041
  exp_month: '',
@@ -1105,7 +1123,10 @@ const LawPayForm = ({
1105
1123
  "postal_code": lawPayFields.postal_code,
1106
1124
  "address1": lawPayFields.address1,
1107
1125
  "exp_year": lawPayFields.exp_year,
1108
- "exp_month": lawPayFields.exp_month
1126
+ "exp_month": lawPayFields.exp_month,
1127
+ "email": lawPayFields.email,
1128
+ "name": lawPayFields.name,
1129
+ "reference": `summit_${reservation.summit_id}_order_${reservation.id}`
1109
1130
  });
1110
1131
  payTicket(provider, {
1111
1132
  token
@@ -1628,7 +1649,6 @@ function personal_information_defineProperty(obj, key, value) { if (key in obj)
1628
1649
 
1629
1650
 
1630
1651
 
1631
-
1632
1652
  const PersonalInfoComponent = ({
1633
1653
  isActive,
1634
1654
  changeForm,
@@ -1818,7 +1838,7 @@ const PersonalInfoComponent = ({
1818
1838
  id: "promo-code-info"
1819
1839
  }, /*#__PURE__*/external_react_default().createElement("div", {
1820
1840
  className: personal_information_index_module.moreInfoTooltip
1821
- }, "In order to use multiple promo codes, you may place a new registration order with the new promo code after you complete this order. This promo code will be applied to all tickets in this order.")), formErrors.length > 0 && /*#__PURE__*/external_react_default().createElement("div", {
1841
+ }, "Promo code will be applied to all tickets in this order. If you wish to utilize more than one promo code, simply place another order after you complete this registration order. Only one promo code can be applied per order.")), formErrors.length > 0 && /*#__PURE__*/external_react_default().createElement("div", {
1822
1842
  className: `${personal_information_index_module.formErrors} alert alert-danger`
1823
1843
  }, formErrors.map((error, index) => /*#__PURE__*/external_react_default().createElement("div", {
1824
1844
  key: index
@@ -2088,7 +2108,7 @@ const TicketTypeComponent = ({
2088
2108
  id: "ticket-quantity-info"
2089
2109
  }, /*#__PURE__*/external_react_default().createElement("div", {
2090
2110
  className: ticket_type_index_module.moreInfoTooltip
2091
- }, "In order to select multiple tickets of a different type, you may place a new registration order after you complete this order.")))), inPersonDisclaimer && ticket && isInPersonTicketType(ticket) && /*#__PURE__*/external_react_default().createElement("div", {
2111
+ }, "To purchase more than one ticket type, simply place another order after this registration order is complete. Only one ticket type can be chosen per order.")))), inPersonDisclaimer && ticket && isInPersonTicketType(ticket) && /*#__PURE__*/external_react_default().createElement("div", {
2092
2112
  className: ticket_type_index_module.inPersonDisclaimer
2093
2113
  }, /*#__PURE__*/external_react_default().createElement((raw_html_default()), null, inPersonDisclaimer)))));
2094
2114
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "summit-registration-lite",
3
- "version": "2.0.15",
3
+ "version": "2.0.18",
4
4
  "description": "Summit Registration Lite",
5
5
  "main": "index.js",
6
6
  "scripts": {