Skip to content

Commit

Permalink
Merge pull request #14 from vtex-apps/custom-nsu
Browse files Browse the repository at this point in the history
Custom NSU field
  • Loading branch information
btalma authored Aug 31, 2022
2 parents 2517ee9 + c160a6d commit c3dfe2c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added
- Custom NSU field

## [0.2.0] - 2022-08-09

### Changed
Expand Down
2 changes: 2 additions & 0 deletions messages/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"admin/cybersource.settings.merchantId.label": "Merchant id",
"admin/cybersource.settings.merchantKey.label": "Merchant key",
"admin/cybersource.settings.sharedSecretKey.label": "Shared secret key",
"admin/cybersource.settings.customNsu.label": "Custom NSU",
"admin/cybersource.settings.enableTransactionPosting.label": "Enable transaction posting",
"admin/cybersource.settings.salesChannelExclude.label": "Sales Channels to Exclude from Cybersource.",
"admin/cybersource.settings.nexusRegions.label": "Tax Nexus Regions.",
Expand All @@ -16,6 +17,7 @@
"admin/cybersource.settings.merchantId.helpText": "Write your merchant Id",
"admin/cybersource.settings.merchantKey.helpText": "Write your merchant Key",
"admin/cybersource.settings.sharedSecretKey.helpText": "Write your shared secret key",
"admin/cybersource.settings.customNsu.helpText": "Override default NSU with custom value",
"admin/cybersource.settings.EnableTax.label": "Enable Tax Calculations",
"admin/cybersource.settings.EnableTax.helpText": "Enable Tax Placeholder",
"admin/cybersource.settings.enableTransactionPosting.helpText": "Enable transaction posting",
Expand Down
2 changes: 2 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"admin/cybersource.settings.merchantId.label": "Merchant id",
"admin/cybersource.settings.merchantKey.label": "Merchant key",
"admin/cybersource.settings.sharedSecretKey.label": "Shared secret key",
"admin/cybersource.settings.customNsu.label": "Custom NSU",
"admin/cybersource.settings.enableTransactionPosting.label": "Enable transaction posting",
"admin/cybersource.settings.salesChannelExclude.label": "Sales Channels to Exclude from Cybersource.",
"admin/cybersource.settings.nexusRegions.label": "Tax Nexus Regions.",
Expand All @@ -16,6 +17,7 @@
"admin/cybersource.settings.merchantId.helpText": "Write your merchant Id",
"admin/cybersource.settings.merchantKey.helpText": "Write your merchant Key",
"admin/cybersource.settings.sharedSecretKey.helpText": "Write your shared secret key",
"admin/cybersource.settings.customNsu.helpText": "Override default NSU with custom value",
"admin/cybersource.settings.EnableTax.label": "Enable Tax Calculations",
"admin/cybersource.settings.EnableTax.helpText": "Enable Tax Placeholder",
"admin/cybersource.settings.enableTransactionPosting.helpText": "Enable transaction posting",
Expand Down
18 changes: 18 additions & 0 deletions react/Admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const Admin: FC = () => {
SharedSecretKey: '',
Processor: '',
Region: '',
CustomNsu: '',
EnableTransactionPosting: false,
SalesChannelExclude: '',
ShippingProductCode: '',
Expand Down Expand Up @@ -276,6 +277,23 @@ const Admin: FC = () => {
}
/>
</section>
<section className="pb4 mt4">
<Input
label={formatMessage({
id: 'admin/cybersource.settings.customNsu.label',
})}
value={settingsState.CustomNsu}
onChange={(e: React.FormEvent<HTMLInputElement>) =>
setSettingsState({
...settingsState,
CustomNsu: e.currentTarget.value,
})
}
helpText={formatMessage({
id: 'admin/cybersource.settings.customNsu.helpText',
})}
/>
</section>
<section className="pv4">
<Toggle
semantic
Expand Down
2 changes: 1 addition & 1 deletion react/components/merchantDictionary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const MerchantDictionary: FunctionComponent<any> = (props: any) => {
splitBracketString.length === 3 &&
(state.lookupSet.has(splitBracketString[0]) ||
splitBracketString[0].length === 0) &&
state.keyWords.has(splitBracketString[1])
state.keyWords.has(splitBracketString[1].toUpperCase())
) {
const poppedWord: string = stack.pop() ?? ''

Expand Down

0 comments on commit c3dfe2c

Please sign in to comment.