As Paypal already released their new REST APIs for several month and they marked their old approach NVP and SOAP API as LEGACY way to invoke PayPal payment gateway, it’s necessary to update my PayPal Digital Goods tools by PayPal Rest API.
PHP Development ENV for PayPal REST API
Here are all tools for building PHP development environment:
- PHP Debug (VScode Extension released by Xdebug)
- XDebug (PHP Extension)
Here is the official VS code document for developing PHP.
To debug PHP in VScode, let’s install the PHP Debug VScode extension. After that, we need to install the xdebug PHP extension and enable it in PHP.ini file. Xdebug Wizard can help to download the right version. Here is the way to download the correct version targeting your PHP:
- Make sure you already install PHP in your system.
- Type following statment in command line:
php -i > info.txt
- Open info.txt file
- Copy and paste content in the wizard
- Click “Analyse my phpinfo() output” button
- Following the coming instruction to download xdebug and enable it
For example, this is my installation instruction:
- Download php_xdebug-3.1.5-7.4-vc15-x86_64.dll (As my current PHP version is 7.4 in Windows). This is different basing on your system and PHP version
- Rename it to php_xdebug.dll
- Move the downloaded file to ext folder is D:\Program Files\php-7.4.30\ext
- Update D:\Program Files\php-7.4.30\php.ini and add the line:
zend_extension = xdebug xdebug.mode = debug xdebug.start_with_request = yes
Now we can programe and debug our PHP script in VS code. This is how debug looks like: