Skip to content

Commit

Permalink
chore(enabler): fixing build and start issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeliziact committed Feb 2, 2024
1 parent afaf7c2 commit 71472f8
Show file tree
Hide file tree
Showing 19 changed files with 1,752 additions and 0 deletions.
5 changes: 5 additions & 0 deletions enabler/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VITE_ADMIN_CLIENT_ID=IYg3zsamDxEtBVhN0GXPfSyz
VITE_ADMIN_CLIENT_SECRET=Ti5_ciOUgU76hu0hq75shf0V3Fg4Oean
VITE_ADMIN_SCOPE=manage_project:commercetools-checkout
VITE_REGION=europe-west1.gcp
VITE_CART_ID=f49ea44e-a189-4f9f-b17f-b09f29da49c9
24 changes: 24 additions & 0 deletions enabler/.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?
7 changes: 7 additions & 0 deletions enabler/decs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module "@adyen/adyen-web"
declare module "@adyen/adyen-web/dist/types/components/ApplePay"
declare module "@adyen/adyen-web/dist/types/components/GooglePay"
declare module "@adyen/adyen-web/dist/types/core"
declare module "@adyen/adyen-web/dist/types/core/core"
declare module "@adyen/adyen-web/dist/types/components/Redirect/Redirect"
declare module "@adyen/adyen-web/dist/types/core/types"
73 changes: 73 additions & 0 deletions enabler/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
<script>
var __VITE_ADMIN_CLIENT_ID__ = !'%VITE_ADMIN_CLIENT_ID%'.startsWith('%') && '%VITE_ADMIN_CLIENT_ID%' || 'IYg3zsamDxEtBVhN0GXPfSyz';
var __VITE_ADMIN_CLIENT_SECRET__ = !'%VITE_ADMIN_CLIENT_SECRET%'.startsWith('%') && '%VITE_ADMIN_CLIENT_SECRET%' || 'Ti5_ciOUgU76hu0hq75shf0V3Fg4Oean';
var __VITE_ADMIN_SCOPE__ = !'%VITE_ADMIN_SCOPE%'.startsWith('%') && '%VITE_ADMIN_SCOPE%' || 'manage_project:commercetools-checkout';
var __VITE_REGION__ = !'%VITE_REGION%'.startsWith('%') && '%VITE_REGION%' || 'europe-west1.gcp';
var __VITE_CART_ID__ = !'%VITE_CART_ID%'.startsWith('%') && '%VITE_CART_ID%' || 'f49ea44e-a189-4f9f-b17f-b09f29da49c9';
</script>
<script src="./session.js"></script>
</head>
<body>
<div id="app"></div>
<script type="module">
import { Connector } from '/enabler/src/main.ts';

const sessionId = await getSessionId();

const connector = new Connector({
connectorUrl: "http://0.0.0.0:5000",
sessionId: sessionId,
config: {

},
onComplete: ({ isSuccess, paymentReference }) => {
console.log('onComplete', { isSuccess, paymentReference });
},
});

connector.createComponent('dropin', {
config: {},
})
.then(e => e.mount('#adyen-dropin-component'));

connector.createComponent('card', {
config: {},
})
.then(e => e.mount('#adyen-card-component'));

connector.createComponent('ideal', {
config: {showPayButton: false},
})
.then(e => e.mount('#adyen-ideal-component'));

connector.createComponent('googlepay', {})
.then(e => e.mount('#adyen-googlepay-component'));
</script>

<div class="container-md p-3 border m-3">
<div class="container-md p-3 border m-3">
<h5>Adyen dropin component:</h5>
<div id="adyen-dropin-component"></div>
</div>
<div class="container-md p-3 border m-3">
<h5>Adyen card component:</h5>
<div id="adyen-card-component"></div>
</div>
<div class="container-md p-3 border m-3">
<h5>Ideal component:</h5>
<div id="adyen-ideal-component"></div>
</div>
<div class="container-md p-3 border m-3">
<h5>Googlepay component:</h5>
<div id="adyen-googlepay-component"></div>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 71472f8

Please sign in to comment.