Skip to content

A PayPal REST API sandbox to experiment with payments and subscriptions

License

Notifications You must be signed in to change notification settings

8ctopus/paypal-sandbox

Repository files navigation

PayPal sandbox

A PayPal REST API sandbox to experiment with payments and subscriptions

php sandbox screenshot

I did my best to make easy to get started experimenting with the PayPal REST API. If something is not clear or can be improved, your contribution is welcome!

features

  • create orders (one-time payments)
  • create subscriptions
  • list and create products
  • list and create plans
  • list, create and delete webhooks
  • process webhook notifications received from PayPal

requirements

  • php 8.x
  • composer
  • ngrok

demo

  • git clone the project

  • install composer dependencies

composer install
php -S localhost:80 public/router.php
  • start ngrok to receive PayPal notifications to your development environment
ngrok http 80
  • head to http://localhost in your browser

The demo when started automatically lists all existing products, plans and webhooks.

Once started, you can place an order (use the ngrok url as return url) For subscriptions, if you never used the PayPal REST api before, you will need to create a product, a plan and a webhook first.

debugging

To debug the javacript code, the browser needs to be started with the remote debugging option. For example, on Windows:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222

Then in Visual Studio Code, use js attach to browser.

About

A PayPal REST API sandbox to experiment with payments and subscriptions

Topics

Resources

License

Stars

Watchers

Forks