Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Authorisation Adjustment Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd authorisation-adjustment-example && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh authorisation-adjustment-example",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
38 changes: 38 additions & 0 deletions .devcontainer/checkout-example-advanced/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Advanced Checkout Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd checkout-example-advanced && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh checkout-example-advanced",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
38 changes: 38 additions & 0 deletions .devcontainer/checkout-example/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Checkout Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd checkout-example && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh checkout-example",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Default - Checkout example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd $(git remote -v | awk -F'/' '/fetch/{print $NF}' | sed 's/.git//' | tr -d '[:space:]' | head -n 1) && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
38 changes: 38 additions & 0 deletions .devcontainer/giftcard-example/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Gift Card Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd giftcard-example && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh giftcard-example",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
38 changes: 38 additions & 0 deletions .devcontainer/giving-example/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Giving Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd giving-example && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh giving-example",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
38 changes: 38 additions & 0 deletions .devcontainer/in-person-payments-example/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "In-person Payments Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd in-person-payments-example && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh in-person-payments-example",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
38 changes: 38 additions & 0 deletions .devcontainer/paybylink-example/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Pay By Link Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd paybylink-example && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh paybylink-example",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
25 changes: 25 additions & 0 deletions .devcontainer/run_example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

# Check for required secrets
if [ -z "${ADYEN_API_KEY}" ] || [ -z "${ADYEN_MERCHANT_ACCOUNT}" ] || [ -z "${ADYEN_CLIENT_KEY}" ] || [ -z "${ADYEN_HMAC_KEY}" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!!! ERROR: Required Adyen secrets are not set in your Codespaces secrets. !!!"
echo "!!! !!!"
echo "!!! Please go to your repository settings > Secrets and variables > !!!"
echo "!!! Codespaces, and add the required secrets. !!!"
echo "!!! !!!"
echo "!!! After adding the secrets, you will need to rebuild the container. !!!"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
fi

# Default to checkout-example if not set
EXAMPLE_DIR=${1:-checkout-example}

echo "---"
echo "Attempting to start Adyen example: ${EXAMPLE_DIR}"
echo "---"

# Navigate to the example directory and run the application
cd "${EXAMPLE_DIR}" && ./gradlew bootRun
38 changes: 38 additions & 0 deletions .devcontainer/subscription-example/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Subscription Example",
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": "true"
}
},

// Runs once when the Codespace is created.
// Makes the startup script executable and builds the specified example.
"postCreateCommand": "chmod +x .devcontainer/run_example.sh && cd subscription-example && ./gradlew build",

// Runs after the user attaches to the Codespace.
// This will automatically start the selected example application in the terminal.
"postAttachCommand": ".devcontainer/run_example.sh subscription-example",
"forwardPorts": [8080],

"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "openPreview"
}
},

"customizations": {
"vscode": {
"extensions": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-test",
"pivotal.vscode-spring-boot"
]
}
}
}
Loading
Loading