Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.
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
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "PayPal JavasScript FullStack Standard Checkout Sample",
"image": "mcr.microsoft.com/devcontainers/universal:2",

// Use 'onCreateCommand' to run commands when creating the container.
"onCreateCommand": "bash ./.devcontainer/welcome-message.sh",

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",

// Use 'postAttachCommand' to run commands when attaching to the container.
"postAttachCommand": {
"Start server": "npm start"
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [9597],
"portsAttributes": {
"9597": {
"label": "Preview of PayPal JavasScript FullStack Standard Checkout",
"onAutoForward": "openBrowserOnce"
}
},

"secrets": {
"PAYPAL_CLIENT_ID": {
"description": "Sandbox Client ID of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
},
"PAYPAL_CLIENT_SECRET": {
"description": "Sandbox Client Secret of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
}
},

"customizations": {
"vscode": {
"extensions": ["vsls-contrib.codetour"],
"settings": {
"git.openRepositoryInParentFolders": "always"
}
}
}
}
23 changes: 23 additions & 0 deletions .devcontainer/welcome-message.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

WELCOME_MESSAGE="
👋 Welcome to the \"PayPal JavasScript FullStack Standard Checkout Sample\"

🛠️ Your environment is fully setup with all the required software.

🚀 Once you rename the \".env.example\" file to \".env\" and update \"PAYPAL_CLIENT_ID\" and \"PAYPAL_CLIENT_SECRET\", the checkout page will automatically open in the browser after the server is restarted."

ALTERNATE_WELCOME_MESSAGE="
👋 Welcome to the \"PayPal JavasScript FullStack Standard Checkout Sample\"

🛠️ Your environment is fully setup with all the required software.

🚀 The checkout page will automatically open in the browser after the server is started."

if [ -n "$PAYPAL_CLIENT_ID" ] && [ -n "$PAYPAL_CLIENT_SECRET" ]; then
WELCOME_MESSAGE="${ALTERNATE_WELCOME_MESSAGE}"
fi

sudo bash -c "echo \"${WELCOME_MESSAGE}\" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@paypalcorp/backend",
"name": "paypal-javascript-fullstack-standard-checkout-sample",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand Down