@pelcro/react-pelcro-js 3.6.0-beta.26 → 3.6.0-beta.28
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 +114 -69
- package/dist/index.esm.js +114 -69
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -5038,7 +5038,8 @@ var labels$h = {
|
|
|
5038
5038
|
active: "Active",
|
|
5039
5039
|
inTrial: "In trial",
|
|
5040
5040
|
endingSoon: "Ending soon",
|
|
5041
|
-
scheduled: "Scheduled"
|
|
5041
|
+
scheduled: "Scheduled",
|
|
5042
|
+
incomplete: "incomplete"
|
|
5042
5043
|
},
|
|
5043
5044
|
shipments: "Shipments remaining",
|
|
5044
5045
|
logout: "Logout",
|
|
@@ -5140,7 +5141,8 @@ var labels$g = {
|
|
|
5140
5141
|
active: "Active",
|
|
5141
5142
|
inTrial: "Dans l'essai",
|
|
5142
5143
|
endingSoon: "Fin bientôt",
|
|
5143
|
-
scheduled: "Programmé"
|
|
5144
|
+
scheduled: "Programmé",
|
|
5145
|
+
incomplete: "incomplète"
|
|
5144
5146
|
},
|
|
5145
5147
|
shipments: "Expéditions restantes",
|
|
5146
5148
|
logout: "Déconnexion",
|
|
@@ -5242,7 +5244,8 @@ var labels$f = {
|
|
|
5242
5244
|
active: "활성화",
|
|
5243
5245
|
inTrial: "체험판 사용",
|
|
5244
5246
|
endingSoon: "만료 예정",
|
|
5245
|
-
scheduled: "예약"
|
|
5247
|
+
scheduled: "예약",
|
|
5248
|
+
incomplete: "불완전한"
|
|
5246
5249
|
},
|
|
5247
5250
|
shipments: "남은 배송 일정",
|
|
5248
5251
|
logout: "로그아웃",
|
|
@@ -15325,7 +15328,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15325
15328
|
} else if (type === "orderCreate") {
|
|
15326
15329
|
purchase(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
|
|
15327
15330
|
} else if (type === "invoicePayment") {
|
|
15328
|
-
payInvoice(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest
|
|
15331
|
+
payInvoice(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest);
|
|
15329
15332
|
} else if (type === "updatePaymentSource") {
|
|
15330
15333
|
createNewTapCard();
|
|
15331
15334
|
}
|
|
@@ -15502,7 +15505,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15502
15505
|
} else if (type === "orderCreate") {
|
|
15503
15506
|
purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
|
|
15504
15507
|
} else if (type === "invoicePayment") {
|
|
15505
|
-
payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest
|
|
15508
|
+
payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest);
|
|
15506
15509
|
} else if (type === "updatePaymentSource") {
|
|
15507
15510
|
createNewVantivCard();
|
|
15508
15511
|
}
|
|
@@ -16025,6 +16028,92 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16025
16028
|
updateTotalAmountWithTax();
|
|
16026
16029
|
}
|
|
16027
16030
|
};
|
|
16031
|
+
/**
|
|
16032
|
+
* Attempt to confirm a Stripe card payment via it's PaymentIntent.
|
|
16033
|
+
* Only trigger method if PaymentIntent status is `requires_action`.
|
|
16034
|
+
*
|
|
16035
|
+
* @see https://stripe.com/docs/payments/intents#intent-statuses
|
|
16036
|
+
*
|
|
16037
|
+
* @param response
|
|
16038
|
+
* @param error
|
|
16039
|
+
* @returns {*}
|
|
16040
|
+
*/
|
|
16041
|
+
|
|
16042
|
+
|
|
16043
|
+
const confirmStripeCardPayment = (response, error) => {
|
|
16044
|
+
if (response) {
|
|
16045
|
+
var _response$data;
|
|
16046
|
+
|
|
16047
|
+
const paymentIntent = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.payment_intent;
|
|
16048
|
+
|
|
16049
|
+
if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_action" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
16050
|
+
stripe.confirmCardPayment(paymentIntent.client_secret).then(res => {
|
|
16051
|
+
console.log("The validation response", res);
|
|
16052
|
+
dispatch({
|
|
16053
|
+
type: DISABLE_SUBMIT,
|
|
16054
|
+
payload: false
|
|
16055
|
+
});
|
|
16056
|
+
dispatch({
|
|
16057
|
+
type: LOADING,
|
|
16058
|
+
payload: false
|
|
16059
|
+
});
|
|
16060
|
+
|
|
16061
|
+
if (res.error) {
|
|
16062
|
+
onFailure(res.error);
|
|
16063
|
+
return dispatch({
|
|
16064
|
+
type: SHOW_ALERT,
|
|
16065
|
+
payload: {
|
|
16066
|
+
type: "error",
|
|
16067
|
+
content: getErrorMessages(res.error)
|
|
16068
|
+
}
|
|
16069
|
+
});
|
|
16070
|
+
}
|
|
16071
|
+
|
|
16072
|
+
onSuccess(res);
|
|
16073
|
+
});
|
|
16074
|
+
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_payment_method" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
16075
|
+
dispatch({
|
|
16076
|
+
type: DISABLE_SUBMIT,
|
|
16077
|
+
payload: false
|
|
16078
|
+
});
|
|
16079
|
+
dispatch({
|
|
16080
|
+
type: LOADING,
|
|
16081
|
+
payload: false
|
|
16082
|
+
});
|
|
16083
|
+
return dispatch({
|
|
16084
|
+
type: SHOW_ALERT,
|
|
16085
|
+
payload: {
|
|
16086
|
+
type: "error",
|
|
16087
|
+
content: t("messages.cardAuthFailed")
|
|
16088
|
+
}
|
|
16089
|
+
});
|
|
16090
|
+
} else {
|
|
16091
|
+
onSuccess(response);
|
|
16092
|
+
}
|
|
16093
|
+
} else {
|
|
16094
|
+
dispatch({
|
|
16095
|
+
type: DISABLE_SUBMIT,
|
|
16096
|
+
payload: false
|
|
16097
|
+
});
|
|
16098
|
+
dispatch({
|
|
16099
|
+
type: LOADING,
|
|
16100
|
+
payload: false
|
|
16101
|
+
});
|
|
16102
|
+
|
|
16103
|
+
if (error) {
|
|
16104
|
+
onFailure(error);
|
|
16105
|
+
return dispatch({
|
|
16106
|
+
type: SHOW_ALERT,
|
|
16107
|
+
payload: {
|
|
16108
|
+
type: "error",
|
|
16109
|
+
content: getErrorMessages(error)
|
|
16110
|
+
}
|
|
16111
|
+
});
|
|
16112
|
+
}
|
|
16113
|
+
|
|
16114
|
+
onSuccess(response);
|
|
16115
|
+
}
|
|
16116
|
+
};
|
|
16028
16117
|
|
|
16029
16118
|
const subscribe = (stripeSource, state, dispatch) => {
|
|
16030
16119
|
const {
|
|
@@ -16047,27 +16136,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16047
16136
|
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
16048
16137
|
address_id: product.address_required ? selectedAddressId : null
|
|
16049
16138
|
}, (err, res) => {
|
|
16050
|
-
|
|
16051
|
-
type: DISABLE_SUBMIT,
|
|
16052
|
-
payload: false
|
|
16053
|
-
});
|
|
16054
|
-
dispatch({
|
|
16055
|
-
type: LOADING,
|
|
16056
|
-
payload: false
|
|
16057
|
-
});
|
|
16058
|
-
|
|
16059
|
-
if (err) {
|
|
16060
|
-
onFailure(err);
|
|
16061
|
-
return dispatch({
|
|
16062
|
-
type: SHOW_ALERT,
|
|
16063
|
-
payload: {
|
|
16064
|
-
type: "error",
|
|
16065
|
-
content: getErrorMessages(err)
|
|
16066
|
-
}
|
|
16067
|
-
});
|
|
16068
|
-
}
|
|
16069
|
-
|
|
16070
|
-
onSuccess(res);
|
|
16139
|
+
confirmStripeCardPayment(res, err);
|
|
16071
16140
|
});
|
|
16072
16141
|
} else {
|
|
16073
16142
|
if (isRenewingGift) {
|
|
@@ -16291,27 +16360,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16291
16360
|
isExistingSource: Boolean(selectedPaymentMethodId),
|
|
16292
16361
|
invoiceId: invoice.id
|
|
16293
16362
|
}, (err, res) => {
|
|
16294
|
-
|
|
16295
|
-
type: DISABLE_SUBMIT,
|
|
16296
|
-
payload: false
|
|
16297
|
-
});
|
|
16298
|
-
dispatch({
|
|
16299
|
-
type: LOADING,
|
|
16300
|
-
payload: false
|
|
16301
|
-
});
|
|
16302
|
-
|
|
16303
|
-
if (err) {
|
|
16304
|
-
onFailure(err);
|
|
16305
|
-
return dispatch({
|
|
16306
|
-
type: SHOW_ALERT,
|
|
16307
|
-
payload: {
|
|
16308
|
-
type: "error",
|
|
16309
|
-
content: getErrorMessages(err)
|
|
16310
|
-
}
|
|
16311
|
-
});
|
|
16312
|
-
}
|
|
16313
|
-
|
|
16314
|
-
onSuccess(res);
|
|
16363
|
+
confirmStripeCardPayment(res, err);
|
|
16315
16364
|
});
|
|
16316
16365
|
};
|
|
16317
16366
|
|
|
@@ -16391,7 +16440,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16391
16440
|
source,
|
|
16392
16441
|
error
|
|
16393
16442
|
}) => {
|
|
16394
|
-
var _ref3, _ref4, _state$updatedPrice2
|
|
16443
|
+
var _ref3, _ref4, _state$updatedPrice2;
|
|
16395
16444
|
|
|
16396
16445
|
if (error) {
|
|
16397
16446
|
return handlePaymentError(error);
|
|
@@ -16417,25 +16466,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16417
16466
|
}, 0);
|
|
16418
16467
|
};
|
|
16419
16468
|
|
|
16420
|
-
|
|
16421
|
-
|
|
16422
|
-
if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
|
|
16423
|
-
return resolveTaxCalculation().then(res => {
|
|
16424
|
-
var _res$totalAmountWithT;
|
|
16425
|
-
|
|
16426
|
-
return generate3DSecureSource(source, (_res$totalAmountWithT = res === null || res === void 0 ? void 0 : res.totalAmountWithTax) !== null && _res$totalAmountWithT !== void 0 ? _res$totalAmountWithT : totalAmount).then(({
|
|
16427
|
-
source,
|
|
16428
|
-
error
|
|
16429
|
-
}) => {
|
|
16430
|
-
if (error) {
|
|
16431
|
-
return handlePaymentError(error);
|
|
16432
|
-
}
|
|
16433
|
-
|
|
16434
|
-
toggleAuthenticationPendingView(true, source);
|
|
16435
|
-
});
|
|
16436
|
-
});
|
|
16437
|
-
}
|
|
16438
|
-
|
|
16469
|
+
(_ref3 = (_ref4 = (_state$updatedPrice2 = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice2 !== void 0 ? _state$updatedPrice2 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref4 !== void 0 ? _ref4 : invoice === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref3 !== void 0 ? _ref3 : getOrderItemsTotal();
|
|
16439
16470
|
return handlePayment(source);
|
|
16440
16471
|
}).catch(error => {
|
|
16441
16472
|
return handlePaymentError(error);
|
|
@@ -16529,7 +16560,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16529
16560
|
} else if (stripeSource && type === "orderCreate") {
|
|
16530
16561
|
purchase(new StripeGateway(), stripeSource.id, state, dispatch);
|
|
16531
16562
|
} else if (stripeSource && type === "invoicePayment") {
|
|
16532
|
-
payInvoice(new StripeGateway(), stripeSource.id
|
|
16563
|
+
payInvoice(new StripeGateway(), stripeSource.id);
|
|
16533
16564
|
}
|
|
16534
16565
|
};
|
|
16535
16566
|
|
|
@@ -16679,7 +16710,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16679
16710
|
case HANDLE_PAYPAL_SUBSCRIPTION:
|
|
16680
16711
|
return lib_5(state, (state, dispatch) => {
|
|
16681
16712
|
if (type === "invoicePayment") {
|
|
16682
|
-
payInvoice(new PaypalGateway(), action.payload
|
|
16713
|
+
payInvoice(new PaypalGateway(), action.payload);
|
|
16683
16714
|
} else {
|
|
16684
16715
|
handlePaypalSubscription(state, action.payload);
|
|
16685
16716
|
}
|
|
@@ -26170,6 +26201,10 @@ class Dashboard extends React.Component {
|
|
|
26170
26201
|
return `${this.locale("labels.canceledOn")} ${formattedCancelDate}`;
|
|
26171
26202
|
}
|
|
26172
26203
|
|
|
26204
|
+
if (subscription.status === "incomplete") {
|
|
26205
|
+
return `${this.locale("labels.status.incomplete")}`;
|
|
26206
|
+
}
|
|
26207
|
+
|
|
26173
26208
|
if (subscription.cancel_at_period_end) {
|
|
26174
26209
|
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
26175
26210
|
const expiryDate = new Date(Number(`${subscription.expires_at}000`));
|
|
@@ -26235,6 +26270,16 @@ class Dashboard extends React.Component {
|
|
|
26235
26270
|
};
|
|
26236
26271
|
}
|
|
26237
26272
|
|
|
26273
|
+
if (sub.status === "incomplete") {
|
|
26274
|
+
return {
|
|
26275
|
+
title: this.locale("labels.status.incomplete"),
|
|
26276
|
+
content: this.getSubscriptionStatusText(sub),
|
|
26277
|
+
textColor: "plc-text-orange-700",
|
|
26278
|
+
bgColor: "plc-bg-orange-100",
|
|
26279
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null)
|
|
26280
|
+
};
|
|
26281
|
+
}
|
|
26282
|
+
|
|
26238
26283
|
return {
|
|
26239
26284
|
title: this.locale("labels.status.active"),
|
|
26240
26285
|
content: this.getSubscriptionStatusText(sub),
|
package/dist/index.esm.js
CHANGED
|
@@ -5008,7 +5008,8 @@ var labels$h = {
|
|
|
5008
5008
|
active: "Active",
|
|
5009
5009
|
inTrial: "In trial",
|
|
5010
5010
|
endingSoon: "Ending soon",
|
|
5011
|
-
scheduled: "Scheduled"
|
|
5011
|
+
scheduled: "Scheduled",
|
|
5012
|
+
incomplete: "incomplete"
|
|
5012
5013
|
},
|
|
5013
5014
|
shipments: "Shipments remaining",
|
|
5014
5015
|
logout: "Logout",
|
|
@@ -5110,7 +5111,8 @@ var labels$g = {
|
|
|
5110
5111
|
active: "Active",
|
|
5111
5112
|
inTrial: "Dans l'essai",
|
|
5112
5113
|
endingSoon: "Fin bientôt",
|
|
5113
|
-
scheduled: "Programmé"
|
|
5114
|
+
scheduled: "Programmé",
|
|
5115
|
+
incomplete: "incomplète"
|
|
5114
5116
|
},
|
|
5115
5117
|
shipments: "Expéditions restantes",
|
|
5116
5118
|
logout: "Déconnexion",
|
|
@@ -5212,7 +5214,8 @@ var labels$f = {
|
|
|
5212
5214
|
active: "활성화",
|
|
5213
5215
|
inTrial: "체험판 사용",
|
|
5214
5216
|
endingSoon: "만료 예정",
|
|
5215
|
-
scheduled: "예약"
|
|
5217
|
+
scheduled: "예약",
|
|
5218
|
+
incomplete: "불완전한"
|
|
5216
5219
|
},
|
|
5217
5220
|
shipments: "남은 배송 일정",
|
|
5218
5221
|
logout: "로그아웃",
|
|
@@ -15295,7 +15298,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15295
15298
|
} else if (type === "orderCreate") {
|
|
15296
15299
|
purchase(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
|
|
15297
15300
|
} else if (type === "invoicePayment") {
|
|
15298
|
-
payInvoice(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest
|
|
15301
|
+
payInvoice(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest);
|
|
15299
15302
|
} else if (type === "updatePaymentSource") {
|
|
15300
15303
|
createNewTapCard();
|
|
15301
15304
|
}
|
|
@@ -15472,7 +15475,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15472
15475
|
} else if (type === "orderCreate") {
|
|
15473
15476
|
purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
|
|
15474
15477
|
} else if (type === "invoicePayment") {
|
|
15475
|
-
payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest
|
|
15478
|
+
payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest);
|
|
15476
15479
|
} else if (type === "updatePaymentSource") {
|
|
15477
15480
|
createNewVantivCard();
|
|
15478
15481
|
}
|
|
@@ -15995,6 +15998,92 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15995
15998
|
updateTotalAmountWithTax();
|
|
15996
15999
|
}
|
|
15997
16000
|
};
|
|
16001
|
+
/**
|
|
16002
|
+
* Attempt to confirm a Stripe card payment via it's PaymentIntent.
|
|
16003
|
+
* Only trigger method if PaymentIntent status is `requires_action`.
|
|
16004
|
+
*
|
|
16005
|
+
* @see https://stripe.com/docs/payments/intents#intent-statuses
|
|
16006
|
+
*
|
|
16007
|
+
* @param response
|
|
16008
|
+
* @param error
|
|
16009
|
+
* @returns {*}
|
|
16010
|
+
*/
|
|
16011
|
+
|
|
16012
|
+
|
|
16013
|
+
const confirmStripeCardPayment = (response, error) => {
|
|
16014
|
+
if (response) {
|
|
16015
|
+
var _response$data;
|
|
16016
|
+
|
|
16017
|
+
const paymentIntent = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.payment_intent;
|
|
16018
|
+
|
|
16019
|
+
if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_action" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
16020
|
+
stripe.confirmCardPayment(paymentIntent.client_secret).then(res => {
|
|
16021
|
+
console.log("The validation response", res);
|
|
16022
|
+
dispatch({
|
|
16023
|
+
type: DISABLE_SUBMIT,
|
|
16024
|
+
payload: false
|
|
16025
|
+
});
|
|
16026
|
+
dispatch({
|
|
16027
|
+
type: LOADING,
|
|
16028
|
+
payload: false
|
|
16029
|
+
});
|
|
16030
|
+
|
|
16031
|
+
if (res.error) {
|
|
16032
|
+
onFailure(res.error);
|
|
16033
|
+
return dispatch({
|
|
16034
|
+
type: SHOW_ALERT,
|
|
16035
|
+
payload: {
|
|
16036
|
+
type: "error",
|
|
16037
|
+
content: getErrorMessages(res.error)
|
|
16038
|
+
}
|
|
16039
|
+
});
|
|
16040
|
+
}
|
|
16041
|
+
|
|
16042
|
+
onSuccess(res);
|
|
16043
|
+
});
|
|
16044
|
+
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_payment_method" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
16045
|
+
dispatch({
|
|
16046
|
+
type: DISABLE_SUBMIT,
|
|
16047
|
+
payload: false
|
|
16048
|
+
});
|
|
16049
|
+
dispatch({
|
|
16050
|
+
type: LOADING,
|
|
16051
|
+
payload: false
|
|
16052
|
+
});
|
|
16053
|
+
return dispatch({
|
|
16054
|
+
type: SHOW_ALERT,
|
|
16055
|
+
payload: {
|
|
16056
|
+
type: "error",
|
|
16057
|
+
content: t("messages.cardAuthFailed")
|
|
16058
|
+
}
|
|
16059
|
+
});
|
|
16060
|
+
} else {
|
|
16061
|
+
onSuccess(response);
|
|
16062
|
+
}
|
|
16063
|
+
} else {
|
|
16064
|
+
dispatch({
|
|
16065
|
+
type: DISABLE_SUBMIT,
|
|
16066
|
+
payload: false
|
|
16067
|
+
});
|
|
16068
|
+
dispatch({
|
|
16069
|
+
type: LOADING,
|
|
16070
|
+
payload: false
|
|
16071
|
+
});
|
|
16072
|
+
|
|
16073
|
+
if (error) {
|
|
16074
|
+
onFailure(error);
|
|
16075
|
+
return dispatch({
|
|
16076
|
+
type: SHOW_ALERT,
|
|
16077
|
+
payload: {
|
|
16078
|
+
type: "error",
|
|
16079
|
+
content: getErrorMessages(error)
|
|
16080
|
+
}
|
|
16081
|
+
});
|
|
16082
|
+
}
|
|
16083
|
+
|
|
16084
|
+
onSuccess(response);
|
|
16085
|
+
}
|
|
16086
|
+
};
|
|
15998
16087
|
|
|
15999
16088
|
const subscribe = (stripeSource, state, dispatch) => {
|
|
16000
16089
|
const {
|
|
@@ -16017,27 +16106,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16017
16106
|
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
16018
16107
|
address_id: product.address_required ? selectedAddressId : null
|
|
16019
16108
|
}, (err, res) => {
|
|
16020
|
-
|
|
16021
|
-
type: DISABLE_SUBMIT,
|
|
16022
|
-
payload: false
|
|
16023
|
-
});
|
|
16024
|
-
dispatch({
|
|
16025
|
-
type: LOADING,
|
|
16026
|
-
payload: false
|
|
16027
|
-
});
|
|
16028
|
-
|
|
16029
|
-
if (err) {
|
|
16030
|
-
onFailure(err);
|
|
16031
|
-
return dispatch({
|
|
16032
|
-
type: SHOW_ALERT,
|
|
16033
|
-
payload: {
|
|
16034
|
-
type: "error",
|
|
16035
|
-
content: getErrorMessages(err)
|
|
16036
|
-
}
|
|
16037
|
-
});
|
|
16038
|
-
}
|
|
16039
|
-
|
|
16040
|
-
onSuccess(res);
|
|
16109
|
+
confirmStripeCardPayment(res, err);
|
|
16041
16110
|
});
|
|
16042
16111
|
} else {
|
|
16043
16112
|
if (isRenewingGift) {
|
|
@@ -16261,27 +16330,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16261
16330
|
isExistingSource: Boolean(selectedPaymentMethodId),
|
|
16262
16331
|
invoiceId: invoice.id
|
|
16263
16332
|
}, (err, res) => {
|
|
16264
|
-
|
|
16265
|
-
type: DISABLE_SUBMIT,
|
|
16266
|
-
payload: false
|
|
16267
|
-
});
|
|
16268
|
-
dispatch({
|
|
16269
|
-
type: LOADING,
|
|
16270
|
-
payload: false
|
|
16271
|
-
});
|
|
16272
|
-
|
|
16273
|
-
if (err) {
|
|
16274
|
-
onFailure(err);
|
|
16275
|
-
return dispatch({
|
|
16276
|
-
type: SHOW_ALERT,
|
|
16277
|
-
payload: {
|
|
16278
|
-
type: "error",
|
|
16279
|
-
content: getErrorMessages(err)
|
|
16280
|
-
}
|
|
16281
|
-
});
|
|
16282
|
-
}
|
|
16283
|
-
|
|
16284
|
-
onSuccess(res);
|
|
16333
|
+
confirmStripeCardPayment(res, err);
|
|
16285
16334
|
});
|
|
16286
16335
|
};
|
|
16287
16336
|
|
|
@@ -16361,7 +16410,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16361
16410
|
source,
|
|
16362
16411
|
error
|
|
16363
16412
|
}) => {
|
|
16364
|
-
var _ref3, _ref4, _state$updatedPrice2
|
|
16413
|
+
var _ref3, _ref4, _state$updatedPrice2;
|
|
16365
16414
|
|
|
16366
16415
|
if (error) {
|
|
16367
16416
|
return handlePaymentError(error);
|
|
@@ -16387,25 +16436,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16387
16436
|
}, 0);
|
|
16388
16437
|
};
|
|
16389
16438
|
|
|
16390
|
-
|
|
16391
|
-
|
|
16392
|
-
if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
|
|
16393
|
-
return resolveTaxCalculation().then(res => {
|
|
16394
|
-
var _res$totalAmountWithT;
|
|
16395
|
-
|
|
16396
|
-
return generate3DSecureSource(source, (_res$totalAmountWithT = res === null || res === void 0 ? void 0 : res.totalAmountWithTax) !== null && _res$totalAmountWithT !== void 0 ? _res$totalAmountWithT : totalAmount).then(({
|
|
16397
|
-
source,
|
|
16398
|
-
error
|
|
16399
|
-
}) => {
|
|
16400
|
-
if (error) {
|
|
16401
|
-
return handlePaymentError(error);
|
|
16402
|
-
}
|
|
16403
|
-
|
|
16404
|
-
toggleAuthenticationPendingView(true, source);
|
|
16405
|
-
});
|
|
16406
|
-
});
|
|
16407
|
-
}
|
|
16408
|
-
|
|
16439
|
+
(_ref3 = (_ref4 = (_state$updatedPrice2 = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice2 !== void 0 ? _state$updatedPrice2 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref4 !== void 0 ? _ref4 : invoice === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref3 !== void 0 ? _ref3 : getOrderItemsTotal();
|
|
16409
16440
|
return handlePayment(source);
|
|
16410
16441
|
}).catch(error => {
|
|
16411
16442
|
return handlePaymentError(error);
|
|
@@ -16499,7 +16530,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16499
16530
|
} else if (stripeSource && type === "orderCreate") {
|
|
16500
16531
|
purchase(new StripeGateway(), stripeSource.id, state, dispatch);
|
|
16501
16532
|
} else if (stripeSource && type === "invoicePayment") {
|
|
16502
|
-
payInvoice(new StripeGateway(), stripeSource.id
|
|
16533
|
+
payInvoice(new StripeGateway(), stripeSource.id);
|
|
16503
16534
|
}
|
|
16504
16535
|
};
|
|
16505
16536
|
|
|
@@ -16649,7 +16680,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16649
16680
|
case HANDLE_PAYPAL_SUBSCRIPTION:
|
|
16650
16681
|
return lib_5(state, (state, dispatch) => {
|
|
16651
16682
|
if (type === "invoicePayment") {
|
|
16652
|
-
payInvoice(new PaypalGateway(), action.payload
|
|
16683
|
+
payInvoice(new PaypalGateway(), action.payload);
|
|
16653
16684
|
} else {
|
|
16654
16685
|
handlePaypalSubscription(state, action.payload);
|
|
16655
16686
|
}
|
|
@@ -26140,6 +26171,10 @@ class Dashboard extends Component {
|
|
|
26140
26171
|
return `${this.locale("labels.canceledOn")} ${formattedCancelDate}`;
|
|
26141
26172
|
}
|
|
26142
26173
|
|
|
26174
|
+
if (subscription.status === "incomplete") {
|
|
26175
|
+
return `${this.locale("labels.status.incomplete")}`;
|
|
26176
|
+
}
|
|
26177
|
+
|
|
26143
26178
|
if (subscription.cancel_at_period_end) {
|
|
26144
26179
|
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
26145
26180
|
const expiryDate = new Date(Number(`${subscription.expires_at}000`));
|
|
@@ -26205,6 +26240,16 @@ class Dashboard extends Component {
|
|
|
26205
26240
|
};
|
|
26206
26241
|
}
|
|
26207
26242
|
|
|
26243
|
+
if (sub.status === "incomplete") {
|
|
26244
|
+
return {
|
|
26245
|
+
title: this.locale("labels.status.incomplete"),
|
|
26246
|
+
content: this.getSubscriptionStatusText(sub),
|
|
26247
|
+
textColor: "plc-text-orange-700",
|
|
26248
|
+
bgColor: "plc-bg-orange-100",
|
|
26249
|
+
icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null)
|
|
26250
|
+
};
|
|
26251
|
+
}
|
|
26252
|
+
|
|
26208
26253
|
return {
|
|
26209
26254
|
title: this.locale("labels.status.active"),
|
|
26210
26255
|
content: this.getSubscriptionStatusText(sub),
|