Skip to content

Commit

Permalink
Merge pull request #3 from commercetools/enabler-and-processor-implem…
Browse files Browse the repository at this point in the history
…entation

Processor initial config and Create Payment authorisation API implementation
  • Loading branch information
prateek-ct authored Feb 1, 2024
2 parents 6723827 + 5676a37 commit 87fca38
Show file tree
Hide file tree
Showing 41 changed files with 12,276 additions and 2 deletions.
2 changes: 1 addition & 1 deletion enabler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<body>
<div id="app"></div>
<script type="module">
import { Connector } from '/lib/main.ts';
import { Connector } from '/enabler/src/main.ts';

const sessionId = await getSessionId();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion enabler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["lib", "decs.d.ts"]
"include": [
"src", "decs.d.ts"]
}
12 changes: 12 additions & 0 deletions processor/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# CoCo credentials
CTP_AUTH_URL=https://auth.[region].commercetools.com
CTP_API_URL=https://api.[region].commercetools.com
CTP_CLIENT_ID=[composable-commerce-client-id]
CTP_CLIENT_SECRET=[composable-commerce-client-secret]
CTP_PROJECT_KEY=[composable-commerce-project-key]
CTP_SESSION_URL=[composable-commerce-session-url]

# Merchant website
SELLER_RETURN_URL=[Merchant-website-return-url]
SELLER_SEND_NOTIFICATION_ENABLED=[true/false]
SELLER_NOTIFICATION_URL=[Merchant-website-return-url]
37 changes: 37 additions & 0 deletions processor/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"root": true,
"env": {
"node": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"prettier",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint", "import", "jest", "prettier", "unused-imports"],
"rules": {
"no-redeclare": ["warn"],
"no-console": ["error"],
"no-unused-vars": "off",
"no-irregular-whitespace": "warn",
"no-duplicate-imports": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-unused-vars": ["warn"],
"import/no-duplicates": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
24 changes: 24 additions & 0 deletions processor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 4 additions & 0 deletions processor/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
coverage
node_modules
pnpm-lock.yaml
10 changes: 10 additions & 0 deletions processor/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
arrowParens: 'always',
bracketSameLine: true,
bracketSpacing: true,
printWidth: 120,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
};
2 changes: 2 additions & 0 deletions processor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Payment Integration template Processor

6 changes: 6 additions & 0 deletions processor/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */

module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
Loading

0 comments on commit 87fca38

Please sign in to comment.