@pelcro/react-pelcro-js 4.0.0-alpha.54 → 4.0.0-alpha.55
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.cjs.js +18 -1
- package/dist/index.esm.js +18 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -24218,7 +24218,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
24218
24218
|
|
|
24219
24219
|
const setupIntent = (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.setup_intent;
|
|
24220
24220
|
|
|
24221
|
-
if (setupIntent !== null && setupIntent !== void 0 && setupIntent.client_secret) {
|
|
24221
|
+
if ((setupIntent === null || setupIntent === void 0 ? void 0 : setupIntent.status) === "requires_action" && setupIntent !== null && setupIntent !== void 0 && setupIntent.client_secret) {
|
|
24222
24222
|
var _response$data3, _response$data3$sourc;
|
|
24223
24223
|
|
|
24224
24224
|
stripe.confirmCardSetup(setupIntent.client_secret, {
|
|
@@ -24245,6 +24245,19 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
24245
24245
|
});
|
|
24246
24246
|
}
|
|
24247
24247
|
|
|
24248
|
+
if (flow === "subCreate") {
|
|
24249
|
+
dispatch({
|
|
24250
|
+
type: DISABLE_SUBMIT,
|
|
24251
|
+
payload: false
|
|
24252
|
+
});
|
|
24253
|
+
dispatch({
|
|
24254
|
+
type: LOADING,
|
|
24255
|
+
payload: false
|
|
24256
|
+
});
|
|
24257
|
+
onSuccess(res);
|
|
24258
|
+
return;
|
|
24259
|
+
}
|
|
24260
|
+
|
|
24248
24261
|
if (flow === "create") {
|
|
24249
24262
|
dispatch({
|
|
24250
24263
|
type: LOADING,
|
|
@@ -24341,6 +24354,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
24341
24354
|
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
24342
24355
|
address_id: product.address_required ? selectedAddressId : null
|
|
24343
24356
|
}, (err, res) => {
|
|
24357
|
+
if (res.data.setup_intent) {
|
|
24358
|
+
return confirmStripeIntentSetup(res, "subCreate");
|
|
24359
|
+
}
|
|
24360
|
+
|
|
24344
24361
|
confirmStripeCardPayment(res, err, true);
|
|
24345
24362
|
});
|
|
24346
24363
|
} else {
|
package/dist/index.esm.js
CHANGED
|
@@ -24188,7 +24188,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
24188
24188
|
|
|
24189
24189
|
const setupIntent = (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.setup_intent;
|
|
24190
24190
|
|
|
24191
|
-
if (setupIntent !== null && setupIntent !== void 0 && setupIntent.client_secret) {
|
|
24191
|
+
if ((setupIntent === null || setupIntent === void 0 ? void 0 : setupIntent.status) === "requires_action" && setupIntent !== null && setupIntent !== void 0 && setupIntent.client_secret) {
|
|
24192
24192
|
var _response$data3, _response$data3$sourc;
|
|
24193
24193
|
|
|
24194
24194
|
stripe.confirmCardSetup(setupIntent.client_secret, {
|
|
@@ -24215,6 +24215,19 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
24215
24215
|
});
|
|
24216
24216
|
}
|
|
24217
24217
|
|
|
24218
|
+
if (flow === "subCreate") {
|
|
24219
|
+
dispatch({
|
|
24220
|
+
type: DISABLE_SUBMIT,
|
|
24221
|
+
payload: false
|
|
24222
|
+
});
|
|
24223
|
+
dispatch({
|
|
24224
|
+
type: LOADING,
|
|
24225
|
+
payload: false
|
|
24226
|
+
});
|
|
24227
|
+
onSuccess(res);
|
|
24228
|
+
return;
|
|
24229
|
+
}
|
|
24230
|
+
|
|
24218
24231
|
if (flow === "create") {
|
|
24219
24232
|
dispatch({
|
|
24220
24233
|
type: LOADING,
|
|
@@ -24311,6 +24324,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
24311
24324
|
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
24312
24325
|
address_id: product.address_required ? selectedAddressId : null
|
|
24313
24326
|
}, (err, res) => {
|
|
24327
|
+
if (res.data.setup_intent) {
|
|
24328
|
+
return confirmStripeIntentSetup(res, "subCreate");
|
|
24329
|
+
}
|
|
24330
|
+
|
|
24314
24331
|
confirmStripeCardPayment(res, err, true);
|
|
24315
24332
|
});
|
|
24316
24333
|
} else {
|