Skip to content
Open
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
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "Apple Pay",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/",
Expand Down Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
MERCHANT_ID: ${{secrets.MERCHANT_ID}}
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ jobs:
run: cd advanced-integration && npm install
- name: Run ESLint
run: cd advanced-integration && npm run lint

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID¤cy=USD&buyer-country=US&merchant-id=SUB_MERCHANT_ID&components=applepay"></script>

50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <app-name>`.
5. Set the required environment variables in your Heroku app:
```sh
heroku config:set CLIENT_ID=<your-client-id>
heroku config:set APP_SECRET=<your-app-secret>
heroku config:set CLIENT_SECRET=<your-client-secret>
heroku config:set MERCHANT_ID=<your-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
```