From be761b251eb9dd16bd17eefdb502a882b7a2af17 Mon Sep 17 00:00:00 2001 From: Adrian Pilarczyk Date: Mon, 21 Aug 2023 10:28:43 +0200 Subject: [PATCH] chore: split credentials and settings (#886) * feat: :sparkles: grey out disabled links * chore: :truck: move fields to new avatax settings fragment * build: :construction_worker: add changeset * refactor: :truck: move companyCode to credentials * refactor: :recycle: make helper texts more accurate * refactor: :truck: Avatax -> AvaTax --- .changeset/brown-tools-dance.md | 5 + .../avatax/avatax-connection-schema.ts | 2 +- .../avatax/avatax-connection.router.ts | 18 +-- .../avatax/avatax-document-code-resolver.ts | 2 +- .../avatax-calculate-taxes-adapter.ts | 8 +- ...lculate-taxes-payload-lines-transformer.ts | 2 +- .../avatax-auth-validation.service.ts | 2 +- .../avatax-validation-error-resolver.test.ts | 6 +- .../avatax-validation-error-resolver.ts | 8 +- .../public-avatax-connection.service.ts | 2 +- .../avatax-order-cancelled-adapter.ts | 4 +- .../avatax-order-confirmed-adapter.ts | 8 +- ...der-confirmed-payload-lines-transformer.ts | 2 +- ...tax-order-confirmed-payload-transformer.ts | 2 +- ...ax-order-confirmed-response-transformer.ts | 2 +- .../avatax-order-created-adapter.ts | 8 +- ...order-created-payload-lines-transformer.ts | 2 +- ...vatax-order-created-payload-transformer.ts | 2 +- ...atax-order-created-response-transformer.ts | 2 +- .../avatax-order-fulfilled-adapter.ts | 8 +- ...rder-fulfilled-payload-transformer.test.ts | 2 +- ...tax-configuration-credentials-fragment.tsx | 151 +++++++----------- .../avatax/ui/avatax-configuration-form.tsx | 8 +- ...avatax-configuration-settings-fragment.tsx | 71 ++++++++ .../avatax-configuration-taxes-fragment.tsx | 34 ---- .../modules/avatax/ui/avatax-instructions.tsx | 4 +- .../ui/avatax-tax-code-matcher-table.tsx | 6 +- .../avatax/ui/edit-avatax-configuration.tsx | 4 +- .../modules/avatax/ui/form-section.module.css | 5 + .../src/modules/avatax/ui/form-section.tsx | 12 +- .../taxes/get-active-connection-service.ts | 2 +- apps/taxes/src/modules/ui/app-breadcrumbs.tsx | 6 +- apps/taxes/src/modules/ui/provider-label.tsx | 2 +- .../taxes/src/pages/providers/avatax/[id].tsx | 2 +- .../src/pages/providers/avatax/index.tsx | 2 +- .../src/pages/providers/avatax/matcher.tsx | 14 +- apps/taxes/src/pages/providers/index.tsx | 2 +- 37 files changed, 219 insertions(+), 203 deletions(-) create mode 100644 .changeset/brown-tools-dance.md create mode 100644 apps/taxes/src/modules/avatax/ui/avatax-configuration-settings-fragment.tsx delete mode 100644 apps/taxes/src/modules/avatax/ui/avatax-configuration-taxes-fragment.tsx create mode 100644 apps/taxes/src/modules/avatax/ui/form-section.module.css diff --git a/.changeset/brown-tools-dance.md b/.changeset/brown-tools-dance.md new file mode 100644 index 0000000..446623d --- /dev/null +++ b/.changeset/brown-tools-dance.md @@ -0,0 +1,5 @@ +--- +"saleor-app-taxes": minor +--- + +Changed the layout in the AvaTax configuration form to consist of three sections: "Credentials", "Settings" (new) and "Address". Now, the "Credentials" section contains only fields that affect authentication. diff --git a/apps/taxes/src/modules/avatax/avatax-connection-schema.ts b/apps/taxes/src/modules/avatax/avatax-connection-schema.ts index 409b6fc..3583c48 100644 --- a/apps/taxes/src/modules/avatax/avatax-connection-schema.ts +++ b/apps/taxes/src/modules/avatax/avatax-connection-schema.ts @@ -13,7 +13,7 @@ const avataxCredentialsSchema = z.object({ password: z.string().min(1, { message: "Password requires at least one character." }), }); -// All that is needed to create Avatax configuration. +// All that is needed to create AvaTax configuration. export const baseAvataxConfigSchema = z.object({ isSandbox: z.boolean(), credentials: avataxCredentialsSchema, diff --git a/apps/taxes/src/modules/avatax/avatax-connection.router.ts b/apps/taxes/src/modules/avatax/avatax-connection.router.ts index 79c5986..c41481e 100644 --- a/apps/taxes/src/modules/avatax/avatax-connection.router.ts +++ b/apps/taxes/src/modules/avatax/avatax-connection.router.ts @@ -49,7 +49,7 @@ export const avataxConnectionRouter = router({ await ctx.connectionService.verifyConnections(); - logger.info("Avatax connections were successfully verified"); + logger.info("AvaTax connections were successfully verified"); return { ok: true }; }), @@ -62,7 +62,7 @@ export const avataxConnectionRouter = router({ const result = await ctx.connectionService.getById(input.id); - logger.info(`Avatax configuration with an id: ${result.id} was successfully retrieved`); + logger.info(`AvaTax configuration with an id: ${result.id} was successfully retrieved`); return result; }), @@ -76,7 +76,7 @@ export const avataxConnectionRouter = router({ const result = await ctx.connectionService.create(input.value); - logger.info("Avatax configuration was successfully created"); + logger.info("AvaTax configuration was successfully created"); return result; }), @@ -92,7 +92,7 @@ export const avataxConnectionRouter = router({ const result = await ctx.connectionService.delete(input.id); - logger.info(`Avatax configuration with an id: ${input.id} was deleted`); + logger.info(`AvaTax configuration with an id: ${input.id} was deleted`); return result; }), @@ -108,7 +108,7 @@ export const avataxConnectionRouter = router({ const result = await ctx.connectionService.update(input.id, input.value); - logger.info(`Avatax configuration with an id: ${input.id} was successfully updated`); + logger.info(`AvaTax configuration with an id: ${input.id} was successfully updated`); return result; }), @@ -137,7 +137,7 @@ export const avataxConnectionRouter = router({ const result = await addressValidationService.validate(input.id, input.value); - logger.info(`Avatax address was successfully validated`); + logger.info(`AvaTax address was successfully validated`); return result; }), @@ -157,7 +157,7 @@ export const avataxConnectionRouter = router({ const result = await addressValidation.validate(input.value.address); - logger.info(`Avatax address was successfully validated`); + logger.info(`AvaTax address was successfully validated`); return result; }), @@ -184,7 +184,7 @@ export const avataxConnectionRouter = router({ await authValidation.validate(input.id, input.value); - logger.info(`Avatax client was successfully validated`); + logger.info(`AvaTax client was successfully validated`); }), createValidateCredentials: protectedClientProcedure .input(z.object({ value: baseAvataxConfigSchema })) @@ -200,7 +200,7 @@ export const avataxConnectionRouter = router({ const result = await authValidation.validate(); - logger.info(`Avatax client was successfully validated`); + logger.info(`AvaTax client was successfully validated`); return result; }), diff --git a/apps/taxes/src/modules/avatax/avatax-document-code-resolver.ts b/apps/taxes/src/modules/avatax/avatax-document-code-resolver.ts index 39c8be3..d5d4991 100644 --- a/apps/taxes/src/modules/avatax/avatax-document-code-resolver.ts +++ b/apps/taxes/src/modules/avatax/avatax-document-code-resolver.ts @@ -15,7 +15,7 @@ export class AvataxDocumentCodeResolver { const code = avataxDocumentCode ?? orderId; /* - * The requirement from Avatax API is that document code is a string that must be between 1 and 20 characters long. + * The requirement from AvaTax API is that document code is a string that must be between 1 and 20 characters long. * // todo: document that its sliced */ return code.slice(0, 20); diff --git a/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-adapter.ts b/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-adapter.ts index 4d235cf..02d7a3e 100644 --- a/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-adapter.ts +++ b/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-adapter.ts @@ -27,21 +27,21 @@ export class AvataxCalculateTaxesAdapter // todo: refactor because its getting too big async send(payload: AvataxCalculateTaxesPayload): Promise { - this.logger.debug("Transforming the Saleor payload for calculating taxes with Avatax..."); + this.logger.debug("Transforming the Saleor payload for calculating taxes with AvaTax..."); const payloadService = new AvataxCalculateTaxesPayloadService(this.authData); const target = await payloadService.getPayload(payload.taxBase, this.config); - this.logger.debug("Calling Avatax createTransaction with transformed payload..."); + this.logger.debug("Calling AvaTax createTransaction with transformed payload..."); const client = new AvataxClient(this.config); const response = await client.createTransaction(target); - this.logger.debug("Avatax createTransaction successfully responded"); + this.logger.debug("AvaTax createTransaction successfully responded"); const responseTransformer = new AvataxCalculateTaxesResponseTransformer(); const transformedResponse = responseTransformer.transform(response); - this.logger.debug("Transformed Avatax createTransaction response"); + this.logger.debug("Transformed AvaTax createTransaction response"); return transformedResponse; } diff --git a/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-payload-lines-transformer.ts b/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-payload-lines-transformer.ts index 3234a88..35fc126 100644 --- a/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-payload-lines-transformer.ts +++ b/apps/taxes/src/modules/avatax/calculate-taxes/avatax-calculate-taxes-payload-lines-transformer.ts @@ -26,7 +26,7 @@ export class AvataxCalculateTaxesPayloadLinesTransformer { }); if (taxBase.shippingPrice.amount !== 0) { - // * In Avatax, shipping is a regular line + // * In AvaTax, shipping is a regular line const shippingLine: LineItemModel = { amount: taxBase.shippingPrice.amount, itemCode: SHIPPING_ITEM_CODE, diff --git a/apps/taxes/src/modules/avatax/configuration/avatax-auth-validation.service.ts b/apps/taxes/src/modules/avatax/configuration/avatax-auth-validation.service.ts index 08c959c..211bbcc 100644 --- a/apps/taxes/src/modules/avatax/configuration/avatax-auth-validation.service.ts +++ b/apps/taxes/src/modules/avatax/configuration/avatax-auth-validation.service.ts @@ -16,7 +16,7 @@ export class AvataxAuthValidationService { const result = await this.avataxClient.ping(); if (!result.authenticated) { - throw new Error("Invalid Avatax credentials."); + throw new Error("Invalid AvaTax credentials."); } } catch (error) { const errorResolver = new AvataxValidationErrorResolver(); diff --git a/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.test.ts b/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.test.ts index 6a4509f..94c429f 100644 --- a/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.test.ts +++ b/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.test.ts @@ -27,9 +27,9 @@ describe("AvataxValidationErrorResolver", () => { }); expect(result).toBeInstanceOf(Error); - expect(result.message).toBe("Invalid Avatax credentials."); + expect(result.message).toBe("Invalid AvaTax credentials."); }); - it("when other Avatax error, should return error with first message", () => { + it("when other AvaTax error, should return error with first message", () => { const result = errorResolver.resolve({ code: "error", details: [ @@ -57,6 +57,6 @@ describe("AvataxValidationErrorResolver", () => { const result = errorResolver.resolve("error"); expect(result).toBeInstanceOf(Error); - expect(result.message).toBe("Unknown error while validating Avatax configuration."); + expect(result.message).toBe("Unknown error while validating AvaTax configuration."); }); }); diff --git a/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.ts b/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.ts index 61ce878..34c04d9 100644 --- a/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.ts +++ b/apps/taxes/src/modules/avatax/configuration/avatax-validation-error-resolver.ts @@ -26,12 +26,12 @@ export class AvataxValidationErrorResolver { const parseResult = avataxErrorSchema.safeParse(error); const isErrorParsed = parseResult.success; - // Avatax doesn't return a type for their error format, so we need to parse the error + // AvaTax doesn't return a type for their error format, so we need to parse the error if (isErrorParsed) { const { code, details } = parseResult.data; if (code === "AuthenticationException") { - return new Error("Invalid Avatax credentials."); + return new Error("Invalid AvaTax credentials."); } return new Error(details[0].message); @@ -41,7 +41,7 @@ export class AvataxValidationErrorResolver { return error; } - this.logger.error("Unknown error while validating Avatax configuration."); - return new Error("Unknown error while validating Avatax configuration."); + this.logger.error("Unknown error while validating AvaTax configuration."); + return new Error("Unknown error while validating AvaTax configuration."); } } diff --git a/apps/taxes/src/modules/avatax/configuration/public-avatax-connection.service.ts b/apps/taxes/src/modules/avatax/configuration/public-avatax-connection.service.ts index e461748..e89cff7 100644 --- a/apps/taxes/src/modules/avatax/configuration/public-avatax-connection.service.ts +++ b/apps/taxes/src/modules/avatax/configuration/public-avatax-connection.service.ts @@ -48,7 +48,7 @@ export class PublicAvataxConnectionService { const connections = await this.connectionService.getAll(); if (connections.length === 0) { - throw new Error("No Avatax connections found"); + throw new Error("No AvaTax connections found"); } } } diff --git a/apps/taxes/src/modules/avatax/order-cancelled/avatax-order-cancelled-adapter.ts b/apps/taxes/src/modules/avatax/order-cancelled/avatax-order-cancelled-adapter.ts index ffb2135..016ece7 100644 --- a/apps/taxes/src/modules/avatax/order-cancelled/avatax-order-cancelled-adapter.ts +++ b/apps/taxes/src/modules/avatax/order-cancelled/avatax-order-cancelled-adapter.ts @@ -15,12 +15,12 @@ export class AvataxOrderCancelledAdapter implements WebhookAdapter { - this.logger.debug("Transforming the Saleor payload for creating order with Avatax..."); + this.logger.debug("Transforming the Saleor payload for creating order with AvaTax..."); const payloadService = new AvataxOrderConfirmedPayloadService(this.authData); const target = await payloadService.getPayload(payload.order, this.config); - this.logger.debug("Calling Avatax createTransaction with transformed payload..."); + this.logger.debug("Calling AvaTax createTransaction with transformed payload..."); const client = new AvataxClient(this.config); const response = await client.createTransaction(target); - this.logger.debug("Avatax createTransaction successfully responded"); + this.logger.debug("AvaTax createTransaction successfully responded"); const responseTransformer = new AvataxOrderConfirmedResponseTransformer(); const transformedResponse = responseTransformer.transform(response); - this.logger.debug("Transformed Avatax createTransaction response"); + this.logger.debug("Transformed AvaTax createTransaction response"); return transformedResponse; } diff --git a/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-lines-transformer.ts b/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-lines-transformer.ts index 3059894..fe1196c 100644 --- a/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-lines-transformer.ts +++ b/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-lines-transformer.ts @@ -31,7 +31,7 @@ export class AvataxOrderConfirmedPayloadLinesTransformer { }); if (order.shippingPrice.net.amount !== 0) { - // * In Avatax, shipping is a regular line + // * In AvaTax, shipping is a regular line const shippingLine: LineItemModel = { amount: order.shippingPrice.gross.amount, taxIncluded: true, diff --git a/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-transformer.ts b/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-transformer.ts index 5fd753e..a694257 100644 --- a/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-transformer.ts +++ b/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-payload-transformer.ts @@ -48,7 +48,7 @@ export class AvataxOrderConfirmedPayloadTransformer { entityUseCode, customerCode: order.user?.id ?? - "" /* In Saleor Avatax plugin, the customer code is 0. In Taxes App, we set it to the user id. */, + "" /* In Saleor AvaTax plugin, the customer code is 0. In Taxes App, we set it to the user id. */, companyCode: avataxConfig.companyCode ?? defaultAvataxConfig.companyCode, // * commit: If true, the transaction will be committed immediately after it is created. See: https://developer.avalara.com/communications/dev-guide_rest_v2/commit-uncommit commit: avataxConfig.isAutocommit, diff --git a/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-response-transformer.ts b/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-response-transformer.ts index 756260a..a7d6ae0 100644 --- a/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-response-transformer.ts +++ b/apps/taxes/src/modules/avatax/order-confirmed/avatax-order-confirmed-response-transformer.ts @@ -8,7 +8,7 @@ export class AvataxOrderConfirmedResponseTransformer { id: taxProviderUtils.resolveOptionalOrThrow( response.code, new Error( - "Could not update the order metadata with Avatax transaction code because it was not returned from the createTransaction mutation." + "Could not update the order metadata with AvaTax transaction code because it was not returned from the createTransaction mutation." ) ), }; diff --git a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-adapter.ts b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-adapter.ts index d707d2c..c84cba2 100644 --- a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-adapter.ts +++ b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-adapter.ts @@ -24,22 +24,22 @@ export class AvataxOrderCreatedAdapter } async send(payload: AvataxOrderCreatedPayload): Promise { - this.logger.debug("Transforming the Saleor payload for creating order with Avatax..."); + this.logger.debug("Transforming the Saleor payload for creating order with AvaTax..."); const payloadService = new AvataxOrderCreatedPayloadService(this.authData); const target = await payloadService.getPayload(payload.order, this.config); - this.logger.debug("Calling Avatax createTransaction with transformed payload..."); + this.logger.debug("Calling AvaTax createTransaction with transformed payload..."); const client = new AvataxClient(this.config); const response = await client.createTransaction(target); - this.logger.debug("Avatax createTransaction successfully responded"); + this.logger.debug("AvaTax createTransaction successfully responded"); const responseTransformer = new AvataxOrderCreatedResponseTransformer(); const transformedResponse = responseTransformer.transform(response); - this.logger.debug("Transformed Avatax createTransaction response"); + this.logger.debug("Transformed AvaTax createTransaction response"); return transformedResponse; } diff --git a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-lines-transformer.ts b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-lines-transformer.ts index 742f935..0add75f 100644 --- a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-lines-transformer.ts +++ b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-lines-transformer.ts @@ -31,7 +31,7 @@ export class AvataxOrderCreatedPayloadLinesTransformer { }); if (order.shippingPrice.net.amount !== 0) { - // * In Avatax, shipping is a regular line + // * In AvaTax, shipping is a regular line const shippingLine: LineItemModel = { amount: order.shippingPrice.gross.amount, taxIncluded: true, diff --git a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-transformer.ts b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-transformer.ts index e81d9ae..95e2209 100644 --- a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-transformer.ts +++ b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-payload-transformer.ts @@ -48,7 +48,7 @@ export class AvataxOrderCreatedPayloadTransformer { code, customerCode: order.user?.id ?? - "" /* In Saleor Avatax plugin, the customer code is 0. In Taxes App, we set it to the user id. */, + "" /* In Saleor AvaTax plugin, the customer code is 0. In Taxes App, we set it to the user id. */, companyCode: avataxConfig.companyCode, // * commit: If true, the transaction will be committed immediately after it is created. See: https://developer.avalara.com/communications/dev-guide_rest_v2/commit-uncommit commit: avataxConfig.isAutocommit, diff --git a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-response-transformer.ts b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-response-transformer.ts index 890a9cb..a0ad61a 100644 --- a/apps/taxes/src/modules/avatax/order-created/avatax-order-created-response-transformer.ts +++ b/apps/taxes/src/modules/avatax/order-created/avatax-order-created-response-transformer.ts @@ -8,7 +8,7 @@ export class AvataxOrderCreatedResponseTransformer { id: taxProviderUtils.resolveOptionalOrThrow( response.code, new Error( - "Could not update the order metadata with Avatax transaction code because it was not returned from the createTransaction mutation." + "Could not update the order metadata with AvaTax transaction code because it was not returned from the createTransaction mutation." ) ), }; diff --git a/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-adapter.ts b/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-adapter.ts index 7ce181e..937d917 100644 --- a/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-adapter.ts +++ b/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-adapter.ts @@ -22,22 +22,22 @@ export class AvataxOrderFulfilledAdapter } async send(payload: AvataxOrderFulfilledPayload): Promise { - this.logger.debug("Transforming the Saleor payload for commiting transaction with Avatax..."); + this.logger.debug("Transforming the Saleor payload for commiting transaction with AvaTax..."); const payloadTransformer = new AvataxOrderFulfilledPayloadTransformer(this.config); const target = payloadTransformer.transform({ ...payload }); - this.logger.debug("Calling Avatax commitTransaction with transformed payload..."); + this.logger.debug("Calling AvaTax commitTransaction with transformed payload..."); const client = new AvataxClient(this.config); const response = await client.commitTransaction(target); - this.logger.debug("Avatax commitTransaction succesfully responded"); + this.logger.debug("AvaTax commitTransaction succesfully responded"); const responseTransformer = new AvataxOrderFulfilledResponseTransformer(); const transformedResponse = responseTransformer.transform(response); - this.logger.debug("Transformed Avatax commitTransaction response"); + this.logger.debug("Transformed AvaTax commitTransaction response"); return transformedResponse; } diff --git a/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-payload-transformer.test.ts b/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-payload-transformer.test.ts index 2c39f22..e014923 100644 --- a/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-payload-transformer.test.ts +++ b/apps/taxes/src/modules/avatax/order-fulfilled/avatax-order-fulfilled-payload-transformer.test.ts @@ -11,7 +11,7 @@ const MOCK_AVATAX_CONFIG: AvataxConfig = { isDocumentRecordingEnabled: true, isAutocommit: false, isSandbox: true, - name: "Avatax-1", + name: "AvaTax-1", shippingTaxCode: "FR000000", address: { country: "US", diff --git a/apps/taxes/src/modules/avatax/ui/avatax-configuration-credentials-fragment.tsx b/apps/taxes/src/modules/avatax/ui/avatax-configuration-credentials-fragment.tsx index 51092dc..de29c83 100644 --- a/apps/taxes/src/modules/avatax/ui/avatax-configuration-credentials-fragment.tsx +++ b/apps/taxes/src/modules/avatax/ui/avatax-configuration-credentials-fragment.tsx @@ -55,107 +55,68 @@ export const AvataxConfigurationCredentialsFragment = ( return ( <> - -
- +
+ + + You can obtain it in the API Keys section of SettingsLicense in + your Avalara Dashboard. + +
+
+ + + You can obtain it in the API Keys section of SettingsLicense in + your Avalara Dashboard. + +
+
+ + + When not provided, the default company code will be used.{" "} + + Read more + {" "} + about company codes. + +
+ - You can obtain it in the API Keys section of SettingsLicense{" "} - in your Avalara Dashboard. - -
-
- - - You can obtain it in the API Keys section of SettingsLicense{" "} - in your Avalara Dashboard. - -
- -
- - - When not provided, the default company will be used.{" "} + Choose between - Read more + Production and Sandbox {" "} - about company codes. + environment according to your credentials. -
-
- - - Toggling between{" "} - - Production and Sandbox - {" "} - environment. - - } - name="isSandbox" - /> - - When turned off, the document type will always be set to SalesOrder. This - means the transactions will not be recorded in Avatax. Read more{" "} - - here - - . - - } - name="isDocumentRecordingEnabled" - /> - - If enabled, the order will be automatically{" "} - - commited to Avalara. - {" "} - - } - name="isAutocommit" - /> - + } + name="isSandbox" + />