A sample app demonstrating the use of paypal-js to add PayPal buttons to a basic Angular app.
This project was generated with Angular CLI version 11.0.3.
Install the dependencies...
cd ng-integration
npm install
...log in to the developer dashboard and get your client ID from your default application. Change const CLIENT_ID = 'your-client-id';
in src/app/checkout/checkout.component.ts so CLIENT_ID matches your sandbox client ID...
If you need help setting up your developer dashboard or finding your client ID, follow the first step in the getting started documentation to get API credentials
...then start:
npm run start
Navigate to localhost:4200. You should see the app running.
The JavaScript SDK is imported via paypal-js in src/app/checkout/checkout.component.ts where we set up a div to hold the buttons. Style, payment method, and other options can be specified in paypal.Buttons()
For more details and configuration options look at paypal-js usasge and the PayPal JavaScript SDK Complete Reference