@stigg/react-sdk 4.4.1 → 4.4.2
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/components/checkout/CheckoutContainer.d.ts +2 -1
- package/dist/components/checkout/index.d.ts +3 -2
- package/dist/components/checkout/steps/payment/PaymentMethods.d.ts +2 -2
- package/dist/components/checkout/steps/payment/PaymentStep.d.ts +1 -1
- package/dist/components/checkout/steps/payment/stripe/StripePaymentForm.d.ts +1 -1
- package/dist/react-sdk.cjs.development.js +20 -10
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +20 -10
- package/dist/react-sdk.esm.js.map +1 -1
- package/dist/stories/mocks/checkout/mockCheckoutState.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/checkout/CheckoutContainer.tsx +14 -4
- package/src/components/checkout/index.ts +8 -2
- package/src/components/checkout/steps/payment/PaymentMethods.tsx +3 -2
- package/src/components/checkout/steps/payment/PaymentStep.tsx +5 -1
- package/src/components/checkout/steps/payment/stripe/StripePaymentForm.tsx +6 -2
- package/src/stories/mocks/checkout/mockCheckoutState.ts +1 -1
package/dist/react-sdk.esm.js
CHANGED
|
@@ -8339,7 +8339,8 @@ var _excluded$6 = ["postal_code"];
|
|
|
8339
8339
|
function StripePaymentForm(_ref) {
|
|
8340
8340
|
var _configuration$conten;
|
|
8341
8341
|
|
|
8342
|
-
var onBillingAddressChange = _ref.onBillingAddressChange
|
|
8342
|
+
var onBillingAddressChange = _ref.onBillingAddressChange,
|
|
8343
|
+
collectPhoneNumber = _ref.collectPhoneNumber;
|
|
8343
8344
|
|
|
8344
8345
|
var _useCheckoutModel = useCheckoutModel(),
|
|
8345
8346
|
checkoutState = _useCheckoutModel.checkoutState,
|
|
@@ -8355,6 +8356,7 @@ function StripePaymentForm(_ref) {
|
|
|
8355
8356
|
configuration = _ref2.configuration;
|
|
8356
8357
|
|
|
8357
8358
|
var readOnly = widgetState.readOnly;
|
|
8359
|
+
var shouldCollectPhoneNumber = !!(collectPhoneNumber != null ? collectPhoneNumber : configuration == null ? void 0 : (_configuration$conten = configuration.content) == null ? void 0 : _configuration$conten.collectPhoneNumber);
|
|
8358
8360
|
|
|
8359
8361
|
var handleAddressChange = function handleAddressChange(args) {
|
|
8360
8362
|
if (!args.complete) {
|
|
@@ -8425,7 +8427,7 @@ function StripePaymentForm(_ref) {
|
|
|
8425
8427
|
options: {
|
|
8426
8428
|
mode: 'billing',
|
|
8427
8429
|
fields: {
|
|
8428
|
-
phone:
|
|
8430
|
+
phone: shouldCollectPhoneNumber ? 'always' : 'auto'
|
|
8429
8431
|
},
|
|
8430
8432
|
defaultValues: _extends({}, (customer == null ? void 0 : customer.name) && {
|
|
8431
8433
|
name: customer.name
|
|
@@ -13228,7 +13230,8 @@ function NewPaymentMethod(_ref3) {
|
|
|
13228
13230
|
onSelect = _ref3.onSelect,
|
|
13229
13231
|
readOnly = _ref3.readOnly,
|
|
13230
13232
|
checkoutLocalization = _ref3.checkoutLocalization,
|
|
13231
|
-
onBillingAddressChange = _ref3.onBillingAddressChange
|
|
13233
|
+
onBillingAddressChange = _ref3.onBillingAddressChange,
|
|
13234
|
+
collectPhoneNumber = _ref3.collectPhoneNumber;
|
|
13232
13235
|
return React__default.createElement(NewPaymentMethodContainer, {
|
|
13233
13236
|
item: true,
|
|
13234
13237
|
onClick: onSelect,
|
|
@@ -13243,14 +13246,16 @@ function NewPaymentMethod(_ref3) {
|
|
|
13243
13246
|
}), React__default.createElement(Collapse, {
|
|
13244
13247
|
"in": checked
|
|
13245
13248
|
}, React__default.createElement(StripePaymentForm, {
|
|
13246
|
-
onBillingAddressChange: onBillingAddressChange
|
|
13249
|
+
onBillingAddressChange: onBillingAddressChange,
|
|
13250
|
+
collectPhoneNumber: collectPhoneNumber
|
|
13247
13251
|
})));
|
|
13248
13252
|
}
|
|
13249
13253
|
|
|
13250
13254
|
var _templateObject$8;
|
|
13251
13255
|
var PaymentContainer = /*#__PURE__*/styled$1(Grid)(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 24px;\n"])));
|
|
13252
13256
|
function PaymentStep(_ref) {
|
|
13253
|
-
var onBillingAddressChange = _ref.onBillingAddressChange
|
|
13257
|
+
var onBillingAddressChange = _ref.onBillingAddressChange,
|
|
13258
|
+
collectPhoneNumber = _ref.collectPhoneNumber;
|
|
13254
13259
|
|
|
13255
13260
|
var _useCheckoutModel = useCheckoutModel(),
|
|
13256
13261
|
checkoutState = _useCheckoutModel.checkoutState,
|
|
@@ -13298,7 +13303,8 @@ function PaymentStep(_ref) {
|
|
|
13298
13303
|
onSelect: function onSelect() {
|
|
13299
13304
|
return handleOnSelect(true);
|
|
13300
13305
|
},
|
|
13301
|
-
onBillingAddressChange: onBillingAddressChange
|
|
13306
|
+
onBillingAddressChange: onBillingAddressChange,
|
|
13307
|
+
collectPhoneNumber: collectPhoneNumber
|
|
13302
13308
|
}));
|
|
13303
13309
|
}
|
|
13304
13310
|
|
|
@@ -13926,7 +13932,8 @@ var DowngradeToFreePlan = function DowngradeToFreePlan(_ref3) {
|
|
|
13926
13932
|
|
|
13927
13933
|
var getStepProps = function getStepProps(currentStep, _ref) {
|
|
13928
13934
|
var onBillingAddressChange = _ref.onBillingAddressChange,
|
|
13929
|
-
onChangePlan = _ref.onChangePlan
|
|
13935
|
+
onChangePlan = _ref.onChangePlan,
|
|
13936
|
+
collectPhoneNumber = _ref.collectPhoneNumber;
|
|
13930
13937
|
|
|
13931
13938
|
switch (currentStep.key) {
|
|
13932
13939
|
case CheckoutStepKey.PLAN:
|
|
@@ -13944,7 +13951,8 @@ var getStepProps = function getStepProps(currentStep, _ref) {
|
|
|
13944
13951
|
case CheckoutStepKey.PAYMENT:
|
|
13945
13952
|
return {
|
|
13946
13953
|
content: React__default.createElement(PaymentStep, {
|
|
13947
|
-
onBillingAddressChange: onBillingAddressChange
|
|
13954
|
+
onBillingAddressChange: onBillingAddressChange,
|
|
13955
|
+
collectPhoneNumber: collectPhoneNumber
|
|
13948
13956
|
})
|
|
13949
13957
|
};
|
|
13950
13958
|
|
|
@@ -13960,6 +13968,7 @@ function CheckoutContainer(_ref2) {
|
|
|
13960
13968
|
onCheckoutCompleted = _ref2.onCheckoutCompleted,
|
|
13961
13969
|
onChangePlan = _ref2.onChangePlan,
|
|
13962
13970
|
onBillingAddressChange = _ref2.onBillingAddressChange,
|
|
13971
|
+
collectPhoneNumber = _ref2.collectPhoneNumber,
|
|
13963
13972
|
disablePromotionCode = _ref2.disablePromotionCode,
|
|
13964
13973
|
disableSuccessAnimation = _ref2.disableSuccessAnimation,
|
|
13965
13974
|
onMockCheckoutPreview = _ref2.onMockCheckoutPreview;
|
|
@@ -13990,15 +13999,16 @@ function CheckoutContainer(_ref2) {
|
|
|
13990
13999
|
|
|
13991
14000
|
var _getStepProps = getStepProps(currentStep, {
|
|
13992
14001
|
onBillingAddressChange: onBillingAddressChange,
|
|
13993
|
-
onChangePlan: onChangePlan
|
|
14002
|
+
onChangePlan: onChangePlan,
|
|
14003
|
+
collectPhoneNumber: collectPhoneNumber
|
|
13994
14004
|
}),
|
|
13995
14005
|
content = _getStepProps.content;
|
|
13996
14006
|
|
|
13997
14007
|
var checkoutContent = React__default.createElement(React__default.Fragment, null, isFreeDowngrade ? React__default.createElement(DowngradeToFreePlan, {
|
|
13998
|
-
checkoutLocalization: checkoutLocalization,
|
|
13999
14008
|
freePlan: plan,
|
|
14000
14009
|
activeSubscription: activeSubscription,
|
|
14001
14010
|
allowChangePlan: true,
|
|
14011
|
+
checkoutLocalization: checkoutLocalization,
|
|
14002
14012
|
onChangePlan: onChangePlan
|
|
14003
14013
|
}) : React__default.createElement(React__default.Fragment, null, content));
|
|
14004
14014
|
var stripeElementsMode = useMemo(function () {
|