summit-registration-lite 6.0.3 → 6.0.5-beta.1

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.js CHANGED
@@ -1981,6 +1981,12 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
1981
1981
  }
1982
1982
 
1983
1983
  case DELETE_RESERVATION_SUCCESS:
1984
+ {
1985
+ return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
1986
+ reservation: null
1987
+ });
1988
+ }
1989
+
1984
1990
  case CLEAR_RESERVATION:
1985
1991
  {
1986
1992
  return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
@@ -2512,7 +2518,9 @@ const stripeErrorCodeMap = {
2512
2518
  };
2513
2519
 
2514
2520
  const StripeForm = ({
2521
+ reservation,
2515
2522
  payTicket,
2523
+ userProfile,
2516
2524
  provider,
2517
2525
  hidePostalCode,
2518
2526
  stripeReturnUrl,
@@ -2563,20 +2571,25 @@ const StripeForm = ({
2563
2571
  // Create a payment method using PaymentElement
2564
2572
  let createPaymentMethodOptions = {
2565
2573
  elements
2566
- }; // provide info empty
2567
-
2568
- if (hidePostalCode) {
2569
- createPaymentMethodOptions = stripe_form_objectSpread(stripe_form_objectSpread({}, createPaymentMethodOptions), {}, {
2570
- params: {
2571
- billing_details: {
2572
- address: {
2573
- postal_code: ""
2574
- }
2575
- }
2576
- }
2577
- });
2578
- }
2579
-
2574
+ };
2575
+ let address = {}; // stripe payment payload requires data that's not an empty string
2576
+
2577
+ if (userProfile.locality) address.city = userProfile.locality;
2578
+ if (userProfile.country) address.country = userProfile.country;
2579
+ if (userProfile.address1) address.line1 = userProfile.address1;
2580
+ if (userProfile.address2) address.line2 = userProfile.address2;
2581
+ if (!hidePostalCode && userProfile.postal_code) address.postal_code = userProfile.postal_code;
2582
+ if (userProfile.region) address.state = userProfile.region;
2583
+ createPaymentMethodOptions = stripe_form_objectSpread(stripe_form_objectSpread({}, createPaymentMethodOptions), {}, {
2584
+ params: {
2585
+ billing_details: stripe_form_objectSpread(stripe_form_objectSpread({}, Object.keys(address).length > 0 && {
2586
+ address
2587
+ }), {}, {
2588
+ email: userProfile.email,
2589
+ name: `${reservation.owner_first_name} ${reservation.owner_last_name}`
2590
+ })
2591
+ }
2592
+ });
2580
2593
  const {
2581
2594
  paymentMethod,
2582
2595
  error