diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a187321..9a6765f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,3 @@ -// For more details, see https://aka.ms/devcontainer.json. { "name": "Apple Pay", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/", @@ -28,6 +27,10 @@ "MERCHANT_ID":{ "description": "Sandbox merchant ID of the application.", "documentationUrl": "https://www.sandbox.paypal.com/businessmanage/account/aboutBusiness" + }, + "CLIENT_SECRET": { + "description": "Sandbox client secret of the application.", + "documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox" } }, "customizations": { diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c184b9c..09cd2eb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,4 +31,4 @@ jobs: CLIENT_ID: ${{secrets.CLIENT_ID}} APP_SECRET: ${{secrets.APP_SECRET}} CLIENT_SECRET: ${{secrets.CLIENT_SECRET}} - MERCHANT_ID: ${{secrets.MERCHANT_ID}} \ No newline at end of file + MERCHANT_ID: ${{secrets.MERCHANT_ID}} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 85b763f..ca772e5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,4 +12,3 @@ jobs: run: cd advanced-integration && npm install - name: Run ESLint run: cd advanced-integration && npm run lint - diff --git a/README.md b/README.md index f171814..8b9cd0e 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,53 @@ You can read more about codespaces in the [PayPal Developer Docs](https://develo * To report a bug or suggest a new feature, create an [issue in GitHub](https://github.com/paypal-examples/paypaldevsupport/issues/new/choose). * To submit feedback, go to [PayPal Developer Docs](https://developer.paypal.com/api/rest/sandbox/codespaces) and select the "Feedback" tab + +## Setting up a Development Container + +To set up a development container with necessary configurations and secrets, follow these steps: + +1. Install the [Visual Studio Code Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). +2. Open the project in Visual Studio Code. +3. Press `F1` and select `Remote-Containers: Open Folder in Container...`. +4. Select the project folder. +5. The development container will be built and started automatically. + +## Deploying the Application to Heroku + +To deploy the application to Heroku, follow these steps: + +1. Create a Heroku account at [https://www.heroku.com/](https://www.heroku.com/). +2. Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli). +3. Log in to your Heroku account using the Heroku CLI: `heroku login`. +4. Create a new Heroku app: `heroku create `. +5. Set the required environment variables in your Heroku app: + ```sh + heroku config:set CLIENT_ID= + heroku config:set APP_SECRET= + heroku config:set CLIENT_SECRET= + heroku config:set MERCHANT_ID= + ``` +6. Push the code to Heroku: `git push heroku main`. + +## Running ESLint on Push and Pull Request Events + +To run ESLint on push and pull request events, follow these steps: + +1. Ensure that ESLint is installed and configured in your project. +2. Create a GitHub Actions workflow file at `.github/workflows/lint.yml` with the following content: + ```yaml + name: Lint + on: [push, pull_request] + jobs: + build-advanced-integration: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: '16' + - name: Install JS Dependencies + run: cd advanced-integration && npm install + - name: Run ESLint + run: cd advanced-integration && npm run lint + ```