@sonic-equipment/ui 248.0.2 → 248.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.
|
@@ -140,16 +140,14 @@ function getAndRemoveAdyenQueryParams() {
|
|
|
140
140
|
return {};
|
|
141
141
|
const params = qs.parse(window.location.search || '');
|
|
142
142
|
const { amount, customerId, redirectResult } = params;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
delete params['amount'];
|
|
146
|
-
delete params['customerId'];
|
|
147
|
-
history?.pushState({}, '', `${window.location.pathname}${qs.stringify(params) ? `?${qs.stringify(params)}` : ''}`);
|
|
148
|
-
}
|
|
143
|
+
// eslint-disable-next-line no-console
|
|
144
|
+
console.log('adyenQueryParam', { amount, customerId, redirectResult });
|
|
149
145
|
return { amount, customerId, redirectResult };
|
|
150
146
|
}
|
|
151
147
|
async function handlePaymentResponse(result, onSubmit, onError) {
|
|
152
148
|
try {
|
|
149
|
+
// eslint-disable-next-line no-console
|
|
150
|
+
console.log({ result });
|
|
153
151
|
if (result.action) {
|
|
154
152
|
if (result.action.type === 'redirect') {
|
|
155
153
|
return handleRedirectPaymentAction(result);
|
|
@@ -244,11 +244,11 @@ function Payment({ atp, cart: _cart, form, isProcessing, onError: _onError, onPa
|
|
|
244
244
|
MA: t('industry.MA'),
|
|
245
245
|
OT: t('industry.OT'),
|
|
246
246
|
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
247
|
-
}, placeholder: t('Select an industry'), variant: "solid" }), jsx(TextField, { showLabel: true, defaultValue: cart.customerVatNumber, isDisabled: isDisabled, label: t('VAT Number'), minLength: 8, name: "customerVatNumber" }, `vat${Boolean(validationErrors.customerVatNumber)}`), jsx(TextField, { showLabel: true, defaultValue: cart.poNumber, isDisabled: isDisabled, isRequired: cart.requiresPoNumber, label: t('PO Number'), name: "poNumber" }), paymentMethodOptions && Object.keys(paymentMethodOptions).length > 1 && (jsx(Select, { "data-test-selector": "paymentMethodSelect", defaultSelectedOption: cart.paymentOptions?.paymentMethods?.[0]?.name || 'ADY', isDisabled: isDisabled, label: t('Payment method'), name: "paymentMethod", onChange: setSelectedPaymentMethod, options: paymentMethodOptions, selectedOption: selectedPaymentMethod, variant: "solid" })), isAdyenPayment && cart.billTo && (jsxs(Fragment, { children: [jsxs("p", { children: ["Will return to:",
|
|
247
|
+
}, placeholder: t('Select an industry'), variant: "solid" }), jsx(TextField, { showLabel: true, defaultValue: cart.customerVatNumber, isDisabled: isDisabled, label: t('VAT Number'), minLength: 8, name: "customerVatNumber" }, `vat${Boolean(validationErrors.customerVatNumber)}`), jsx(TextField, { showLabel: true, defaultValue: cart.poNumber, isDisabled: isDisabled, isRequired: cart.requiresPoNumber, label: t('PO Number'), name: "poNumber" }), paymentMethodOptions && Object.keys(paymentMethodOptions).length > 1 && (jsx(Select, { "data-test-selector": "paymentMethodSelect", defaultSelectedOption: cart.paymentOptions?.paymentMethods?.[0]?.name || 'ADY', isDisabled: isDisabled, label: t('Payment method'), name: "paymentMethod", onChange: setSelectedPaymentMethod, options: paymentMethodOptions, selectedOption: selectedPaymentMethod, variant: "solid" })), isAdyenPayment && cart.billTo && (jsxs(Fragment, { children: [jsxs("p", { children: ["Will return to:", window?.location.pathname, " ", window?.location.search] }), jsx(AdyenPayment, { amount: cart.orderGrandTotal, cartId: cart.trackId, countryCode: countryCode, currencyCode: currencyCode, customerId: cart.billTo.id, dropinRef: dropinRef, environment: isProductionEnvironment ? 'live' : 'test', isDisabled: isDisabled, onComplete: onComplete, onError: onError, orderAmount: cart.orderGrandTotal, returnUrl:
|
|
248
248
|
/* eslint-disable ssr-friendly/no-dom-globals-in-react-fc */
|
|
249
249
|
typeof window === 'undefined'
|
|
250
250
|
? ''
|
|
251
|
-
: `${window.location.
|
|
251
|
+
: `${window.location.pathname}${window.location.search}` })] })), Boolean(paymentError) && (jsx("div", { className: styles['error-message'], children: jsx(FormattedMessage, { id: "An error occurred while processing your payment. Please try again." }) })), jsx(InfoDisplay, { id: "shipping-and-invoice-information", label: t('Billing and shipping address'), value: jsx(Accordion, { variant: "select", children: jsx(AccordionItem, { "data-test-selector": "billingAndShippingInformation", id: "invoice-and-shipping", isDisabled: isDisabled, title: t('Billing and shipping information'), children: jsx(BillingAndInvoiceInformation, { billToAddress: cart.billTo && {
|
|
252
252
|
address1: cart.billTo.address1,
|
|
253
253
|
address2: cart.billTo.address2,
|
|
254
254
|
address3: cart.billTo.address3,
|