PayPal's latest complete payments processing solution. Accept PayPal, Pay Later, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.
- PHP >= 7.2
- WordPress >=5.3
- WooCommerce >=4.5
$ composer install
$ yarn install
Optionally, change the PAYPAL_INTEGRATION_DATE
constant to gmdate( 'Y-m-d' )
to run the latest PayPal JavaScript SDK
$ composer install
$ ./vendor/bin/phpunit
$ ./vendor/bin/phpcs
$ ./vendor/bin/psalm
If you want to build a release package (that can be used for deploying a new version on wordpress.org or manual installation on a WP website via ZIP uploading), follow these steps:
- Clone the repository and
cd
into it. - Make sure you have the version in the plugin root file updated.
- Update the PayPal JavaScript SDK integration date by using the current date for the
PAYPAL_INTEGRATION_DATE
constant. - The following command should get you a ZIP file ready to be used on a WordPress site:
$ yarn run build
or if using the DDEV setup:
$ yarn run ddev:build-package
You can install WooCommerce PayPal Payments locally using the dev environment of your preference, or you can use the DDEV setup provided in this repository which includes WP, WC and all developments tools.
To set up the DDEV environment, follow these steps:
- Install Docker and DDEV.
- Edit the configuration in the
.ddev/config.yml
file if needed. $ ddev start
$ ddev orchestrate
to install WP/WC.- Open https://wc-pp.ddev.site
Use $ ddev orchestrate -f
for reinstalattion (will destroy all site data).
You may also need $ ddev restart
to apply the config changes.
Tests and code style:
$ yarn ddev:test
$ yarn ddev:lint
$ yarn ddev:fix-lint
- PHPCBF to fix basic code style issued
See package.json for other useful commands.
For debugging, see the DDEV docs.
Enable xdebug via $ ddev xdebug
, and press Start Listening for PHP Debug Connections
in PHPStorm.
After creating the server in the PHPStorm dialog, you need to set the local project path for the server plugin path.
It should look like this.
See tests/playwright for e2e (browser-based) tests.
You will need a PayPal sandbox merchant and customer accounts to configure the plugin and make test purchases with it.
For setting up test accounts follow these instructions.
For testing webhooks locally, follow these steps to set up ngrok:
-
Install ngrok.
-
If using DDEV, run our wrapper Bash script which will start
ddev share
and replace the URLs in the WP database:$ .ddev/bin/share
-
For other environments, run
$ ngrok http -host-header=rewrite wc-pp.myhost
and in your environment variables (accessible to the web server) add
NGROK_HOST
with the host that you got fromngrok
, likeabcd1234.ngrok.io
. ngrok will be used only for the webhook listening URL. The URLs displayed on the WordPress pages, used in redirects, etc. will still remain local.
- Complete onboarding or resubscribe webhooks on the Webhooks Status page.
All feedback / bug reports / pull requests are welcome.