diff --git a/ts/api/content.ts b/ts/api/content.ts index 399ced6f022..36661f53ab3 100644 --- a/ts/api/content.ts +++ b/ts/api/content.ts @@ -151,7 +151,7 @@ type GetZendeskPaymentConfigT = IGetApiRequestType< const getZendeskPaymentConfig: GetZendeskPaymentConfigT = { method: "get", - url: () => "/assistanceTools/payment/zendeskOutcomeMapping.json", + url: () => "/assistanceTools/payments/zendeskOutcomeMapping.json", query: _ => ({}), headers: () => ({}), response_decoder: basicResponseDecoder(ZendeskSubcategoriesErrors) diff --git a/ts/features/payments/checkout/hooks/usePaymentFailureSupportModal.tsx b/ts/features/payments/checkout/hooks/usePaymentFailureSupportModal.tsx index 94b33c0ab2d..b0aebba1c15 100644 --- a/ts/features/payments/checkout/hooks/usePaymentFailureSupportModal.tsx +++ b/ts/features/payments/checkout/hooks/usePaymentFailureSupportModal.tsx @@ -92,12 +92,6 @@ const usePaymentFailureSupportModal = ({ ""; const zendeskAssistanceLogAndStart = () => { - if (!isReady(zendeskPaymentCategory)) { - return; - } - const { payments } = zendeskPaymentCategory.value; - const subCategory = getSubCategoryFromFaultCode(payments, faultCodeDetail); - resetCustomFields(); // attach the main zendesk category to the ticket addTicketCustomField( @@ -105,10 +99,17 @@ const usePaymentFailureSupportModal = ({ defaultZendeskPaymentCategory.value ); - if (subCategory) { - // if a subcategory is found, we attach its id and value to the ticket - const { value, zendeskSubCategoryId } = subCategory; - addTicketCustomField(zendeskSubCategoryId, value); + if (isReady(zendeskPaymentCategory)) { + const { payments } = zendeskPaymentCategory.value; + const subCategory = getSubCategoryFromFaultCode( + payments, + faultCodeDetail + ); + if (subCategory) { + // if a subcategory is found, we attach its id and value to the ticket + const { value, zendeskSubCategoryId } = subCategory; + addTicketCustomField(zendeskSubCategoryId, value); + } } addTicketCustomField(zendeskPaymentOrgFiscalCode, organizationFiscalCode);