@sonic-equipment/ui 258.0.2 → 258.0.3
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.
|
@@ -153,6 +153,7 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
|
|
|
153
153
|
catch (error) {
|
|
154
154
|
logger.error(error);
|
|
155
155
|
invalidateCurrentCart();
|
|
156
|
+
onProcessing(false);
|
|
156
157
|
}
|
|
157
158
|
finally {
|
|
158
159
|
onProcessing(false);
|
|
@@ -175,6 +176,7 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
|
|
|
175
176
|
logger.error(error);
|
|
176
177
|
setPaymentError(error);
|
|
177
178
|
invalidateCurrentCart();
|
|
179
|
+
onProcessing(false);
|
|
178
180
|
}
|
|
179
181
|
finally {
|
|
180
182
|
onProcessing(false);
|
|
@@ -207,6 +209,7 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
|
|
|
207
209
|
}
|
|
208
210
|
catch (error) {
|
|
209
211
|
logger.error(error);
|
|
212
|
+
onProcessing(false);
|
|
210
213
|
setAPIError(error);
|
|
211
214
|
}
|
|
212
215
|
finally {
|
|
@@ -215,10 +218,10 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
|
|
|
215
218
|
}
|
|
216
219
|
}, [onPaymentComplete, onPlaceOrderCompleted, onProcessing, placeOrder]);
|
|
217
220
|
const onError = useCallback((error, result) => {
|
|
218
|
-
onProcessing(false);
|
|
219
221
|
invalidateAdyen();
|
|
220
222
|
setPaymentError(error);
|
|
221
223
|
logger.error(error);
|
|
224
|
+
onProcessing(false);
|
|
222
225
|
_onError?.(error, result);
|
|
223
226
|
}, [_onError, invalidateAdyen, onProcessing]);
|
|
224
227
|
return (jsxs(Form, { className: styles['payment-form'], "data-test-selector": "paymentForm", id: form, onSubmit: e => {
|
|
@@ -31,7 +31,7 @@ function PaymentPageContent({ atp, cart, formId, hasAtp, isProcessing, onPayment
|
|
|
31
31
|
], "data-test-selector": "paymentPage", title: t('Review and payment'), children: jsxs(CheckoutPageLayout, { actions: {
|
|
32
32
|
primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutReviewAndSubmit_placeOrder", form: formId, isDisabled: isProcessing, isLoading: isProcessing ? jsx(FormattedMessage, { id: "Processing" }) : false, type: "submit", children: cart.paymentMethod?.name === 'PBI' ? (jsx(FormattedMessage, { id: "Finalize order" })) : (jsx(FormattedMessage, { id: "Finalize payment" })) })),
|
|
33
33
|
}, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: cart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, deliveryDate: hasAtp ? undefined : cart.requestedDeliveryDate, fulfillmentMethod: cart.fulfillmentMethod, isPayByInvoice: (cart.paymentOptions?.paymentMethods?.length || 1) <= 1 &&
|
|
34
|
-
cart.paymentMethod?.name === 'PBI', shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: formId, isProcessing: isProcessing, onPaymentComplete: onPaymentComplete, onProcessing: setIsProcessing }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Order" }), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date ?? null, href: cartLine.productUri, image: {
|
|
34
|
+
cart.paymentMethod?.name === 'PBI', shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: formId, isProcessing: isProcessing, onError: () => setIsProcessing(false), onPaymentComplete: onPaymentComplete, onProcessing: setIsProcessing }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Order" }), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date ?? null, href: cartLine.productUri, image: {
|
|
35
35
|
fit: 'contain',
|
|
36
36
|
image: {
|
|
37
37
|
'1': cartLine.smallImagePath,
|