Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregjopa/paypal-button-full-page-redirect-example
HTML-Only PayPal Button integration with the v2 Orders API
https://github.com/gregjopa/paypal-button-full-page-redirect-example
Last synced: 23 days ago
JSON representation
HTML-Only PayPal Button integration with the v2 Orders API
- Host: GitHub
- URL: https://github.com/gregjopa/paypal-button-full-page-redirect-example
- Owner: gregjopa
- Created: 2023-05-24T14:50:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-18T15:41:08.000Z (7 months ago)
- Last Synced: 2024-04-19T02:41:01.281Z (7 months ago)
- Language: TypeScript
- Size: 415 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PayPal Button Full Page Redirect Example
Node.js web server for testing a html-only PayPal Button integration with the [Orders API](https://developer.paypal.com/docs/api/orders/v2/). Built with the [Fastify web framework](https://www.fastify.io/).
## Quick Start
Copy `example.env` to a new file named `.env` in this project's root directory and add your API credentials to it. This will securely pass them and other config options to the Node.js web server as environment variables at runtime. The `.env` file with your credentials should _never_ be checked into git version control.
This application requires Node.js version 16.8.0 or higher. Please ensure you have installed and enabled the correct version.
Then install dependencies and start the local web server:
```bash
npm install
npm run dev
```Then go to http://localhost:3006/
## When to use this integration pattern
When you want to render the PayPal Button on your e-commerce website, but you have strict security rules that prevent:
- 3rd party JavaScript
- Cross-origin documents (iframes/popups)
- [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
- [Cross-Origin-Embedder-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy)