From 8895d079bd2077b913d2d901dcd9154e04366ab2 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:42:21 -0500 Subject: [PATCH] Update codespaces links to support v1 and v2 (#89) --- .../advanced-integration/devcontainer.json | 40 ------------------- .../advanced-integration/welcome-message.sh | 23 ----------- README.md | 3 +- 3 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 .devcontainer/advanced-integration/devcontainer.json delete mode 100644 .devcontainer/advanced-integration/welcome-message.sh diff --git a/.devcontainer/advanced-integration/devcontainer.json b/.devcontainer/advanced-integration/devcontainer.json deleted file mode 100644 index 2e840f6f..00000000 --- a/.devcontainer/advanced-integration/devcontainer.json +++ /dev/null @@ -1,40 +0,0 @@ -// For more details, see https://aka.ms/devcontainer.json. -{ - "name": "PayPal Advanced Integration", - "image": "mcr.microsoft.com/devcontainers/javascript-node:20", - "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/advanced-integration", - // Use 'onCreateCommand' to run commands when creating the container. - "onCreateCommand": "bash ../.devcontainer/advanced-integration/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": [8888], - "portsAttributes": { - "8888": { - "label": "Preview of Advanced Checkout Flow", - "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 secret of the application.", - "documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox" - } - }, - "customizations": { - "vscode": { - "extensions": ["vsls-contrib.codetour"], - "settings": { - "git.openRepositoryInParentFolders": "always" - } - } - } -} diff --git a/.devcontainer/advanced-integration/welcome-message.sh b/.devcontainer/advanced-integration/welcome-message.sh deleted file mode 100644 index ae9a72f9..00000000 --- a/.devcontainer/advanced-integration/welcome-message.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -set -e - -WELCOME_MESSAGE=" -👋 Welcome to the \"PayPal Advanced Checkout Integration Example\" - -🛠️ 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 Advanced Checkout Integration Example\" - -🛠️ 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" diff --git a/README.md b/README.md index b0bba29e..6a5e4692 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ PayPal codespaces require a client ID and client secret for your app. | Application | Codespaces Link | | ---- | ---- | -| Advanced Integration | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/paypal-examples/docs-examples?devcontainer_path=.devcontainer%2Fadvanced-integration%2Fdevcontainer.json)| +| Advanced Integration v2 | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/paypal-examples/docs-examples?devcontainer_path=.devcontainer%2Fadvanced-integration-v2%2Fdevcontainer.json)| +| Advanced Integration v1 | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/paypal-examples/docs-examples?devcontainer_path=.devcontainer%2Fadvanced-integration-v1%2Fdevcontainer.json)| | Standard Integration | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/paypal-examples/docs-examples?devcontainer_path=.devcontainer%2Fstandard-integration%2Fdevcontainer.json)| ### Learn more